Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-09-2004, 07:38 PM   #1
it_babe
Registered User
 
Join Date: May 2004
Location: Norway
Posts: 11
Default movieclip sequence

I have an instance of a movieclip on my main swf which is trigged by a button. After this movieclip has finished, I want to load an external swf into the main swf. What is the right actionscript for this?

Here is what I want:

on(release){
my_mc_instance.gotoAndPlay(1);

when my_mc_instance has finished {
loadMovieNum("mymovie.swf", 1)

}
}
it_babe is offline   Reply With Quote
Old 07-09-2004, 07:43 PM   #2
markL
Registered User
 
Join Date: Aug 2003
Location: Mi
Posts: 45
Send a message via AIM to markL
Default

Inside the my_mc_instance's timeline, create a keyframe at the end of it and put the loadMovieNum method there.

Added to your button.

on(release){
my_mc_instance.gotoAndPlay(1);
}

Added at the end of my_mc_instances timeline

loadMovieNum("mymovie.swf",1);
markL is offline   Reply With Quote
Old 07-09-2004, 07:58 PM   #3
it_babe
Registered User
 
Join Date: May 2004
Location: Norway
Posts: 11
Default

thanks for the reply. The problem is that I will be using the movieclip instance several times, but the external swf will be a different one depending on which button is clicked. What do I do then?
it_babe is offline   Reply With Quote
Old 07-09-2004, 08:15 PM   #4
markL
Registered User
 
Join Date: Aug 2003
Location: Mi
Posts: 45
Send a message via AIM to markL
Default

Well everyone has their own methods of getting from point A to B. And I'm not fully understanding exactly your situation. Could you please give a little more info?

example: Are the movieClip instances used a buttons or to tell Flash to load a swf?
markL is offline   Reply With Quote
Old 07-09-2004, 08:26 PM   #5
it_babe
Registered User
 
Join Date: May 2004
Location: Norway
Posts: 11
Default

I have several buttons on my main swf, and no matter which button is being clicked, the same movieclip instance will be played. The movieclip instance is just a simple animation.
BUT: The difference between the buttons is that after the movieclip instance is done playing, they will each trigger a different external swf. Let's say there is a button for "home" and another one for "news" which will each load a "home.swf" and a "news.swf" when clicked.
it_babe is offline   Reply With Quote
Old 07-09-2004, 09:03 PM   #6
markL
Registered User
 
Join Date: Aug 2003
Location: Mi
Posts: 45
Send a message via AIM to markL
Default

Give me a few and I will create a function to handle that.
markL is offline   Reply With Quote
Old 07-09-2004, 09:09 PM   #7
it_babe
Registered User
 
Join Date: May 2004
Location: Norway
Posts: 11
Default

No sure what u mean...
Button #1: Profile
on(release){
this.contentframe.gotoAndPlay(1);
//load profile.swf
}

Button #2: Webdesign
on(release){
this.contentframe.gotoAndPlay(1);
//load webdesign.swf
}

Button #3: Contact
on(release){
this.contentframe.gotoAndPlay(1);
//load contact.swf
}
it_babe is offline   Reply With Quote
Old 07-09-2004, 09:15 PM   #8
markL
Registered User
 
Join Date: Aug 2003
Location: Mi
Posts: 45
Send a message via AIM to markL
Default

This probably doesn't work but it at least gives you an idea of maybe how to do this.

Code:
var swfArray:Array = new Array("us.swf", "me.swf", "you.swf", "him.swf", "her.swf");
function mcLoader(swfName) {
	this.onPress = function() {
		this.onEnterFrame = function() {
			if (_root.my_mc_instance._currentframe<_root.my_mc_instance._totalframes) {
				_root.my_mc_instance.nextFrame();
			} else {
				_root.loadMovieNum(swfName, 1);
                                _root.my_mc_instance.gotoAndStop(1);
				delete this.onEnterFrame;
			}
		};
	};
}
for (i=0; i<swfArray.length; i++) {
	this["btn"+i].mcLoader(swfArray[i]);
}

Last edited by markL; 07-09-2004 at 09:22 PM.
markL is offline   Reply With Quote
Old 07-09-2004, 09:23 PM   #9
it_babe
Registered User
 
Join Date: May 2004
Location: Norway
Posts: 11
Default

Thanks a lot, but it would be a great help if you could tell me where to put it (after altering it of course) and what it does... I'm just a beginner
it_babe is offline   Reply With Quote
Old 07-09-2004, 09:29 PM   #10
markL
Registered User
 
Join Date: Aug 2003
Location: Mi
Posts: 45
Send a message via AIM to markL
Default

Well you would just name your buttons btn0, btn1, btn2, btn3, btn4 and put the buttons on the _root timeline and then create an actions layer and place that code in it. Then in the swfArray just assign the slots with the name of the swf's.

ie: being how the for loop i starts at 0 and would call swfArray[0], you would want to use the name of the swf that btn0 would load or reload.

Far as the code I scribbled, I was having trouble with getting the function to work correctly. Maybe someone can explain why it wasn't working?
markL is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.