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




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



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 07-15-2008, 07:01 PM


View Complete Forum Thread with Replies

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

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

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-

[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 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 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

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 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 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 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 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

Volume Sliders Controlling External SWFs. [includes FLA]
Okay, I'm working in Flash MX and want to control the volume/panning of an externally loaded SWF with the sliders I've built. Just download the FLA below and then publish preview it (be sure to preview in HTML)...then play one of the clips, it'll automatically retrieve the SWF from my webspace. My problem is, I don't know the proper script/target to put on those volume/panning sliders in order to make them control the sounds (which are loading into Level 1, incidentally).

http://www.souldivine.net/version2/soundproblem.fla

If you could take the time to pop this file open, it'd probably be an easy problem to fix, but I just can't seem to get the right script. I'd definitely owe you one if you can help me with this. Thanks a bunch...

Controlling Parent Movie Clips From External Swfs
How is the question when I publish my external swfs obviously I cannot access functions or variables that dont exsist as there is not referance,

so once I load something into a container how to I control the parent and access its functions?

senario = an index - loadeds external content with a sub navigation into a container, I from the externally loaded swf I click something and then something else loads into that container replacing what was initially there.

in as2 this was all very easy but im struggling in as3 can anyone help

Transitions Between External SWFs - Looks Crap As The Size Of External SWFs Grow
http://www.kirupa.com/developer/mx2004/transitions.htm

regarding this tutorial I started my site (http://technoportsolutions.com/technoflash/) to get some trasition effects but im getting somewhat different since the external SWFs take time to load. isn't it better to create "intro and outro" on the same time line instead of loading external SWFs bcos once the movie loaded as a whole will lead to smooth and contineous transitions. If anyone ever did something better or how can I use some transition effects (like intro and outro) without using external SWFs ? is my current problem.

Transitions Between External SWFs - Close Button For External Swfs
I recently created a site using the "Transitions between External SWFs" tutorial for Flash MX 2004. I use this to load the sections of my site into the main movie file. Each section is an External SWF file. When a viewer clicks on a navigation button, the specific external swf move will load and play. Currently, a viewer would need to click on another navigation option to close the current external swf file. I would like to add a close button to each of the external swfs so that a view has the option to close the window without clicking on a naviagtion link. Anyone have any suggestions? I am fairly new to actionscript and not quite sure how to accomplish this.

Thanks in advance for you help!
-RhynoDesign

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!!

Loading External Swfs Into Externally Loaded Swfs.
ive got some buttons on my main timeline that im using to load external swfs into an empty mc. the buttons are coded with the following:

on(release){
if(_root.currMovie == undefined){
_root.currMovie = "1";
emptyMC1.loadMovie("1.swf);
} else if (_root.currMovie != "1") {
if (emptyMC1._currentframe >=
emptyMC1.midframe) {
_root.currMovie = "1";
emptyMC1.play();
}
}
}


1.swf also has some buttons that load external swfs into a second empty mc. those buttons are coded with the following:

on(release){
if(this.currMovie == undefined){
this.currMovie = "2";
emptyMC2.loadMovie("2.swf");
} else if (this.currMovie != "2") {
if (emptyMC2._currentframe >=
emptyMC2.midframe) {
this.currMovie = "2";
emptyMC2.play();
}
}
}


1.swf loads into emptyMC1 ok, and 2.swf loads into emptyMC2 ok.

when i press any of the buttons on the main timeline, the outro animation of 1.swf plays correctly, but the outro animation of 2.swf does not. is there a way to the buttons so that the emptyMC's unload sequentially?

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 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.

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.

?

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 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.

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 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?

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 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?

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