PDA

View Full Version : Actionscript Help Needed


pashonit
05-22-2005, 09:47 PM
I am looking to do something like this:

Say I have buttons that have this script-

_global.page_to_open = "/about/";

(the "about" part is changed on each button to correspond with each button name (eg. biography, photos etc..)

and say I have this script on a certain point on the timeline:

getURL(_global.page_to_open, "_self");


This is all for getting the url of the button that is pressed to come up at the time I want it to. Is there a way to apply this kind of thing to a loadMovie situation? What do I change in the code?


The way I have my loadMovie linked currently is:

_root.contents.loadMovie("about.swf");


So I am looking to add code to each button that will open a swf file, specified to the button pressed, and I want to add a code to the timeline that it knows to open the swf of the button just pressed. Same idea as above but with swfs.


I have tried to play around with it but I can't figure it out. I hope I explained it well enough for someone to help me out.

Please help if you can. Thank you.

oldnewbie
05-23-2005, 03:30 AM
_global.movieToLoad = "about.swf";

On a frame action:

_root.contents.loadMovie(_global.movieToLoad);

On a button:

on(release){
_root.contents.loadMovie(_global.movieToLoad);
}

Or on a button, set the variable...

on(release){
_global.movieToLoad = "about.swf";
_root.play();
}

...And on a later frame action...

_root.contents.loadMovie(_global.movieToLoad);

pashonit
05-23-2005, 02:03 PM
Thank you very much for your help with the question above.

I have one more question...if you can help, or anyone for that matter. (I hope it is not a forum faux pas to ask another question in the same thread.)

I have a button that has this actionscript:

on (release) {
_root.contents.gotoAndPlay(4);
_root.keyholemc.gotoAndPlay(55);
}

When I test it, the _root.contents.gotoAndPlay(4); works but the other does not. I am aware that I have the actionscript wrong with _root.keyholemc.gotoAndPlay(55); as, well obviously it doesn't work, but from a common sense perspective, it needs something I have been trying to figure out and I'll explain...

What I need is the button to target a movie to play called "keyholemc" at (55), as described above. This "keyholemc" movie is in the swf that plays the movie with this button/actionscript I described above in a loadMovie. So _root seems to be incorrect because it needs to target the swf that is playing the swf with this button/actionscript.

Do you have a solution?

pashonit
05-23-2005, 06:48 PM
Please disregard the last question...I figured it out.

Thank you very much for the help. I appreciate it!