Search  

HELP WITH CODE!

HomeForumsFlash DiscussionHELP WITH CODE!
Default-profile eleshop
18 posts

Hi!

So, what I am trying to do is take my navigation (basically a movie clip with 4 buttons inside) and move it to a different part of the screen, based on which button you press. So pressing button 1 will put this movie clip in position 1. Then, pressing button 3, the movie clip will tween over to position 3… ect. And I want it to be a very fluid, eased tween from position to position.

The problem I am having is this: I don’t know how to write the script so that, based on the movie clip’s current position, the clip will tween to any of the other positions. I know I could manually create 4 different “starting positions” and then create 3 tweens coming from each position, but that sounds tedious, and I would like to know how to set a variable (or whatever else way there might be) to determine the starting point of the clip, and then write script to change the position of the clip, and ease into that new position. Thanks in advance!

Posted about 1 month ago
38812 Yvo
112 posts
Exclusive author Referred at least one person Sold between 100 and 1 000 dollars Bought between 1 and 9 items

Before you start, you need to give each button inside the movieclip an instance name. If that’s new to you. You go into the mc and select a button and on the left of the properties tab you can set an instance name. You do that for every button. Then go out of the mc and select the mc and also give that an instance name. You can only refer to each item in actionscript if you give it a name. On the main stage where your menu mc is, you make a new layer in which you place the following actionscript: http://pastie.org/233264

This can be done cleaner but this makes it easy to understand….I hope.

Hope it’s helpful.

The tweening method is easy to find help on with google. Then you can see what all the parameters are for. Not very difficult.

Posted about 1 month ago
36675 LuizZak
165 posts
Referred at least one person Sold between 100 and 1 000 dollars Bought between 1 and 9 items

Tweener

Posted about 1 month ago
Default-profile eleshop
18 posts

Awesome! Thanks a lot guys! That is exactly what I needed.

Posted about 1 month ago
Default-profile eleshop
18 posts
Before you start, you need to give each button inside the movieclip an instance name. If that’s new to you. You go into the mc and select a button and on the left of the properties tab you can set an instance name. You do that for every button. Then go out of the mc and select the mc and also give that an instance name. You can only refer to each item in actionscript if you give it a name. On the main stage where your menu mc is, you make a new layer in which you place the following actionscript: http://pastie.org/233264

This can be done cleaner but this makes it easy to understand….I hope.

Hope it’s helpful.

The tweening method is easy to find help on with google. Then you can see what all the parameters are for. Not very difficult.

Thanks a lot for the help! Now, I’m wondering if there is a way to create two tweens… basically saying “after the object has moved to its new location, have it move again!”

What I am kind of going for is a typewriter effect, where a solid vertical rectangle is positioned somewhere on the stage, and then wipes back to the first position (tween 1), and then wipes back across the screen (tween 2).

Posted about 1 month ago