ActionScript 3.0 :: Loading 2 Ext Swfs Into Master File Need To AddChild In Order

Mar 28, 2010

loading 2 external swfs into one main file using 1 preloader, I have figured out how to get the preloader to handle the correct # of bytes loaded and such but my 1st swf I want to load onto the stage is a video file and I want it as the background but I don't want it to start until after they are both (the video and main file - 2 external swfs) loaded and then I want to start the video and place it on the stage first, then place the main swf on the stage.

I can get the order right if I place them into my load complete function but then my buttons don't work on the main file.
 
Here is the code:
 
var bytesLoadedVidBG:Number = new Number();var bytesTotalVidBG:Number = new Number();var loader0:Loader = new Loader(); // load video BGvar loadedSWF0:Object;loader0.load(new

[Code]......

View 3 Replies


Similar Posts:


Changing Order When Loading Images In As AddChild On Stage?

Jul 30, 2010

I have a movie on stage that acts as a button using the code. person_mc.buttonMode = true;

I load an image onto the stage from my library using addChild(holiday);

What happens is that the person_mc button I have on stage will not function anymore, because I am presuming it is underneath the holiday pic when I loaded it using addChild.

How do I load the holiday pic, so that it is underneath the person_mc?

I know I could do what I did with holiday using addChild for the person_mc, but I do not want to do it that way.

View 3 Replies

ActionScript 2.0 :: Loading 5 Different SWFs In Order Then Display In Loop?

Aug 13, 2010

Currently I am trying to load 5 different swfs in order. Everytime a button is selected I want to move to the next swf. And once I reach 5 the next image should be 1 (again - loop). I started with a code like this on frame 1 in "scene 1":

Code:
gotoAndPlay(50);
Stage.align = "T";
Stage.scaleMode = "noScale";
_root.j = 1;
where "_root.j = 1" ----- "1" is the first swf loaded. But it was stuck on 1.

My newbie skills figured this out so to avoid zero, but it's random. And things repeat too closely.
Code:
gotoAndPlay(50);
Stage.align = "T";
Stage.scaleMode = "noScale";
_root.j = random(4)+1;

My Question: What can "_root.j" equal so that 1,2,3,4,5 cycles? I have to work within these parameters cause this template is deep.

View 1 Replies

ActionScript 2.0 :: Controlling Order Of Loading External SWFs

Mar 22, 2004

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.

View 2 Replies

ActionScript 2.0 :: Controlling The Order Of Loading External Swfs?

Mar 22, 2004

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.

View 2 Replies

ActionScript 3.0 :: Load External SWFs, AddChild(Loader) Versus AddChild(Loader.content), Etc?

Jul 29, 2009

I have a main "shell" swf which, by clicking several buttons, will load/unload various external swfs into a Placeholder_mc which resides on the main timeline in Shell.swf In the documentation and tutorials I've seen a couple different methods, and I'm not sure I quite understand the difference, or at least the reason you would use one over the other...In the 1st method, you can just add the Loader object using the addChild() method:

Code:

var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);
Placeholder_mc.addChild(myLoader);

This will apparently add myLoader to the display list once it has completely loaded.The 2nd method, you supposedly can add the Loader.content; however, it appears you can only do this once the content has completed loading, so you need to incorporate an event handler with the contentLoaderInfo object:

Code:

var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);

[code]....

What are the pros/cons of adding the entire Loader object, as opposed to the Loader.content and vice versa?

View 7 Replies

Professional :: Loading File Order Reverse?

Sep 14, 2010

I try to load 4 pictures. Loading is fine but the order is reverse.This is the code:
 
function showThumbnail(id:String, xmllist:XMLList):void{
var pics:XMLList = xmllist.(@name == id).*;
for each(var i:XML in pics.pic){
var loader:Loader = new Loader();

[code]....
 
The "I" is the picture index. I think the order should be 1.png 2.png 3.png 4.png just like the order of  the xml ~~This is the output:
 
I:1 mc.x:11 mc.y:27 file:///D|/works/Flash/thumbnails/4.png I:2 mc.x:11 mc.y:210 file:///D|/works/Flash/thumbnails/3.png I:3 mc.x:11 mc.y:393 file:///D|/works/Flash/thumbnails/2.png I:4 mc.x:11 mc.y:576 file:///D|/works/Flash/thumbnails/1.png

View 4 Replies

Flash :: Loading Swf File Within Another Swf In Order To Use It's Functions?

Dec 8, 2009

i would like to load a flash file in order to use it's functions and classes. i would like that this file will be never cached. how can i do that ?

View 1 Replies

Actionscript 3.0 :: Make A Master File That Conforms With .as File

Jul 30, 2009

I am trying to combine 2 swf files into a "master swf." One of the swf files is a timeline animation of graphics and text, not much coding. The other is all interactive coding, written on a seperate .as file with a complex Class structure.My first attempts to combine the swf files by simply adding from the Library to the stage at particular frames was a failure and I got all sorts of error codes and broken animations. Would it make any difference to add the swf files dynamically? I guess my question is how to make a master file that conforms with my .as file and will handle the animated section. On a related note, I need code that reads for the last frame of "SWF1" and triggers the "MAIN" timeline to go to the next frame (where the "interactive" swf is waiting to do it's stuff). Oh yeah and at some point, I'll need to prepare a preloader for the whole deal.

View 3 Replies

ActionScript 3.0 :: Loading Test SWF Into Master - Error 1120

Jan 15, 2010

I have a problem with Loader. I want to load a swf(test) into the main swf(master). On main swf I have two buttons: one load the test.swf and the other unload the test.swf. But if I write the unload command in the unload function I have the following error:
1120: Access of undefined property myloader.

My code:
var swf_active=false; // I need this variable
bt_load_swf.addEventListener(MouseEvent.MOUSE_DOWN, load_swf);
bt_unload_swf.addEventListener(MouseEvent.MOUSE_DOWN, unload_swf);
function load_swf(e:MouseEvent):void {
//add the swf
[Code] .....

View 2 Replies

ActionScript 3.0 :: Loading Some Very Poorly Built Swfs Into A File?

May 6, 2010

So I am loading some very poorly built AS2 swfs into an AS3 file.I am able to open them and close them (addChild and removeChild)The problem I am now faced with is each of these AS2 swfs contain video using the AS2 FLVPlayback component. When I open the first SWF, the video plays fine, I close the SWF(removeChild). Then I go to open the next and the video will not play.

If I reload the page and open that second video first, it works.It seems when I watch a video for the first time no matter which AS2 swf I pick, it works. Its when I close it and open another one is when it doesn't work..

View 1 Replies

ActionScript 3 :: Layer Order - AddChild MovieClip To Correct Sprite

Oct 23, 2011

I created two empty Sprites to serve as layers, bottom_spr and top_spr. When clicking a button, a MovieClip appears and follows your mouse, until you click, then its position is fixed. As soon as the button is clicked, I addChild the MovieClip to the correct Sprite. Unfortunately, the layer system doesn't see to work, because they are layered in the order I place them, the Sprites don't seem to influence it. How is this possible?

private var ground_spr:Sprite;
private var units_spr:Sprite;
public function Game() {
addEventListeners();
ground_spr = new Sprite();
[Code] .....

View 1 Replies

ActionScript 3.0 :: Need To RemoveChild() And AddChild() In Order To Force Image Update?

Sep 1, 2011

Here's some code I created as an answer to another question. It pulls a library item out of the library and puts it on stage programmatically. No big deal, except that in order to get the image displayed on the screen to actually update, I had to removeChild() and then addChild() it back. Is there another way to force the screen to redraw?

[Code]....

Note that in this example, this code is on frame 1 of the timeline. It _feels_ like imageClip is not a direct reference to the thing that's actually on the display list. However, when I modified my code to replace the reference to the AS variable imageClip with a more direct reference to the element on the stage (imageClip = getChildAt(1)), that made no difference either.

View 5 Replies

ActionScript 2.0 :: Load External Swf Files(9) Into Master.swf File

Aug 14, 2009

I can't figure out how to load external swf files(9) into my master.swf file one after the other. This is the Actionscript i have written so far.....(AS2)

var myItems:Array = new Array("swf01.swf", "swf02.swf", "swf03.swf", "swf04.swf", "swf05.swf", "swf06.swf", "swf07.swf", "swf08.swf", "swf09.swf");
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myMCL.loadClip("myItems[0]", this.getNextHighestDepth());

The first swf loads alright into my master swf but i can't for the life of me work out how to load the rest after each one has finished loading. Don't know if i need a for loop or what?

View 2 Replies

ActionScript 3.0 :: Flash Master Policy File In Subdirectory?

Nov 9, 2010

Anyone know if it is possible to keep a MASTER crossdomain policy file in a subdirectory of the domain?url...I know you can do it with a meta policy file, but I want to do it with the MASTER because without a master the meta's are ignored.I've googled this for hours and read through the official spec several times and come up with nothing. With the server I want to do this on its possible to deploy in any subdirectory except the domain root - thats just the constraints I'm under.

View 6 Replies

ActionScript 2.0 :: Get Text To Load From Master SWF File (_level0) Into An Instance?

Jan 5, 2009

I'm trying to get text to load from my master SWF file (_level0) into an instance on level 5. In the master file all I have is one key frame and this actionscript written into it.

ActionScript Code:
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip("preloader.swf", 5);
_level5.textField1.text = "testText Field";

In the second swf (preloader.swf) all i have is on keyframe and an instance namedtextField1.Is there any reason why I shouldn't be able to load the text "testText Field" into it?

View 1 Replies

ActionScript 3.0 :: Playing SWFs In Sequential Order

Sep 11, 2009

I'm doing a flash movie in as3 where there are two or three swfs. What I want to do is play them in a sequential order, wherein when one finishes, the second one starts. The swfs are called movie1, movie2, etc. The best way is probably to use an array and load swfs into the 'overall' fla file that will play them. I use a variable called movieNum that keeps track of each movie. I am also using a Loader command which is just called loader. My loadSWF function works fine, but my eFrame function is flawed. I cannot find a way to recognize the end of the last frame of movie1.

var request:URLRequest;
var loader:Loader;
var myMovies:Array = ["movie1.swf", "movie2.swf"];
//my movie array
var movieNum:int = 0;
//start at 0
function loadSWF():void
[Code] .....

So, two or more SWFs called movie1, movie2 etc., and having movie2 start after movie1 finishes in an overall fla.

View 3 Replies

ActionScript 2.0 :: Load Order In External Swfs

Nov 13, 2008

I was wondering if there was a way to specify the order in which I load in external swfs. I have my main swf which loads in music, navigation and content, they all load at the same time, say i wanted to load in the music swf after the content has finished loading, how would i do that?

View 1 Replies

ActionScript 2.0 :: [MX] Preload Multiple .swfs In RANDOM Order?

Jan 13, 2005

I've got a Flash file that displays a series of .swfs one after the other and I'm trying to figure out how to encorporate a preloader into this script that takes into account the fact that I'm randomly selecting which of those .swfs to display first.

Here's what the attached script does so far:

1. Call external XML file and put .swf path names into an array.

2. Randomly select one of those .swfs to display first.

3. Once that .swf movie has played through (each one is about 6 seconds long) --OR-- if the "next" button is clicked, load the next .swf file.

4. When we've reached the last .swf file in the list, start back at the beginning of the list.

I have looked at a BUNCH of preloader scripts but just haven't grasped actionscript enough to know how to encorporate them into my file.

View 1 Replies

ActionScript 2.0 :: CS3 Buttons In Loaded Swfs Loading Other External Swfs Into The Main Timeline?

Sep 11, 2009

I have a main fla file which loads an external swf into an empty movieclip on the main timeline which works fine but I want a button in the external swf to load another external swf into another empty movie clip on the main timeline.eg. start.swf loads UKEIAMap.swf into (empty movie clip within start.swf) MapLoader_mc then a button havant_b within UKEIAMap.swf needs to load HavantProjectSheet.swf into (empty movie clip within start.swf) ProjectSheetLoader_mc without unloading UKEIAMap.swf

View 3 Replies

ActionScript 3.0 :: [CS3] Flash Interface For Client To Control Play Order Of External Swfs?

Jan 14, 2009

My client has approx 12 different presentation .swf's all with a beginning, middle and an end (phew!). I need to build an interface that views those 12 individual presentations as thumbnails on a single page and allows my client to click and drag whichever ones they wish to use into a separate little container above and in-doing so create a new required running order (left to right) each time they use my interface... so that once they have decided that running order they can somehow use the result for their required presentation. They will be using this interface ongoing throughout the year for various presentations all that will require maybe just a few of those individual swf's in different orders.

View 6 Replies

ActionScript 2.0 :: Loading Other Swfs From Loaded Swfs?

Aug 2, 2006

Flash - 8 : Above is an example of what I would like to do/have done. I've gotten as far as loading the "loaded.swf" into the "start.swf" but my problem is I'd love to use that little loading action I made earlier without copying and pasting into the new movie the same actions for a different link. So, how do I load "loaded2.swf" into "loaded.swf" via the link in "loaded.swf"?

View 1 Replies

ActionScript 3.0 :: Loading 2 Swfs Into One File To Display Side By Side

Feb 1, 2010

This was super easy using AS2. I had 2 'loader' movie clips placed on the stage and simply used the loadmovie to bring up the external swfs. How would i accomplish this using AS3? I simply need one movie to display on one side of the stage, and another on the other side of the stage. do i still use these 'loader' movie clips?

View 4 Replies

Professional :: Can't Seem To Go To A Master Edit File That Is Supposed To Show Both The Body (layer 1) And Wing (layer 2) Of A Flying Bird Animation?

Feb 11, 2010

I can't seem to go to a master edit file that is supposed to show both the body (layer 1) and wing (layer 2) of a flying bird animation. Is there a way to merge these two since I'm planning on shrinking it down and making a lot of birds?He merged the two layers at 14:24 of the video without even explaining how he went to this so called "Edit Master Movie Clip" that seems non-existent on Adobe Flash CS4.

View 1 Replies

ActionScript 2.0 :: Loading In Thumbnails In Order?

Jul 6, 2009

Im loading in tumbnails from an XML. Now they appear in a random order, i want them to be in the order they are in the XML file.

Quote:

thumbNails_xml.onLoad = function() {
var listenerArray:Array = new Array();
var tempArray:Array = thumbNails_xml.firstChild.childNodes;
var tnLoader_mcl = new MovieClipLoader();

[Code].....

View 5 Replies

Loading Swf Files In To A Movie, In Order?

Jul 10, 2009

In AC2, I am trying to load .swf files in to a movie.

I know how to load them, and I can load them at random. But what I want to know is, if I have say 500 movies, named movie_0.swf movie_1.swf movie_2.swf etc...

is there a way I can load them ten at a time, in order of highest number to lowest number. In a specific location.

In other words, I want to be able to have many external swf movies, about 400px wide by 100px tall, and load 10 at a time in to a 800px wide by 1200px tall movie, 10 movies at a time, in order of highest to lowest movie name number. Each in a specific place, with a next and precious button to show the next 10 or last 10.

Im basically working on my first site, and want to use something like this so I can show my latest articles first when someone clicks on the articles section of the website.

Now resolved with AS3

PHP Code:

var loaderone:Loader = new Loader();
loaderone.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedone);
loaderone.load(new URLRequest(prefix + totalfiles-- + ".swf"));
function loadedone(one:Event):void

[Code].....

View 1 Replies

ActionScript 3.0 :: Images Not Loading In Order

Jul 15, 2010

I noticed something after executing my slideshow. The images aren't showing in the order they are in the XML (and that MUST be in order).[code]The problem resides in the fact that Event.COMPLETE when loading images add probably images in the order they are LOADED and not LOADING. Is there a method which will make them add in the order they are called?

View 5 Replies

ActionScript 3.0 :: Images Not Loading In Order?

May 27, 2010

I have a problem with loading images. The images are loading random wise whats the problem with the code.When i trace the url its displaying randomwise.

ActionScript Code:
private function createContainer():void {
for (var i:Number = 1; i<=myXML.images.length(); i++) {

[code]........

View 4 Replies

ActionScript 2.0 :: Loading Swf Movie One After Another In Order?

Aug 5, 2007

I have one main stage in Flash 8 where I am loading different swf's into a main movie clip. And since some of swf's are bigger then others they are loading randomly. I would like to know is there a script that can put some of the swf's on hold and load them as the scipt tells in which order?

In my scenario i would like to place them to load in some order in my main movie clip.

I am relativley now to flash, but I have basic scills to do some basic stuff.

View 1 Replies

ActionScript 3.0 :: Loading And AddChild To MovieClips?

Aug 20, 2009

Basically I have this movieclip on stage that is suppose to load another movieclip from an swf. in that swf are 31 copies of the movieclip since theres no duplicateMovieclip function in as3. I am able to load and add child to the movieclips easy with this,

PHP Code:
function duplicateMovieclips():void{
for (var i=0; i<movieclipsToLoad; i++){
movieclipsDuplicated++;
entrys_mc.addChild(mcV[i]);

Below (which I excluded) are other various bits of code to edit the movieclip and what not. I can also remove it just fine with this bit of code here

PHP Code:
function removeF():void{
var repeat:int = 0;
for (var i=0; i<timesToRemove;i++){
entrys_mc.removeChild(mcV[i]);
repeat++;
movieclipsToLoad--;
if(i == timesToRemove-1){
loadSelected(); //THE PROBLEM
}}}

What this swf is trying to do is record the year and the month the user clicks on and then return every day's data from the xml if a day is filled out. when removeF(); executes, i get the error:
Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
Pointing at entrys_mc.removeChild(mcV[i]);...but when its NOT there, loadSelected(); that is, it works just fine. I even put a trace statement in it. The whole if condition works fine to.

LoadSelected is the one that retrieves the text needed to load in the movieclip. whatever year and month the user selects, it loads the information of it and puts it in a string. then it displays in the dynamic text field inside the movieclip. Also, when SWF loaded it loads all 31 movieclips using this.
Code:
for (var i = 0; i < 31; i++){
var groupMC:MovieClip=MovieClip(clip.getChildByName("group" + i));
mcV.push(groupMC);
trace("repeat # = " + i);
}

View 15 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved