action scripting

Soldato
Joined
1 Jul 2007
Posts
5,392
Basically have a "home" page in flash (8 prof)
on here it includes three buttons
each button plays a seperate movie
each movie has in it a button on the last frame to link to "home-page"
how do i actionscript this all so button 1 links to movie 1, plays movie, home button links back to home page.

I'v been able to do the actionscripting to make the movie clips stop looping (when testing scene), and got two other buttons to link to web adresses.

cheers for any help.

and at some point while messing about i got button1 to movie 1 but didnt play movie just skipped to end frame, but i didnt have the home page button programmed in- but deleted all this.
 
well at the moment i only have the home-page set up.
the movies have been made but are still sitting in the library waiting to be placed however its done.

it'll be uploaded in the next hour or so.
 
it's the source (.fla files) that i'd like to view, so i can see the workings of how you have your movie setup.

you could email them to me if it's easier/if you wish. replace AT with @... dabarATntlworld.com
 
I've had a quick look, i think i can see where your going.. There are other way's to get the effect that would be easier to read/edit.

I'll do an example in a mo and we'll see if it's the effect your after.
 
cheers, only been using flash for a month or two...well should have been using it for that length, only just pulled the finger out and started doing my uni work for it, so I admit I am a complete noob and basically just arranged stuff how my logic tought it would go.
 
example swf file:
http://homepage.ntlworld.com/dabar/ocuk/flash/example1.swf
it's fla file:
http://homepage.ntlworld.com/dabar/ocuk/flash/example1.fla

All of the actions are on the layer ActionScript.

The things you may miss are the instance names on the buttons, select a button and on the properties toolbar you'll see in an editable textfield to the left, you'll find: btn1, btn2, btn3 or btnHome for the home button, these are the names referenced in the ActionScript.

It should be pretty easy to see whats going on, have a browse of the fla and if you have any questions i'll be about :)
 
aargh!
still cant get the thing to work.

I know someone said you shouldnt use scenes but if I create 3different scenes for each movie clip, but instead rather than have the movie clip as a movie clip just copy them frame for frame then have the buttons link to those those scenes would that work? Then have the home button that appears at each end frame link back to scene 1, frame 1.

if that whaffling is comprehendable
 
select a frame on the layer your using for lables, press F7 for a new blank keyframe and on the properties toolbar, same area as the instance names are assigned, you'll see the textfield input.
 
Last edited:
try this..

btn1.onRelease = function() {
gotoAndStop("Sketch1");
sketchMovieClip.gotoAndPlay(1);
};

sketchMovieClip being the instance name given to the movieClip you wish to be played in Sketch1.
 
do the movieclips have any action script in them?
just that it keeps looping if i dot have anything in them, but with what works to make it play once in "test scene" just takes straight to last frame of the moveclip when "test movie"

I've also taken the "home" button out of the movie clip and was putting it so it would appear in the last frame of the movie (so when it has stopped) by put the button on a new layer, but the button isnt showing when i test the movie. compared to yours when home features all the way through a clip.
 
Last edited:
just looked in the animating clips i have here and their frame 1 has the action gototAndPlay(); with the frame numbers set to goto the last frame.

change these gotoAndplay's to just play(); then select the very last frame on the actions layer, press F7 and give it the action stop();
that should now start from frame 1 and prevent looping.

if not, upload or email it and i'll have a look over.

PS
there's an easier way to deal with the home button. back where it was, where the AS sets the binding;

btnHome.onRelease = btnGotoHome;
btnHome._visible = false;

on the last frame of the animating clip's where you added the stop(); action..

_root.btnHome._visible = true;
stop();
 
Last edited:
thank you,
how do you make the home button in the movie link back to home?
Ive tried changing what ever the code was for the other buttons to co-incide but didnt seemt to want to work eg replacing sketch1_btn to home_btn, and then ("sketch1") to ("home")

but i could have easily missed something out.

I think i may have an other couple of problems/no idea how to do it for a different project but still need to spend a decent time messing about with settings and stuff.
 
the home button with-in a movieClip ..

btnHome.onRelease = function() {
_root.gotoAndStop("Home");
};

edit: this code needs to be in the movieclip along with the button, put it on the actions layer above the stop();
 
Last edited:
Its onto a different project now but;
is there a way to increase the over all size when published? I know when its html you can increase decrease size of the viewing window but is there a way for swf files?
 
Back
Top Bottom