Cheapcrap
9 posts
|
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Getting the logged in user as a variable.
Hello, community!
So, I have a problem. I need to get the user that is logged in to a web page. The user’s name can be accessed from an xml file (www.page.com/test.php).
If no user is logged in, the text shows up as ‘guest’. When I try to access the file from AS3, it always shows up as guest, so I am guessing that it doesn’t show the right session.
Any help on how to fix this will be really appreciated. Thanks!
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Assigning card faces via link with XML.
Quite every part. I am pretty new.
Yes, I read, and I can load the images in game, I just need a logical way to put them in frames of an object.
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Assigning card faces via link with XML.
Originally posted by Senekis93:
I’d suggest not using movieclips/frames.
Read about the Loader and URLLoader classes. That should be enough to load the images and the XML file.
Then you could draw all of them to a spritesheet or if you find that too complicated, just make your cards extend Loader.
It would be great if you could explain a bit more on this.
Thanks.
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Assigning card faces via link with XML.
Hello, I am making a simple memory card game and I practically do not know anything about XML usage and I am no so experienced in AS3.
Here is my idea and problem:
I have only one object – ‘card’, which consists of 19 frames (18 card faces). My idea of faces are that they would be user avatars from an XML file (they are shuffled inside of XML file randomly every time). If anyone is interested in the XML file, here is the link:
http://exs.lv/random_avatars.php
My output when tracing XML file looks like this: [img]http://viesty.exs.lv/bildes/06ZQNZ.png[/img]
What I need to do, is I need to put in frames those avatars. To access the avatars, I have to use a link, adding the avatar ID given in XML, for example (http://homepage.extension/avatar/ID.jpg)
This is my code for adding cards.
for (var x:uint = 0; x<boardWidth; x++)
{
for (var y:uint = 0; y<boardHeight; y++)
{
var c:Card = new Card();
c.stop();
c.x = x * spacingX + borderX;
c.y = y * spacingY + borderY;
var r:uint = Math.floor(Math.random() * cardlist.length);// get a random face
c.cardface = cardlist®;// assign face to card
cardlist.splice(r,1);
// remove face from list;
//c.gotoAndStop(c.cardface+2);
c.addEventListener(MouseEvent.CLICK, clickCard);
c.buttonMode = true;
addChild©;
}
}
}
Help will be extremely appreciated. Thank you!
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Changing object frames.
Well, anyhow thanks and I will definitely contact ;)
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Changing object frames.
Awesome, thank you for the help!
If I have any further issues, may I contact you via Private Messages?
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Changing object frames.
Thank you.
I could explain my issue a bit more. Maybe that would give a better insight of what I wish to reach.
Basically I have an XML file and it consists of user avatars. I want to make user avatars the faces of my cards.
What should I do? :)
|
Cheapcrap
9 posts
|
Topic: Game Programming /
Changing object frames.
Hello, I am not experienced in AS3, so I will just leave my question here.
So basically what I want to do, is change object frames.
Some points:
> It is a card flipping (memory) game.
> I have only 1 object ‘card’, with 18 different frames in it.
> I want to change the frames via the main .as code.
Any help would be appreciated, also, explain me like I am five :)
Thanks a lot!
|