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




Controlling Swfs With Other Swfs



I am trying to make one main SWF movie that calls on other individual SWF movies (one being a "menu" movie). The catch is that I want the main movie to tell the menu movie where it is and have the menu movie button that corresponds to that section of the main movie to show the button in an "over" state.



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-29-2004, 03:33 PM


View Complete Forum Thread with Replies

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

Controlling Loaded Swfs, From Other Swfs....
alright on my site, i have a loaded movie clip with sound, which is the main bg music, and i have a samples page, and i want each sample to load up on press or whatever. now i need to know how to not just unload the mian bg music swf, but make that swf go to and stop on frame 3 (1 is loader, 2 is play, and 3 is stop) thanks alot!!

SWFs Controlling Other SWFs?
I am working on a pretty simple menu and have come across a layout issue. As is, I have the buttons display an icon in a "fire circle" at the top of the menu bar when rolled over. It would be great though if I could have 2 SWFs: One which contained all the buttons and another with that "fire circle" (see link). Buttons.swf would of course have to tell FireCircle.swf to "on rollover goto frame x in scene x". Is this possible? So I guess my question is can you have one swf file control another?

Here is an example of the menu bar, as one swf, if you need to visualize it: http://www.blownheadlight.com/menu.swf

Thanks.

Controlling SWFs
My Question:

I have a SWF file (called: home.swf) which contains 3 buttons (button 1, button 2, & button 3).

When you click on button 1, I want home.swf to goto frame 15 and stop. At the same time when clicking on button 1, I want a new SWF (portfolio.swf) to load on top of home.swf.

The above is pretty simple and I have no problem doing that, but here comes the problem..

When you push a button (lets call it exit) in portfolio.swf, I want it (portfolio.swf) to send a message which tells home.swf to go and play frame 5 (remember it was parked at frame 15),(and then portfolio.swf will unload it self).

I am not (yet) very good at variables and how to send and recieve these between SWFs, so please be specific.

Thank you, and I really appreciate the help..

Controlling Different Swfs?
hi

On the main time line i've got a stop and a loadMovie to load a .swf.
Is it possible to let the main timeline carry on, once the loaded .swf is done?

cheers

Controlling Other SWFs
I am working on a flash navigation "shell". I am loading external SWFs onto the stage using the Loader class and AddChild. I have to problem getting the SWF on the stage but I can't control playback. It loads playing and nothing I do stops or pauses it.

I have code on my "menu" button to removeChild. the movie goes away, but the audio continues to play.
Can someone tell me where I'm going wrong?








Attach Code

var myRequest:URLRequest = new URLRequest("myMovie.swf");
var capLoader:Loader = new Loader();
myLoader.load(myRequest);
myMovie_mc.addChild(myLoader);

myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, playMov);
pause_btn.addEventListener(MouseEvent.CLICK, pauseMov);
pause_btn.visible = true;

function playMov(event:Event):void
{
event.target.content.y = 0;
event.target.content.x = 0;//(stage.width/2)-(event.target.content.width/2);
//event.target.play(0);
}

function pauseMov(event:MouseEvent):void
{
//resumeTime = event.target.currentFrame;

myMovie_mc.stop();
resume_btn.visible = true;
resume_btn.addEventListener(MouseEvent.CLICK, resumeMov);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseMov);
}

function resumeMov(event:MouseEvent):void
{
//soundControl = sound.play(resumeTime);

myMovie_mc.play();
pause_btn.visible = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseMov);
resume_btn.visible = false;
resume_btn.removeEventListener(MouseEvent.CLICK, resumeMov);
}

Controlling Other MC's In Ext. Swfs
Hi, I have a question that will take two seconds to answer, but I can't figure it out!

So here goes, I have a main.swf that loads in..... home.swf, ab0ut.swf, contact.swf, etc via a standard loader setup. If I would like to control a MC with an instance of "homeVid" in my home.swf how would I target that from my main.swf? I'm so confused, please help. All I need is pointers, I'll figure the rest out myself. Thank you so much for you help.

Controlling Loaded SWFs
Is it possible to control SWFs that you have loaded into your main movie? Like tell it to change frames for example?

Controlling Imported Swfs
i can not seem to find a way to control an swf (whatever.swf) that i imported into a movie clip (container clip)using "loadmovie" :

loadMovie ("whatever.swf", "containerClip");

is there a way to add an instance name to an imported swf? i want to have some navigation tell the swf to stop, play or go to a label, i just can't find a way to identify the movie once i load it.

hopefully someone out there has an answer.

thanks.

Controlling Loaded SWFs
Can anyone help?

I'm new to actionscripting.

I am loading several SWFs into a target successively, each one calling the next. Call them MC1-MC4. Each has several scenes.

Here is my challenge:

I need to program a Rewind, Stop, Play, and Foward button on the host movie that control whatever movie is currently loaded in the target.

NOTE: The Rewind and Foward button only need to take the user to the begining of the previous/next scene.

Like I said I'm very new to ActionScripting. Does anyone have an example script I can look at? Can this be done simply?

Thanks!

Controlling Swfs With Buttons
Hi,
My main movie is called site.swf and it contains 5 buttons, each of which loads a separate swf when released.
Each swf is loaded into the root timeline using the loadMovie command and loads into an empty MC in site.swf. So far so good.
All is well and each swf loads in to site.swf as a nice expanding window.

The problem I'm having is the transition between each swf. Currently, when a given button is pressed, the swf it triggers appears ok, but when I then click another button, the previous swf instantly disappears and the new one fades in.

What I want to achieve is an even transition between one loaded swf and another, but I can't seem to see how to achieve this.

For a visual understanding of what I'm talking about, have a look at
http://www.formiscontent.co.uk enter the site, and if you wait a few moments the relevant buttons will fade in...

Hope someone knows what I'm on about and can help!
Thanks in advance

Controlling Swfs From Different Frames
does any one know if and how u can control a swf in a different frame from a swf in another frame.

?

Controlling External Swfs
Hi all:

I have an external swf loaded into a movie using the LoadMovie function. When the external swf finishes playing, I need to direct my main movie to go to a specific frame in the scene.

Any help would be appreciated.

Thanks

Controlling External .SWFs
hey guys..

if I have

_root.content.loadMovie("services.swf");

and inside services i have a movie clip called mc_split that does something at keyframe 20 how would i go about writing this in actionscript to make mc_split go to the frame from my main movie where i make the call to load the services.swf

i cant think if a single way to do it.. lol

any help would be greatly appreciated

thanks in advance

Help With Controlling Loaded Swfs
Hey guys,

I'm making a site in mx, and I have got it set up so it loads and external swf when you click on each section. I have an animation coming into each section and going out aswell. I have each swf with a stop at about frame 10, where the page stays for viewing. I want it so that when you are viewing a section, lets say the "about me" section, and you click on say "links", it will play the rest of the about me.swf, when it gets to the end, load links.swf in its place.

Controlling Loaded Swfs
I have a main clip, and inside of it I'm loading movies externally (into an empty clip called "host".)

I have frames labeled "01", "02" and "03". After I've loaded externalMovieA into the host clip in frame "01", I want externalMovieA to play to its end. When externalMovieA is ended, I want the main clip's root timeline to go to lable "02" and load externalMovieB.

I can't seem to control an externally loaded clips.

Any help? I'll include the main FLA.

Thanks.

Controlling External .swfs
Hi there,
I have a bit of a problem with a flash webzine that I'm building. In it I have a flash movieclip. This movieclip is contained in an external swf and the movieclip plays using loadMovieNum. However I am having trouble controlling the movieclip. I want to be able to stop, fast forward and rewind. I have tried heaps of different things and nothing seems to work. I know I could use unloadMovieNum but I don't want to get rid of it. I just want to be able to control it.
Any ideas?

Controlling External Swfs
I have a web page with a flash nav menu bar and a flash header. when you click on the contact us button in the nav bar I would like the header to gotoAndPlay ("Contact") which is the contact us header. the problem is i dont know how to do this. The page is html using tables not frames
Please Help.

Brandin

My passion as a designer is not to impress the world, but to give my clients the confindence to present my work to the world.
-Me-

Controlling External SWFs
Hello,

I am having some issues working with external SWF. When the external SWF is finished playing, I want it to remove it from the stage and play the next one, similar to a slide show, but the time the slide is on screen is determined by the length of the SWF.

I have absolutely no idea how to set it up to a.) unload the external SWF or b.) How I would go about loading the next SWF.

Here is my code:


ActionScript Code:
var request:URLRequest = new URLRequest("content.swf"); 
var loader:Loader = new Loader(); 
   
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress); 
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completed)

function loadProgress(event:ProgressEvent):void { 
    var percentLoaded:Number = event.bytesLoaded/event.bytesTotal; 
    percentLoaded = Math.round(percentLoaded * 100); 


function completed(event:Event):void{
    trace("I AM COMPLETE");
}
   

loader.load(request); 
addChild(loader);

Any help would be greatly appreciated.

Thanks!

dougt

Controlling Loaded Swfs
Hi,

Complete noobie here and just getting to grips with AS 3.0 so apologise if this is a dumb question.. Anyway, trying to load and then control an external swf with this code:

var myrequest:URLRequest = new URLRequest("Left.swf");
var myloader:Loader = new Loader();

myloader.load(myrequest);

//check loads completed
function swfLoaded(e:Event):void{
stage.addChild(myloader);
var mycontent:MovieClip = e.target.content;
trace(mycontent);
mycontent.x = 100;
mycontent.y = 100;
mycontent.gotoAndStop(10);

}

//add event to loader class
myloader.contentLoaderInfo.addEventListener(Event. COMPLETE, swfLoaded);

evrything works - x and y of movieclip get set but problem is that the movie doesn't stop at frame 10 - it just keeps playing through?!

Anyone any idea why this could be so??

Controlling Loaded Swfs
Hi All,

I tried yesterday to sort this out, but didn't explain it very well and I think everyone lost interest. So I'll try once more.

What I'm trying to do is create buttons in one swf that load another swf and also give instructions to begin playing from a certain frame in that swf. The target swf has a preloader on frame 1 and then a movie clip that contains a video in frame 2. Depending on which button the user presses the video will be cued up ready to play at different frames.

I think it may need an if statement ie if x=34 then goto frame 34, but I can't seem to pass the variables to the loaded swf.

In the zip file is an example of what I'm trying to do. I would really appreciate any help on this.

Controlling Loaded Swfs
Hi All,

I tried yesterday to sort this out, but didn't explain it very well and I think everyone lost interest. So I'll try once more.

What I'm trying to do is create buttons in one swf that load another swf and also give instructions to begin playing from a certain frame in that swf. The target swf has a preloader on frame 1 and then a movie clip that contains a video in frame 2. Depending on which button the user presses the video will be cued up ready to play at different frames.

I think it may need an if statement ie if x=34 then goto frame 34, but I can't seem to pass the variables to the loaded swf.

In the zip file is an example of what I'm trying to do. I would really appreciate any help on this.

[AS] Controlling External .SWFs
hey guys..

if I have

_root.content.loadMovie("services.swf");

and inside services i have a movie clip called mc_split that does something at keyframe 20 how would i go about writing this in actionscript to make mc_split go to the frame from my main movie where i make the call to load the services.swf

i cant think if a single way to do it.. lol

any help would be greatly appreciated

thanks in advance

Controlling 2 Individual SWFs In 1 HTML
Is there a NON-JAVA way to communicate between 2 seperate SWFs, both of which are loaded on 1 HTML page?

The intent here is to use one (Flash menu) to selectively load pages into the OTHER movie (which contains an empty clip).

What is the syntax for loading an EXTERNAL SWF into another targeted EXTERNAL SWF? (as opposed to an internal movie clip)

Augh......

Brian

Controlling Multiple SWFs In A Parent?
Is it possible for me to break up my movie into 3 different sections and manipulate them in a main movie...so like can I have 3 different SWF clips load into one movie and I will be able to manipulate their timeline via the main one?

Controlling Swfs Loaded Into An Empty Mc
Can anyone help me out with a script that i can put in a single key frame of my index.swf that can pause / play the swfs that are loaded into an empty mc <eg. movies_mc>.

Thanks.

Variable Loading/controlling Ext Swfs...
Okay, what I'm trying to accomplish is to load and control external swfs in my main swf. Here's what I've done.

Frame 1 Action (declare 2 variables) var paper = "null"; var binaries = "null";
Frame 2 Action (stop the movie) stop()
Layer 1/Frame 2: Two buttons (changes the variables)
Button 1 Action
code: on (release) {
_root.paper = "on";
_root.binaries = "off";
}

Controlling Playback Timing Of 3 Different Swfs? How?
I have a single html page that has three different swf files,
in three different table cells.

Is there a way to stably control the playback timing of the
three and keep them in sync, without making them one big
(big resolution-wise, not file size) swf?

They are basically all three small banner ads that transition
from one image to the next, but I want them to transition in
order and stayed synced up. Top banner goes, then a second
or so later right banner goes, then a second or so later, the
bottom banner goes, then repeat...

It needs to work on all the current browsers and also on both
the PC and Mac platforms...

Thanks in advance.

HTML Frames And Controlling SWFs
I have an HTML document that is basicly a 4 frame set. In one frame set I have a basic Play,Pause,Forward,Backward type interface that is an SWF. I need for the media interface SWF to control an SWF in another HTML frame. Does anybody know how I would go about doing this?

Basicly I'm trying to conroll a video in one HTML frame by using and SWF in another HTML frame.

Controlling External Sound SWFs
I've got a site in which I'm calling external swfs to load into the main movie as new movies into the next layer. In other words :: main movie=layer 1 & sound swf = layer 2. When I load a new movie, I need for the external sound swf to fade out. I've looked on Flashkit for a tutorial, but the search engine's not working right for me.

How do i make the external sound SWF fade out with a button in my main movie??

Any advise would be MUCH appreciated!!!

Thanks - Gary

Controlling Externally Loaded Swfs
Hello-

I am using AS 2.0 and MX 2004. I have a movie that loads in external swfs and images using the MovieClipLoader to load the element in to a clip called "container".

Now I've been testing within flash with test movie and it works great. as soon as I export my commands that toggle within different frames of the external swf fail.

what I have is:

container.gotoAndStop(frameLabel);

is there an obvious reason why this would stop working on export? or things I could try to figure this out.

I tried loading on to levels instead so I would have:

_level25.gotoAndStop(frameLabel);

and I still have the problem.

I am exporting as Flash 8 and testing in Flash Player 8.

ideas?

Controlling The Placment Of External Swfs
I'm having trouble controlling the placement of swf files when I load them externally. When they load, they end up in the upper left corner. I'm not sure if I'm being clear, but is there a way to control where they end up?

Controlling External SWFs' Variables Via XML
'Ello, world. I'm a long time Flash designer but am pretty new to the programming side of things. I'm starting to get the hang of things thanks to my job.

That is, until this problem comes along.

The situation: Our software has a lot of Flash involved with it. Menus, layout, etc. Many, many text feilds for $$ values and labels will be controlled via XML. My job is to set that all up...

So I have the master SWF file which just has the background image in it. At least 3 external SWFs, independant of each other, need to be loaded, and I -think- I have that part down. But of course, all the dynamic text areas of each of these loaded SWFs need to be controlled from the MAIN file. My dumb luck seems to have run out here.

After browsing here for a while I learned that external SWFs won't take any input until they have had a chance to load. So I have a few questions..

1) How would I go about "giving each external file time to load" while keeping all of them independant of each other? They could be loaded at any time, in any order, depending on when the user needs each one. Naturally once they are loaded, if the user wants to hide one I would just use the _visible = false gag.

2) What is the correct way to point at and manipulate a dynamic text feild buried inside an external SWF? Is it even possible?
My first thought was something like this (in this made-up example, defining what one of the labels on an image object reads as)


Code:
MC_with_loaded_SWF.object1_mc.label="INSURANCE"

Controlling External SWFs Using A Telltarget?
Anyone know how to directly control an external swf using a telltarget? I've got a button in the main swf that onRelease I want to tell to level1 movie to gotoAndPlay, just don't remember what path to asign. Thanks for any help.

: blake

Minimize Window And Controlling Swfs
I have a site that appears in a standard browser window. When you click a button it calls a javascript function that launches a popup window.

The new popup window has an flv playing as soon as it loads, but because the main site also has an flv playing the popup plays out of sync.

I would like to pause the flv playing in the main window, but then unpause it as soon as the main window regains focus. Is this even possible? Can I test focus after a window has already loaded? Do I need to call a function from the popup if it is closed?

Any ideas?

Thanks,
Ward

Controlling External Swfs Loaded Into An MC
Hi, quick question.
what actionscript could i use to make an movies loaded into a movieclip play. tried _root.holderMC.play(); holderMC being the movieclip the external swf is loaded into, doesn't seem to work! searched the internet too but no lucky, so any suggestions would be awesome.

Thanks alot
TOM

Controlling Sound(s) Within External SWFS
so i have a bunch of extrernal swfs that have background music playing in them.

i was wondering is there a way to control the sound (turning it on and off, basically) when loading between the swfs.

for instance, i turn the sound off on one swf, and then i load up another.
will the sound start up again?

Controlling External Swfs Loaded Into An MC
Hi, quick question.
what actionscript could i use to make an movies loaded into a movieclip play. tried _root.holderMC.play(); holderMC being the movieclip the external swf is loaded into, doesn't seem to work! searched the internet too but no lucky, so any suggestions would be awesome.

Thanks alot
TOM

Controlling Sound(s) Within External SWFS
so i have a bunch of extrernal swfs that have background music playing in them.

i was wondering is there a way to control the sound (turning it on and off, basically) when loading between the swfs.

for instance, i turn the sound off on one swf, and then i load up another.
will the sound start up again?

Controlling Loaded Swfs From Main Swf?
If I'm loading a swf into a movieclip with loadMovie, is it possible to control the loaded swf from outside it? In other words can I create actions in the main swf (or a movieclip within it) that can control the timeline of the swf that I'm loading into it?

Controlling Swfs In Separate Frames
anybody know how to control separate flash movies in different frames? found one source at : http://www.ashzfall.com/flash/fscomlib/frameplay.html
however it doens't work in netscrape (then again, what does?). thanx in advance!

Controlling Three Loaded Swfs With One Keypress
G'day

I hope someone has an idea.

I have a function that controlls zooming and pan of the stage using keys (space bar, backspace and arrow keys). It works fine. I made a swf with some objects on the stage.

I load the swf with the zoom into a base movie thats ok, works fine.

I thought that I could get a better 3d effect with the zooming if I had three of these zooming swfs loaded on top of each other with different objects on them, at different scales, zooming at different rates (the top one faster the next one slower etc.).

The problem is that once all three swfs have loaded, the keypresses only respond to the first swf that flash loads the others are static.

Is there a way around this problem?

Any help would be greatly appreciated.
easy

Controlling MCs Inside Externally Loaded SWFs
I am loading a SWF file on layer1 of my project, and I'm attempting to position it from my _level0 "root" timeline with:

_level1.pledge._x = 256;
_level1.pledge._y = 144;

Alas, I can't make it work. The only MC inside the loaded SWF file has the instance name "pledge", so I figure this should work. What am I doing wrong?

Controlling Loaded Swfs With Action Scrip?
Ok, so I have a master Swf that loads a top menu swf and an animated background swf. On the menu I have a navigation button that once clicked SHOULD play the background.swf and once it is finished, Load another swf on top of it. I am tottaly stumped on how to do this.

this is what the button looks like so far


MM_news.onRelease = function () {
reActivateBtns();
changeOptionColor(this, overColor);
this.enabled = false;
_level2.gotoAndPlay(1);
if (backMorph._currentframe(42)) {
myMCL.loadClip("news.swf", 5);
}
};

Controlling Embedded Captivate SWFs In Flash
Hi:

I have a SWF (SWF A) that I'm loading into a movieclip (Movieclip C)which is part of another SWF (SWF B). Basically, SWF B functions as a player, with play and pause controls. These controls control Movieclip C where the external SWF A is loaded into.

Normally, I have had no problem with this and it always works. At run time, when you click the pause button on SWF B, a stop() command is issued to Movieclip C, which stops the play of the external movieclip (SWF A) loaded into it.

However, I did a screen capture with Captivate and published it as a SWF. I loaded this SWF (SWF A) into Movieclip C in SWF B at run time. However, clicking the controls on SWF I created has NO EFFECT on the SWF I created in Captivate. It just keeps playing.

I guess all SWFs are NOT created equal. How can I make this work?

By the way, I do not want to use the embedded controls that come with Captivate.



Loren
“The only real mistake is the one from which we learn nothing." - John Powell

Controlling A Movieclip That Loads External Swfs...
I have a button that stops a movie clip, the only thing is when I load an external SWF and use that movieclip as the container, it stops working.

I gave the movieclip an instance name "trans" and when i use
[as]
trans.loadMovie("trans.swf")
[as]

To load an external SWF called trans the following AS

[as]
on (release) {
_root.trans.stop()
}
[as]

stops working... ANy suggestions

Mike

Controlling Non-streamed Sound Within SWFs From HTML
Hi

Sorry to repeat this plea from the ActionScript forum, but I wasn't sure which forum this question belonged to!

I have a bunch of SWFs. Each plays an MP3. The MP3 sounds are not streamed, they appear as events on the first frame.

I want to be able to control the playback of these SWFs directly from HTML.

I.e., I need to be able to pause, rewind to start, and play.

I have managed to make this work using the standard DreamWeaver behaviours when the sound is streamed within the SWF - see: http://www.harlequinsolutions.com/sandpit/count.htm

However, if the sound file is imported into the movie and played on the first frame as an event, the controls don't allow pause and resume to work properly. It pauses and resumes the playback of the images etc, but the sound has already started, so can't be stopped, and more importantly, can't be resumed from half-way through.

I'm sure this is somthing that has been answered many times before....but I'm fairly new around here and the search results haven't shown much up.

Any help very much appreciated.

Cheers

John

Controlling The Order Of Loading External Swfs
Hi All,

I have searched the site with no luck for finding out about this. It could be that using loops is the only way to do what we want, however ever the optimist I'll ask the question anyways.

Is it possible without looping to control which of 12 or so external swfs loads first when they all have to load on the same frame of the main movie?

For example, we have a main movie which creates classes where the class is itself in an external movie. When we load locally, the movies all load fast enough that the classes are created correctly, however when we move to loading from the server some of the class movies are not loaded into their levels before the main movie tries to create the class with of course the result being the class is not generated and the movies do not function correctly.

Any help would be greatly appreciated.

Liz

Controlling Swfs: Play And Stop On Command?
Does anyone know how to control a swf within a movie e.g. an animation with Play and Stop buttons?

Cheers,

Yossi

Controlling And Preloading Seperate SWFs On A Website
Ok... here is what I have got...

My Website opens, its written in HTML... There is a "Navigation" FLash at the top of the page which opens up HTML documents into the "Main Frame" below.

Ok now... When the Website first loads up, In the Main frame of the page I want a flash swf to play as an intro to the website (Its a band website). Once the (intro) Swf ends I want it to tell the Navigation Flash Menu Swf to go ahead and show the buttons so people can navigate.

Thats my first problem, or task to solve.

2nd... If it is possible to control Swf's from an external one it must be possible to preload them aswell right? So what I want to do, is the site to load up... and all the preloading done from the Navigation Swf to account for both Swfs (Intro and Navigation)

Makes sense? Hope you can help...

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