on (release){
if(_root.enter.level1.showgallery_mc._currentframe == 10){
_root.enter.level1.showgallery_mc.gotoAndPlay(“10”)[COLOR=Red] then go to and play _root.gotoAndPlay(“19”); (this is the part i don’t know how to write in AS. I want it to say "if executed on this button go to frame 19 in root efter having played frames from frame 10. Because i want diffrent buttons to go back to a diffrent frame in the root timeline so i can’t just ad the gotoAndPlay(“19”) at the end of the first animation.)[/COLOR]
}else{
_root.enter.level1.gotoAndPlay(“19”);
}
}
If you don’t understand (cause it’s a bit meassy…) just post what i’m not making clear enough
otherwise… any thoughts anyone? [SIZE=3]
[COLOR=Red]THIS HAS CHANGED SOMEWHAT… PLEAS FOLLOW THE THREAD FOR UPDATES[/COLOR][/SIZE]
hehe, sorry about the xplenation in code… but that realy didn’t help much :h: what i want is to tell flash that if i push the contact button and if the gallery is open, first close the gallery, after having played the frames in the galley clip gotoAndPlay frame 19 on the root timeline, but if i hit the guestbook btn, close the galler, but the gotoAndPlay frame 20 in the root timeline and so on for all the other btns… hope i gave a better explenation this time
this is what i got now
on (release){
if(_root.enter.level1.showgallery_mc._currentframe == 10){
_root.enter.level1.showgallery_mc.gotoAndPlay(“10”);
}else if(_root.enter.level1._currentframe == 25){
stop();
}else{
_root.enter.level1.gotoAndPlay(“19”);
}
}
and it works, only when it finnished playing in the showgallery_mc it goes to and stop at frame 18 in root timeline, because i dont know how to specify which frame it should go to deppending on what btn was hit
make this a function and call it from the button and pass in a param to tell who is calling it.
example -
(i made this function on the root timeline in the example)
function doAction(action:String):Boolean{
[indent]//return value ‘optional of course’
var completed:Boolean = false
switch case(action.toLowerCase()){
[indent]case “contact”:
[indent]//code to execute if contact was pressed
//set the return to true - this way you can
//add condionals based on if this runs
completed = true
[/indent]break’;
case “guestbook”:
[indent]//code to execute if guestbook was pressed
completed = true
[/indent]break;
[/indent]}
return completed
[/indent]}
on your buttons - (im assuming these are nested in a clip somewhere)
on(release){
[indent]//change to guestbook for guestbook button
_root.doAction(“contact”)
//OR
//if you want to make it conditional (you want it
//to do the function first, then do something else…)
if(_root.doAction(“contact”){
[indent]//additional code here
[/indent]}else{
[indent]//that did nothing
trace(“function call failed”)
[/indent]}
[/indent]
}
This isn’t really related to your original problem, but it looks like the syntax of the switch statement is wrong. As Macromedia’s dictionary describes switch, its syntax should follow:
the problem is still the same… I would like it work so that when i press the (for example) contact btn it plays the frames that closes the gallery or guestbook first if there open, and then plays the frames for opening the contact form.
i’m attaching the fla in a zip… MX 2004.
_root.enter.level1.motion << this is where it’s all @ in the fla