Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Communicating From A Loaded Clip To The Main Timeline



So I have a menu system with a button on it. When you click the button an external swf loads onto the stage. I need to create a button in the external swf that will tell the main timeline to play. On the main time line I will then be removing the loaded clip and transitioning back to the menu.I cannot find how to communicate from the loaded swf back to the main time line in order to make it play.Thanks for your help.



KirupaForum > Flash > ActionScript 3.0
Posted on: 12-20-2008, 02:57 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Loaded Swf Communicating With Main Timeline
Hi Everybody,

I have posted and searched all over for an answer to this problem, but have had no luck. I’m hoping you can help. I have set up a gallery of graphic design work. I want to be able to click on a small version of each piece in the gallery and have it “grow” into a larger version. Then when that larger version is clicked, I want it to shrink back down and return to the submenu.

I have been able to make it so that when the small version is clicked, it loads a swf of that piece“growing” into the larger version. And when the larger piece is then clicked, the timeline jumps to another keyframe on the swf and “shrinks” the piece.

What I would like to happen is that when the swf reaches the last frame, it jumps to the submenu on the main timeline, but I’m having trouble making the timeline of the loaded swf communicate with the main timeline.

I think the problem has to do with adding the Child to the stage, but if I don’t add the swf to the stage, it doesn’t show up.

Thanks so much in advance for your help!

Here is the code:

//This loads the swf file that shows the piece enlarging and shrinking.

var requestBigEngine:URLRequest = new URLRequest("bigEngine.swf");
var bigLoader:Loader = new Loader();
bigLoader.load(requestBigEngine);

//This listens for the completion of the load of the swf and starts the function "bigEngineLoaded" which puts the swf on the stage and makes a movie clip (bigEngineMC) out of the loaded swf so its timeline can be controlled.

bigLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, bigEngineLoaded);

function bigEngineLoaded(myevent:Event):void {
var bigEngineMC:MovieClip=myevent.target.content;
stage.addChild(bigLoader);


//When the enlarged piece is clicked, it "shrinks" and the viewer is returned to the submenu

bigEngineMC.addEventListener(MouseEvent.CLICK, gobacktoSubMenu0_0);

function gobacktoSubMenu0_0(evt:Event):void {
bigEngineMC.gotoAndPlay("engineShrink");
}

//This is what doesn’t work:

if (bigEngineMC.currentLabel == "gobacktoSubMenu0_0") {
parent.gotoAndPlay("printSub0_0");
bigLoader.unload();
}
}

Loaded SWF Communicating With Main Timeline
Let's say I load an external SWF to my main timeline. In that loaded SWF, I'd like to have a button that when clicked, removes a Movie Clip from the main timeline.

How do I do that? Should be simple, right?

Loaded Swf With Button , Not Communicating To Main Timeline
my main stage/timeline has a UILoader "UILoaderOne" and another one "UIloaderTwo".

i have some buttons on the main stage which pull up some images into the UILoaderOne.
these work fine and look like this.

//BEGIN BUTTONCODE\
//button to load image into loader "loaderOne" x01_btn and x01_ldr, thumb image is "x01.jpg and main image is p01.jpg\
//crop thumb image to size 50px tall by whatever wide and resize loaderButton if needed, main image will resize proportionatly\

x01_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
//import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;

var url:String = "assets/01.jpg";

//var myUILoader:UILoader //= new UILoader();
myUILoader.unload();
myUILoader.autoLoad = false;
myUILoader.source = url;
//myUILoader.move(10, 10);
myUILoader.scaleContent = true;
myUILoader.load();

var myProgressBar:ProgressBar = new ProgressBar();
myProgressBar.source = myUILoader;
myProgressBar.setSize(100, 10);
myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
myProgressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myProgressBar.addEventListener(Event.COMPLETE, completeHandler);
addChild(myProgressBar)

var myLabel:Label = new Label();
myLabel.text = ". . . . . X . . . . . ";
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height);
addChild(myLabel);

function progressHandler(event:ProgressEvent):void {
//trace("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%");
//myLabel.text = event.bytesLoaded + " of " + event.bytesTotal + " bytes loaded.";
myLabel.text = ("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
//myLabel.text = Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
}

function completeHandler(event:Event):void {
trace("complete:");
myProgressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
myProgressBar.removeEventListener(Event.COMPLETE, completeHandler);
removeChild(myProgressBar);
removeChild(myLabel);

//addChild(myUILoader);
}

//trace("typeMe");

}
//end BUTTONCODE\
//end BUTTONCODE\

the second Loader "UILoaderTwo" auto loads another swf file with the INTENT to load from buttons, images into the ULLoader "UILoaderOne" which is on the main timeline.

this part is failing
the error i get in Output window is
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at sOne_fla::MainTimeline/onClickz()

the swf that loads is sOne.swf

and it has code of this

z01_btn.addEventListener(MouseEvent.CLICK, onClickz);
function onClickz(event:MouseEvent):void
{
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;

var url:String = "assets/xx.jpg";

var myUILoader:UILoader //= new UILoader();
myUILoader.unload();
myUILoader.autoLoad = false;
myUILoader.source = url;
//myUILoader.move(10, 10);
myUILoader.scaleContent = true;
myUILoader.load();

var myProgressBar:ProgressBar = new ProgressBar();
myProgressBar.source = myUILoader;
myProgressBar.setSize(100, 10);
myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
myProgressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myProgressBar.addEventListener(Event.COMPLETE, completeHandler);
addChild(myProgressBar)

var myLabel:Label = new Label();
myLabel.text = ". . . . . X . . . . . ";
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height);
addChild(myLabel);

function progressHandler(event:ProgressEvent):void {
//trace("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%");
//myLabel.text = event.bytesLoaded + " of " + event.bytesTotal + " bytes loaded.";
myLabel.text = ("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
//myLabel.text = Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
}

function completeHandler(event:Event):void {
trace("complete:");
myProgressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
myProgressBar.removeEventListener(Event.COMPLETE, completeHandler);
removeChild(myProgressBar);
removeChild(myLabel);

//addChild(myUILoader);
}

//trace("typeMe");

}
//end BUTTONCODE\
//end BUTTONCODE\

Problem With Loaded Swf Communicating With Main Timeline
Hi Everybody,

I have searched all over for an answer to this problem, but have had no luck. I’m hoping you can help. I have set up a gallery of graphic design work. I want to be able to click on a small version of each piece in the gallery and have it “grow” into a larger version. Then when that larger version is clicked, I want it to shrink back down and return to the submenu.

I have been able to make it so that when the small version is clicked, it loads a swf of that piece“growing” into the larger version. And when the larger piece is then clicked, the timeline jumps to another keyframe on the swf and “shrinks” the piece.

What I would like to happen is that when the swf reaches the last frame, it jumps to the submenu on the main timeline, but I’m having trouble making the timeline of the loaded swf communicate with the main timeline.

I think the problem has to do with adding the Child to the stage, but if I don’t add the swf to the stage, it doesn’t show up.

Thanks so much in advance for your help!

Here is the code:

//This loads the swf file that shows the piece enlarging and shrinking.

var requestBigEngine:URLRequest = new URLRequest("bigEngine.swf");
var bigLoader:Loader = new Loader();
bigLoader.load(requestBigEngine);

//This listens for the completion of the load of the swf and starts the function "bigEngineLoaded" which puts the swf on the stage and makes a movie clip (bigEngineMC) out of the loaded swf so its timeline can be controlled.

bigLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, bigEngineLoaded);

function bigEngineLoaded(myevent:Event):void {
var bigEngineMC:MovieClip=myevent.target.content;
stage.addChild(bigLoader);
}

//When the enlarged piece is clicked, it "shrinks" and the viewer is returned to the submenu

bigEngineMC.addEventListener(MouseEvent.CLICK, gobacktoSubMenu0_0);

function gobacktoSubMenu0_0(evt:Event):void {
bigEngineMC.gotoAndPlay("engineShrink");
}
//This is what doesn’t work:

if (bigEngineMC.currentLabel == "gobacktoSubMenu0_0") {
parent.gotoAndPlay("printSub0_0");
bigLoader.unload();
}
}

Loaded Swf With Buttons Not Communicating With Main Movie Timeline
hi

i have a swf that i load into a level in the main movie that contains my menu. i want to use the buttons in this movieclip to navigate to different frames in my main movie (which loads other movieclips on different levels)

the buttons are themselves in movieclips but this doesn't seem to be a problem when i have the whole menu in a movieclip in the same movie, not loaded externally.

i've tried using


Code:
on (release) {
_root.gotoAndPlay(40);
}
which works in the same movie, but not when i load the movieclip into the main movie.

Is it because i'm loading the movieclip into layers rather than a container?

i know i'm probably making some huge mistake so any help whatsoever will be greatly appreciated.

thanx

Duswa

Communicating To The Main Timeline From Within A Movie Clip Symbol
Hi Everyone,
I am learning AS3, used to using AS2. This may seem very basic, but try as I may, it does not work anymore.

What I have is a situation where I need to play some frames on the main timeline, say to frame 5. I place a movie clip symbol in frame 5 which I want to play (all is working fine so far).

Once the Movie clip is finished playing, I want the main timeline to start again.
In AS2, I would simply put

_root.play();

Now in AS3, I think it should read

root.play();

but I get an error which reads:
call to a possibly undefined method play through a reference with static type flash.displayisplayObject

What am I doing wrong? Is AS3 no longer allowing us to do this?
Thanks in advance for anyones help!
-Rich

Loaded Clip Controlling Main Timeline...
I am having a strange little glitch which I can't seem to makse sense of:

I have a main movie timeline which loads in an external clip of a map on frame 10. When you click on a particular area of the map, this external clip sends the main timeline to another frame which loads another clip (using _level0.gotoAndPlay(75)

...at least this is how it works when testing from Flash. However, as soon as I run the movies in my browser (from Safari or Firefox), it stops working. It will not send the main timeline to another frame. I've trid using _root as well as _level0, but no luck.

Any ideas?

Thanks!

Communicating To Main Timeline From Ext.swf
how can i communicate from an external swf to the main sites timeline? im asking cause im a bit confused, i have an external swf with its own buttons etc...

and for example if i have a MC with a button that says, on release, go to _root. (whatever frame on the external swfs main timeline)and play (whatever frame) then if im understanding this correctly, then " _root." is to go to the main timeline on whatever swf you are in...but then
if i want to access the main sites timeline from the external swfs, how would i achieve that? is it _root. too or something else?

thanks in advance

Communicating From One MC To Another Both In Main Timeline
Hello
I can't seem to figure out how to get buttons inside of one movieclip on my main timeline to gotoAndPlay frames in another movieclip on that same timeline.

basically I have a intro_mc that I have an enter button in.
and I would like that to gotoAndPlay a framelabel in a 2nd movieclip (content_mc)

the reasons that I have them each in their own mc and not just on the main timeline
is becuase I am proportionally scaling each of the mc's to fill the browser window

I have tried to call it with parent child but I am most surely missing something

any help would be greatly appreciated.

Button In A Mc Not Communicating To Main Timeline
I have a button in a movie clip that is about 4 movie clips into the main timeline. The button's action is to goto a certain frame label on the main timeline, when released. but nothing happens. I am using flash mx 6. Here are some of the codes I've tried with "design" being the targeted frame label on the maintimeline:

on (release) {
_root.gotoAndStop("design");
}


on (release) {
_root.gotoAndStop."design';
}


on (release) {
_level0.gotoAndStop."design";
}


Can anyone help?

Controlling Navigation Of A Movie Clip Inside A Loaded Swf From Main Timeline
Hi,
I am using the two lines of code below in my main movie to laod another swf into level 50 of the main movie. I then want to control an instance of a movie clip inside the loaded swf called background but the second line (goto) does not work.


Code:
loadMovieNum ("desktops/"+backgroundimage, "50");
_level50.background.gotoAndStop(2);
The first line definately works fine.
Does this mean the hierarchy is such that I should be saying _level50.loadedswf_name.background.gotoAndStop(2)
In which case is there a way of giving the loaded swf an instance name when I load it. Or am I completely wrong?
Thanks again
Robin

Swf With Button Not Communicating Properly To Main Timeline
my main stage/timeline has a UILoader "UILoaderOne" and another one "UIloaderTwo".

i have some buttons on the main stage which pull up some images into the UILoaderOne.
these work fine and look like this.

//BEGIN BUTTONCODE\
//button to load image into loader "loaderOne" x01_btn and x01_ldr, thumb image is "x01.jpg and main image is p01.jpg\
//crop thumb image to size 50px tall by whatever wide and resize loaderButton if needed, main image will resize proportionatly\

x01_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
//import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;

var url:String = "assets/01.jpg";

//var myUILoader:UILoader //= new UILoader();
myUILoader.unload();
myUILoader.autoLoad = false;
myUILoader.source = url;
//myUILoader.move(10, 10);
myUILoader.scaleContent = true;
myUILoader.load();

var myProgressBarrogressBar = new ProgressBar();
myProgressBar.source = myUILoader;
myProgressBar.setSize(100, 10);
myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
myProgressBar.addEventListener(ProgressEvent.PROGR ESS, progressHandler);
myProgressBar.addEventListener(Event.COMPLETE, completeHandler);
addChild(myProgressBar)

var myLabel:Label = new Label();
myLabel.text = ". . . . . X . . . . . ";
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height);
addChild(myLabel);

function progressHandler(eventrogressEvent):void {
//trace("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%");
//myLabel.text = event.bytesLoaded + " of " + event.bytesTotal + " bytes loaded.";
myLabel.text = ("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
//myLabel.text = Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
}

function completeHandler(event:Event):void {
trace("complete:");
myProgressBar.removeEventListener(ProgressEvent.PR OGRESS, progressHandler);
myProgressBar.removeEventListener(Event.COMPLETE, completeHandler);
removeChild(myProgressBar);
removeChild(myLabel);

//addChild(myUILoader);
}

//trace("typeMe");

}
//end BUTTONCODE\
//end BUTTONCODE\

the second Loader "UILoaderTwo" auto loads another swf file with the INTENT to load from buttons, images into the ULLoader "UILoaderOne" which is on the main timeline.

this part is failing
the error i get in Output window is
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at sOne_fla::MainTimeline/onClickz()

the swf that loads is sOne.swf

and it has code of this

z01_btn.addEventListener(MouseEvent.CLICK, onClickz);
function onClickz(event:MouseEvent):void
{
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;

var url:String = "assets/xx.jpg";

var myUILoader:UILoader //= new UILoader();
myUILoader.unload();
myUILoader.autoLoad = false;
myUILoader.source = url;
//myUILoader.move(10, 10);
myUILoader.scaleContent = true;
myUILoader.load();

var myProgressBarrogressBar = new ProgressBar();
myProgressBar.source = myUILoader;
myProgressBar.setSize(100, 10);
myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
myProgressBar.addEventListener(ProgressEvent.PROGR ESS, progressHandler);
myProgressBar.addEventListener(Event.COMPLETE, completeHandler);
addChild(myProgressBar)

var myLabel:Label = new Label();
myLabel.text = ". . . . . X . . . . . ";
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height);
addChild(myLabel);

function progressHandler(eventrogressEvent):void {
//trace("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%");
//myLabel.text = event.bytesLoaded + " of " + event.bytesTotal + " bytes loaded.";
myLabel.text = ("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
//myLabel.text = Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
}

function completeHandler(event:Event):void {
trace("complete:");
myProgressBar.removeEventListener(ProgressEvent.PR OGRESS, progressHandler);
myProgressBar.removeEventListener(Event.COMPLETE, completeHandler);
removeChild(myProgressBar);
removeChild(myLabel);

//addChild(myUILoader);
}

//trace("typeMe");

}
//end BUTTONCODE\
//end BUTTONCODE\

Movie Clip Added Using AddChild() Plays Animation Before Loaded To Main Timeline...
In my main timeline I have a movie clip (cursor_mc) that is loaded from the library using addChild(). It works and loads the movie clip, but the animation within cursor_mc is already done. I want the animation to start once the clip is loaded. This should be easy for the action script experts out there, I'm pretty new at this. Thanks for any help!

[FlashMX] Loaded Swf Communicating With Main Movie
Last edited by AxelBitz : 2005-02-17 at 17:59.
























Hello:

I'm making my on-line demo. I have an external movie (logo.swf) laded into an empty mc (container) inside the main movie (main.swf); I need the main movie to go to another section (frame labeled "internet") once logo.swf stops running. The code for lading logo.swf in the main timeline is:


ActionScript Code:
stop();
loadMovie("logo.swf", "container");


The unsuccessful code I have in the last frame of logo.swf is:


ActionScript Code:
stop();
_root.gotoAndPlay("internet");


How can I make main.swf go to the secction I need?

TIA.

Axel.

Control The Play On The Main Timeline From Within A Loaded Movie (not A Movie Clip)?
Question... I have a movie (main movie) that loads another movie (movie 2) automatically. Movie 2 contains a button that loads yet another movie (movie3). Now I’m having trouble with this next part... When movie3 loads I want "main movie" to stop where it’s at in the timeline and stop all other loaded movies until the user clicks another button where upon movie 3 will go away and "main movie" will resume. Movie 2 is like the paper clip guy in Word and movie 3 is my help movie. Therefore, it can be accessed at any point during the main movie and I don’t want to use a goTo command to jump to a frame label or scene. Does anyone have any idea how to control the play on the main timeline from within a loaded movie (not a movie clip)?

Controlling A Movie Clip's Timeline Separately From Main Timeline
I've got a problem here that I've been trying to figure out for a while now, and it seems like it should be way easier than this. Here's what I've got:

I'm trying to make a neato little flash swf with lots of buttons that you can push and another little movie clip will show some little animation.

I thought I could get this done pretty simply by making a bunch of buttons, giving them an over, down, hit, sound, etc. and then having one single movie clip do all of the animations, but cleverly use stop(); and gotoandplay();

I have tried a few different ways, searched through the help & tutorials, looked all over forums on the internets, and I still can't get this to work. The main timeline is really just 1 frame, and its only purpose is to just hold all of the buttons. I have given all of the buttons instance names (ending with _btn). There is a separate layer in the main timeline for the actionscript alone, and was hoping to put all of the gotoandplay commands there. The code that I am trying to use in that frame is:


Code:
this.WV_btn.onRelease = function(){this.productzmovie_mc.gotoAndPlay(2);
};
The productzmovie_mc has a command to stop(); in the first frame, and I am trying to get a button to skip to the next frame to get it going. I put a stop(); on the last frame of that animation so that it won't run through the whole thing on the first button press. If I remove that stop(); on the first frame, the whole animation just runs whenever I test it and the button has no effect.

I thought this would be way simpler than making 25 separate movie clips and hiding them or spawning them. Does anyone know what I could be doing wrong here? This seems like a pretty simple operation, and I am probably screwing up some mundane detail (I always do that). Be gentle, I am trying to learn Flash and I am a bigtime n00b. I can post the .fla if you need to see it, but it's pretty simple so far, just lots of buttons.

Thanks!

Communicating With A Loaded Movie Clip
Hi all,

i am having a problem that has me beating my head against my desk and i cant belive that i dont know the answer.

i am loading a movie clip with loadMovie(http://www.mydomain.com/myswf.swf", "com");

I have a text field within myswf.swf called "score" how do i change the score text field within myswf.swf movie that i load.

i tried com.score = score but that didnt work.

any ideas would be greatly appriciated.

Bill

Communicating With A Loaded Movie Clip
Hi all,

i am having a problem that has me beating my head against my desk and i cant belive that i dont know the answer.

i am loading a movie clip with loadMovie(http://www.mydomain.com/myswf.swf", "com");

I have a text field within myswf.swf called "score" how do i change the score text field within myswf.swf movie that i load.

i tried com.score = score but that didnt work.

any ideas would be greatly appriciated.

Bill

Movie Clip Timeline Vs. Main Timeline
Ok, i have made a movie clip in Swift 3d and have imported it into Flash MX. Now it is in the first frame as flash will place it there and what i would like to have happen is to tell frame 1 that when the movie clip's timeline ends and stops(frame 90) to then move the parent timeline to continue with stuff
If any one reads this please help or refer me to a MX book that is worth the valuble time we think we have!
Mike

HitTest A Clip On Main Timeline With Clip Inside A Clip
I've got a specific (smaller) area that I want to be what makes the collision, not the whole movie clip, so I added a layer with a movie clip on it (inside the main movie clip), gave it an instance name then put this on the clip I want it to collide with:

onClipEvent (enterFrame) {
if (_rider.riderHit.hitTest(this)) {
_root.gotoAndPlay("leftWipeOut");
}
}

"rider" is the main movie clip
"riderHit" is the instance name of the clip inside the main clip

Is what I'm wanting possible. Not sure why it's not working.

Thanks for looking. Hope there's enough information here.

jorge

Target Main Timeline From A Loaded SWF
I'm trying to target an MC on the main timeline from a loaded SWF. How is this done? "_root.mcName" doesn't seem to be working. Is this not possible? When the SWF is loaded into the main movie. The SWFs timeline is "_parent", and I thought "_root" would be used for the main movie timeline.

?????

[MX] Control Main Timeline From Loaded SWF
I have a question for everybody who's past the newbie stage :-)

I have a flash movie (mainmovie.swf) that stops wht a stop action at frame 10.

At frame 10 there's a MC (box1) that is used to load another movie (movie1.swf).

I want to place an action at the end of movie1.swf, that tells the playhead to go to frame 11 in the mainmovie (mainmovie.swf).

How can I do this?

The reason that I use a MC to load a another movie instead of loading it in another level is that in this way its easier for me to position stuff.....

Can anybody help me out please?
Thanx..

Controlling Main Timeline From Loaded Swf.
I have a index.swf loaded into a level on my main timeline.

loadMovieNum (index.swf, 2)

This loades fine. I need the index.swf to stop the main timeline it is loaded in. this is the code i have used before and it worked, this time it does not.

on (release) {
_root.level0.stop();
}

Please help. thanks

Dawn

Controlling The Main Timeline From A Loaded MC
Hi guys... im back i asked this question the other day and the solution i got didnt quite work so i decided to repost and be as descriptive as possible -my problem is i have my main movie "TuffSite" and in it i have various scenes... into which i have empty movie clips that will hold various parts of my design in movie clips on my stage, in this case, i have my "menu_clip" loading into "menu_holdr" and in "menu_clip" i have my buttons -id like them to effect "TuffSite" lets say i want a button to go to and play frame 1 of a scene called Design in the main movie "TuffSite" i'll paste the code bellow but i owondering if the fact that im loading a movie clip into a movie clip and tryin to effect a movie a couple of layers up? i used to the following code which seemingly should work:


on (release) {
_root.TuffSite.gotoAndPlay("Designs")
}


as i understand it the root is refering to my main movie... so the only reason i can think of is that i've missed a "level" or something -any ideas, im gettin pretty Freaked out man!!!

Accessing Main Timeline From Loaded Swf
Hi all,

I'm running into a timeline/display list problem.

Inside my main movie ("main.fla") I am loading a swf ("sub.swf"). I'd like sub.swf to control the main.fla timeline. I've researched and tested a number of methods but haven't had any luck.

I'm currently using this line.


ActionScript Code:
MovieClip(root).gotoAndStop("btn_advertising");

Thank you,
Joe

HELP - Printing Loaded SWF's With Main Timeline
I have a problem with a flash movie I am trying to add a print button to. I am loading a separate SWF and a JPEG from an external source into two separate movie clip_holders. These are loaded dynamically based on a variable.

Everything works fine with the proper images loading but when I try to print out the root timeline using:
printAsBitmapNum (_root, "bmovie") ( I also have a bounding box frame set up)

Everything prints except for the loaded movies. I have tried all I can think of...Any thoughts?

Acces To Loaded.swf Timeline In Main.swf
I'm new to 3.0
I'm trying to get access to the timeline in a nested swf.

I've imported the swf file via a AS file like this :

var Mc_Annonce:ImporterT=new ImporterT("Annonce.swf");
this.addChildAt(Mc_Annonce,6)
Mc_Annonce.x=20;
Mc_Annonce.y=170;

now i want to have acces to nested timeline. I've try this :

Bt_Bouton.addEventListener(MouseEvent.CLICK,Change);
function Change(e:MouseEvent){
root.Mc_Annonce.gotoAndStop(41);
}
but it doesn't work

I need a good tip

Loaded Swf Corrupting Main Timeline
for some reason, this swf, when loaded, is making my main timeline replay the intro of the site.... not sure exactly why, but I think something in the script is interacting with the _root
hmmm.. any thoughs?


Code:
_global.slideDuration = 2*1000;
function btnAction(btnName){
btnName.onRollOver = function(){
this.gotoAndStop(2);
}
btnName.onRollOut = function(){
btnName.gotoAndStop(1);
}

}
// APPLY TO BTNS
_global.pressPages = this;
for(i=1; i<15;i++){
var btn = this["btn"+i];
//trace(btn);
btnAction(btn);
}
// GO TO FRAME ACTIONS
btn1.onRelease = function(){
pressPages.gotoAndStop(1);
mask.gotoAndPlay(2);
}
btn2.onRelease = function(){
pressPages.gotoAndStop(2);
mask.gotoAndPlay(2);
}
btn3.onRelease = function(){
pressPages.gotoAndStop(3);
mask.gotoAndPlay(2);
}
on and the btn function above is rewritten for each btn.. any way around this?

Targeting The Main Timeline From Loaded Swf
Hi everyone

well I have an swf that loads an external swf with this code:
loadMovie("Portfolio_1.swf",0); [so far so good!]

but now from inside Portfolio_1.swf I want to go back to the main
timeline to "Scene2, porfolio" (name of scene,frame)
...so I used this code on in a frame targeting the back button in Portfolio_1.swf coz I
thought it would take me to the main movie on frame "portfolio"

code:
Code:
back_btn.onRelease=function() {

_parent.gotoAndStop("Scene 2", "portfolio");

}
PLEASE HELP...!! Thanks

Controlling Main Timeline With Loaded Swf
I am loading an external swf into an empty mc on the main timeline. When the animation in the loaded swf finishes, I want to move to a different frame on the main timeline. Somehow I need to use the loaded swf to tell the main timeline to go to a new frame.

Putting a "gotoandPlay" and pointing at _root from the loaded swf doesn't seem to do the job. any ideas?

Can I Target The Main Timeline From A Loaded Movie?
So...I load a swf into the main timeline. How can I target the main movie when the loaded swf is finished? Is this possible...and if so how do I do it?

Thanks.

Playing The Main Timeline From An Loaded Movie.....?
Hi all, I have a simple question, In the main Scene in a frame I have a action:

Stop
Load Movie ("graficooo.swf", "porttarget2")

After, the movie open and play... but in the end I need to put a action that unload the movie
(Stop // Unload Movie ("../porttarget2")
and play the timeline of the scene..... What is the correctelly action ???

Thankx

Loffi

Controlling Main Timeline With A Loaded Movieclip [swf]
I have been racking my brains out on this one.

My main file is called "main.swf" and I am loading an SWF called "control.swf".

I need control.swf to tell main.swf to goto and play a certain frame when control reaches a frame marker called loaded.

I have tried level, _root, _parent and nothing...

HELP!!!

Thanks,

Trigger Main Timeline Actions From A Loaded Mc
hey Question for everyone

How can out target the level0 movie clip from a loaded clip?

For instance:

I want a movie clip to load into level5 but, if the loaded movie reaches frame 36 I want it to change a movie clip in the main timeline.
would I targe the clip using root or by the movie number.

I know the question isbn't very specific but I am just looking to know if it is possible, and if so, what is te generally acceptable way to do it.

signed,

The one without a life on Saturday... lol

Help Targeting Main Timeline From Loaded Movie
How do you target the main timeline from a movie loaded to level1?

I’ve tried things like the fallowing without success.

_root.gotoAndPlay(2)

_parent.gotoAndPlay(2)

_level0.gotoAndPlay(2)


please help,
S

Referencing Function In Main Timeline From Loaded .swf
Hi,

I have a movie where I'm loading a .swf using placeholderMC.loadMovie("somemovie.swf");

Once the movie is loaded, I tell it to play, and it plays.

However, I'm needing to know when this movie has finished playing.

I put some code in the last frame of "somemovie.swf" to call a function in the main timeline.

_root.someFunction();

But it won't work.

How do I call the main timeline from a loaded .swf.

Thanks,

The Alchemist

Linking To The Main Timeline From An External Loaded Swf
Hi everybody!

I have a projector that loads an external swf file. Here's my code:

loadMovieNum("057.swf",1);

The thing is that when the external file is loaded, I need to control a movie clip placed in the main timeline of the .exe projector.

Because the file is nested into the projector, I thought that I could link to it using _root, but it didn't worked:

_root.mymovieclip.gotoAndPlay(2);

Is it possible to do this?
Is it a path problem?
What am I doing wrong?

Thanks a lot!

How To Address The Main Timeline From The Loaded Movie?
Hi,

i got a movie loaded in my main timeline(_root) in the frame 20.
and i got a stop() action as well in the same frame. Am loading the movie at a level8. now, i want once the loaded movie is finished playing, i want the main timeline's playHead move to frame21.

so, what i did was, i written the code in last frame of the loading movie like this:


_root.gotoAndStop(21);
\this doesn't work.

__root.nextFrame();

\this too doesn't work.

can i use some sort of function, to sort my problem?

How To Address Main Timeline From The Loaded Movie?
Hi,

i got a movie loaded in my main timeline(_root) in the frame 20.
and i got a stop() action as well in the same frame. Am loading the movie at a level8. now, i want once the loaded movie is finished playing, i want the main timeline's playHead move to frame21.

so, what i did was, i written the code in last frame of the loading movie like this:


_root.gotoAndStop(21);
\this doesn't work.

__root.nextFrame();

\this too doesn't work.

can i use some sort of function, to sort my problem?

Control The Main Timeline From A Loaded SWF File In A MC
Hi

I've been beating myself up trying to figure this out. It should be simple.

I have a presentation file called 'Portfolio.'

Inside of 'Portfolio' I have a short introduction as the first scene. This introduction is an EXTERNAL swf that is loaded into a MC called 'introContainer' in the _root.

Here's the problem. When the 'Intro' finishes playing I want to go to the next scene in my 'Portfolio' that contains my actual portfolio.
i.e. intro(contains MC with loaded SWF)--->portfolio(contains the rest of my flash stuff)

QUESTION: How do I tell my _root movie that the external swf is finished so that it can go to the next scene? Do I do that on my Main Timeline or in the MC itself OR in the loaded swf?

This is done so that I can work on the intro file separate to the Main porfolio page for reasons of ease of update and smaller file size.

I could put a button to tell the user to go to the next scene, but I am trying to make it as simple as posible for the user.

Can anyone assist me?

thanks

-ian

Control Main Timeline From .swf Loaded Into Layer
How do I do this code??

I have an promo.swf that contains a promo_mc, that contains a button.
This.swf then loads onto level 2 of the main site's .swf

When the button is clicked in the promo.swf, I want it to control the main timeline so that it will gotoandPlay a frame.

Controlling Main Timeline Through Externally Loaded Swf
I'm missing something...here's the setup:

navbar.swf (a navigation window) loads into the main timeline, placed into a container called navguide. There are buttons in navbar.swf that I want to control the main timeline, moving it from section to section of the main site (button called "newsbutton" should move the playhead to a News section this time, which is placed on frame 5). The code I have in the main timeline so far is this (on frame 1, _root timeline):


Code:
stop();
loadMovie("scoreboard.swf", scoreboard);
loadMovie("navbar.swf", navguide);

navguide.newsbutton.onPress = function(){
_root.gotoAndStop(5);
}

No blatant typos, as far as I can find, because the effects on the newsbutton (loaded from navbar.swf) work fine. But when I click the newsbutton, nothing happens. What am I missing?

[f8] Problem With Movie Once Loaded Into Main Timeline
hello

i have a problem that i have been unable to solve foe weeks now and it's driving me mad.

I really hope someone here can help.

I have attached a php script and flash form.

The flash form and script work fine when the form is accessed directly.
See here (give it a go):
http://www.luciddreampictures.com/ld_contact.swf

But when is is brought into my main flash file it sends the email but the php returns the error message 'no email address supplied' (even though an email address has been supplied!) and the flash is sent to my 'resubmit' frame.

Try it out here:
http://www.luciddreampictures.com

click contact (i know the button need to be sorted).

Feel free to send test emails to see what's happening.

I know there are different ways scripts to use but i would like to get this one working.

Can anyone figure out why it doesnt work properly when nested in another movie?

i don't think it is a targeting issue as the emails are being sent and the error message is being received.

Thanks for your help.

Julian

Help: Accessing Main Timeline Var From SWF Loaded In A UILoader
Greetings enlightened ones

Here's my problem:
I have a main swf movie in which a var is defined on its main timeline. I have a UILoader on that main timeline which loads an other SWF.

Here' what I need to do: How can I let the loaded SWF in the UILoader access that variable on the main timeline of the main swf?

Please help

AS3 - Calling MyFunction() On Main Timeline From Loaded SWF ?
I am new to AS3, fairly experienced in AS2.

I am creating a website using AS 3.0, I load an external SWF into my main movie using the proper methods of loader and URLRequest, i can load the SWF perfectly and I can execute functions within the loaded SWF by using the following syntax:

MovieClip(loader.content.page1.myFunction() );

How do I communicate with functions located in the main timeline, from within my loaded swf?
I have attempted numerous syntax variations but usually get an error of undefined function or null object.

So to summarize, how do i call a function located in Main.swf from a swf loaded into a child clip of Main.swf ?

Thank you!?

Controlling Main Timeline From Loaded Movie
I have loaded an external movie onto the main movie in a movie clip called "mainholder" - In the main timeline on the main movie there is a "stop" command on frame 1. From the loaded movie, I want to control the main timeline and tell it to go to frame 2. Can someone tell me the actionscripting to do this, I have tried several commands and getting frustrated. ;-)

Thanks

Controlling Loaded Movies From Main Timeline
I'm using loadMovie to load SWF movies into levels and movie clip "markers".

How can I control the loaded movie from a button on the timeline?

For example, when my users click a main timeline button, I'd like the loaded movie to jump to a frame, fade out, and unload itself...

Thanks!

How To Reed Variables On Main Timeline From Mc Loaded From Lib By As3
"tble" button load mc "tableinfmc" from library
tble.addEventListener(MouseEvent.CLICK,tble_click)
function tble_click(event:MouseEvent):void{
var tblinf:MovieClip=new tableinfmc()
addChild(tblinf)
}
but the mc instance cant reed any variables on the main time line

Help: Accessing Main Timeline Var From SWF Loaded In A UILoader
Greetings enlightened ones

Here's my problem:
I have a main swf movie in which a var is defined on its main timeline. I have a UILoader on that main timeline which loads an other SWF.

Here' what I need to do: How can I let the loaded SWF in the UILoader access that variable on the main timeline of the main swf?

Please help

Copyright © 2005-08 www.BigResource.com, All rights reserved