flash question
- Started
- Last post
- 11 Responses
- redant
If there is a button inside a movie clip is there any way to assign different actions to it on the main timeline? I need to use the movieclip more than once on the main time line. Pls help thanks :)
- Mick0
You can put different actions in named frames and use the "CALL" action.
I'm not quite sure of what you're trying to do though.
- redant0
I was just going to make an elastic menu. I would need each diff menu item button to bring up a different page. Does that make sense? The button is draggable within the mc?
- unformatted0
write a function.
function jumpPage(shit) {
gotoandPlay(shit);
}then to call the function
jumpPage(framename);
if you are jumping to another frame.
make sense.
- b34r0
Duplicate the button... (n) times
Give it an ID during the duplication...
Use the onPress() to call a function on the main timeline.
In that function, pass in the ID as an argument.
use a switch/case or if/else statment to work out which button was pressed.
hope that helps... :P
- redant0
I'm going to try what u guys are saying thanks! xoxo
- shant0
even easier, give the clip the button is in a unique instance name for each section. then just use the _name property, to jump to the corresponding label.
so if you have a section with a frame label that is "blah" then give the clip the instance name blah and then:
on(release){
gotoAndStop(_name);
}that should do it.
- redant0
maybe i'm not explaining right? the movie clips are draggable buttons. I would like to use the same movie clip more than once and have the button within the movie clip open a different page or show a diff image? Does that make sense? If the button is in the movie clip i have to assign actions inside the clip on the button so how do i make the diff mc's on the maintimeline do diff things? thanks
- shant0
like i said, use my method. you name each instance something different, and then use the _name property as a variable whether it be going to a new frame or opening a different clip.
try putting trace(_name) on the release function of a button in those clips. you'll see it returns the instance name of the clip, which can be used to keep things unique.
- redant0
OK I think I got it thanks a bunch!
- JazX0
well you seem to be doing it backwards
- shant0
hows it backwards?