-
ostracized
How do you have a character on a straight horizontal line, and have it so when you hit <left> or <right> the character will move one space in that direction? Please help, if you have a .fla can u please send it?
Thanks for helping.
-
Fruitloops, try this:
On (Key: <Left> )
Set Variable: "location" = GetProperty ("/character", _x )
Set Property ("/character", X Position) = location - 10
End On
On (Key: <Right> )
Set Variable: "location" = GetProperty ("/character", _x )
Set Property ("/character", X Position) = location + 10
End On
This assumes your "Character" has an Instance name of "character" and its placed on your main timeline. If it's placed elsewhere, you will have to adjust the reference to it.
Cheers,
Markus B
-
ostracized
Can u put together a working .fla for me please? i tried several times that code u put, but it wont work.
-
The Actionscript needs to be attached to a button otherwise it won't work. I apologize, I should have stated this in my post. Place a button in your main timeline. Assign the code above to the button. I either use a Blank button (ie. object in the Hit frame only, or a button with an explanation of what the user needs to do in order to make the character move). Then when you run your movie, your character will move left to right. If you aren't able to get this to work, I'll e-mail you a working demo FLA.
Cheers,
Markus B
-
ostracized
I had it in a button, im not stupid! geez, lol it still doesnt work though
-
OK, OK LOL! Check your e-mail.
Cheers,
Markus B
-
ostracized
K, havent got it yet, but i dont know that youve sent it yet
-
ostracized
K, havent got it yet, but i dont know that youve sent it yet THANK YOU MARK B!
-
I went to your homepage and got your e-mail there. To be sure I got it correct, e-mail me at my e-mail address below. If I got it wrong, I'll re-send the FLA.
Cheers,
Markus B
-
ostracized
lol ive been lookin at the wrong email address! hehe I got it, but I haven't finished downloading it yet, but if I have any problems i tell ya. THANKS A BUNCH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|