View Full Version : targeting a framelabel in a .swf
sAjber
September 16th, 2001, 10:23 AM
im wondering if any of u guys know how u target a certain framelabel on "loadmovie". i got these buttons that loads an .swf, and i want to go to different frames on the different buttons...
ex: button 1 loads the .swf and goes to frame1,
button 2 loads the same .swf and goes to frame20
button 3 loads the same .swf and goes to frame30
etc etc
suprabeener
September 16th, 2001, 12:48 PM
_root.loadmovie.gotoAndStop("framelabel");
the quotes are important. is this what you meant?
sAjber
September 16th, 2001, 01:33 PM
hmm i think so... but i couldnt get it to work...this is what i got now on the button:
-----------------------------------------------------------
on (release) {
        loadMovieNum ("preloader.swf", 3);
}
-----------------------------------------------------------
so were do i put in the:
_root.loadmovie.gotoAndStop("framelabel");
suprabeener
September 16th, 2001, 05:20 PM
oh, and you want the loaded movie to go to particular frames under particular cirumstances. ok, here's a method:
set a variable in the main timeline (probably with the same button action):
frametarg = 20;
and then in the first frame of the movie you're loading:
gotoAndStop(_level0.frametarg);
in this case it's important not to put quotes, since your referencing a variable rather than a string.
sAjber
September 16th, 2001, 06:06 PM
well i put this on the button:
------------------------------------------------------------
on (release) {
_ _ _ _ loadMovieNum ("preloader.swf", 3);
_ _ _ _ frametarg = 30;
}
------------------------------------------------------------
and this on the MC´s 1st frame i had:
------------------------------------------------------------
gotoAndStop(_level0.frametarg);
------------------------------------------------------------
i couldnt get it to work... i even tried with:
------------------------------------------------------------
setframetarg = 30;
-----------------------------------------------------------
u think u could explain why i put in:
gotoAndStop(_level0.frametarg);
on the first frame in the loaded MC ? is it becouse it should act like a reference spot of were the: _level0 is ?
it would be really helpful if u or anybody else could type in the exact code of what i should put on the buttons and other places...
i really need to solve this asap and i am grateful for your help!
also if u or someboby else know another way pls post it!
sAjber
September 16th, 2001, 06:37 PM
YES!!!! i solved it by preloading the MC with the main movie..
i have a stop action on its first frame so u cant see it...
the i just put in:
-----------------------------------------------------------
on (release) {
        tellTarget ("_level3") {
                gotoAndPlay ("news");
        }
}
------------------------------------------------------------
etc etc on each button.... :) tnx anyway man !
suprabeener
September 16th, 2001, 06:38 PM
_level0 refers to the movie in level 0. it's important to use the compete path to variables or flash can't find them.
"frametarg" was arbitrarily chosen, you could have called it "howard" and it work just as well.
perhaps in the button put the variable in to _level0 explicitly:
_level0.howard = 20;
if you button was in a movie, that would explain why it's not working. if you added the path to the movie when you reference it from the loaded clip, it would also solve this problem ie:
gotoAndStop(_level0.moviewithbutton.howard);
don't do both though! ; )
i think perhaps i don't quite understand what you're trying to do. which movie do you want to go to frame "howard"?
suprabeener
September 16th, 2001, 06:40 PM
we cross posted, congrats!!
you could also write:
on(release){
_level3.gotoAndStop("news");
}
hey, how did you get your code to format like you did?
sAjber
September 17th, 2001, 03:51 AM
hehe :)
waddaya mean with "code to format" ?
suprabeener
September 18th, 2001, 01:42 AM
every time i indent code, this message board removes all the whitespace and it's all up against the left margin.
how did you make your indents stick?
thanks in advance!
kirupa
September 18th, 2001, 06:35 AM
hey suprabeener,
I too have found that problem, and it is quite annoying. I type the code in NotePad, and then I paste the code into ezboard. Notepad does a great job of adding spaces instead of indent marks so the code is indented properly. Luckily for us, Flash doesn't really care about the spaces and indents the code accordingly in the Actions window!
sAjber
September 18th, 2001, 10:20 AM
i just pasted it in here directly after copying it in flash...
ctrl+c and then i pasted it with ctrl+v
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.