ActionScript 3.0 :: Loading/Unloading .swf Onto Stage With Preloader?

Jan 6, 2010

I have come across a hurdle that I can't seem to find a way around, when calling in an external .swf file to the stage. Here is what I would like to achieve...

I have 4 .swf files that I would like to call in via 4 buttons on the stage. When a user clicks a button, a pre-loader for the file appears on screen and when loading is done, the loaded file appears. When the user clicks a different button, the current file disappears, and the relevant file is then loaded, with a pre-loader if necessary.

I have used the following code to successfully call in the .swf:

ActionScript Code:
var req:URLRequest = new URLRequest("potfolio.swf");
var loader:Loader = new Loader();
loader.load(req);
addChild(loader);

I can also attach this to a button using the addEventListener, and have it work. However, the problem comes when trying to attach a pre-loader to this, as before, my loaders have always just pointed flash to a frame, rather than display a file that is being loaded once complete.

View 0 Replies


Similar Posts:


ActionScript 2.0 :: Unloading Movie While Loading Another Onto Stage

Jan 20, 2004

I have a movie that initally onloads onto the stage at target MC. I then want this movie to unload when the following button is moused over or clicked for the same MC target.

Button1.onRelease = function() {
loadMovie("home.swf", "target");
};

What would the syntax look like if the inital movie came into a different target MC named "target 2"?

View 7 Replies

ActionScript 2.0 :: Loading Bar Of Preloader Fits To Stage Width?

Jan 19, 2009

I am currently using the preloader script below and I would like to make my loading bar auto stretch to stage width.

// PRELOADER SCRIPT
myBar._xscale = 0;
loaded = false;

[code].....

View 5 Replies

ActionScript 3.0 :: Unloading A Preloader Not Ex1.swf

Nov 5, 2009

I have a "portfolio" which loads some projects I've been playing with.Some of these are reasonably large, so I use a preloader to load them.So, for example, in portfolio.swf, press button1, use a loader class to load ex1preloader.swf which loads ex1.swf.Press button2, I unloadAndStop the loader, then load ex2preloader.swf which loads ex2.swf,and so on. So far so good, all works fine.The problem I'm having is if I click button2 before button1 preloader has finished loading, the unload seems to unload the preloader, but not the ex1.swf (I can tell as the sounds keep going - some of which only get triggered when the code executes).This is *only* a problem if I interrupt at the preload stage - if it succesfully loads ex1.swf, everything is ok, even if I then interrupt ex1.swf.It seems like the preloader gets unloaded, but not what *it* is loading.

View 4 Replies

ActionScript 3.0 :: Loading And Unloading SWF

Feb 5, 2011

I was wondering if someone could take a look at my files and tell me what I'm doing wrong. I'm trying to rebuild an ad in AS3 from AS2 and I'm running into some issues. This is the problem: When a page loads there is a 728x360 container that loads a 728x90 ad. What I need to happen is I need to communicate to the container that when the 728x90 expand button is clicked it needs to unload or stay on the screen while a 728x360 expanded state is loaded in.

I have these files 90% figured out. My problem is I cant get the collapsed state that is loaded into the container to load the new state. I've included my files and they re really simple to follow.

View 0 Replies

ActionScript 3.0 :: Loading And Unloading SWF's?

Feb 1, 2012

I've got a games menu and have the code to load games when a button is clicked. So far say you want to play GameA... The player clicks the button to Play GameA and that game is loaded. Once the player finishes the game they are shown a button to continue which unloads the game and loads the menu.

The problem is that I want a movieclip to be visible on the menu but only when GameA is completed. There is no way to back out of GameA and getting back to the menu without completing GameA. I don't know how in GameA to put that if the continue button is pressed make 'GameATick' visible. I've tried inside the code of GameA putting code like root.GameATick.visible and code like this but it doesn't recognise the MC.

View 4 Replies

IDE :: Loading, Unloading Swf Through Button?

Sep 24, 2009

i have looked for a solution for a long time but they either didnt work and were too complicated for my little skill. so i have a main .swf which im working on. i then have buttons which when clicked, launch a panorama. the problem is that this panorama is created with a 3rd party program and is a .swf. now. i curretly have the follwoing script to launch the panorama

on(release){
loadMovieNum ("foyer_pano.swf", _root)
}

however this opens the swf in a new tab of my web browser. now that is not too bad, but i would like and it would be much better if the panorama would open inside my current swf. i remember i managed to do this. (sorry i forgot the code for it!!!) but when this was done, it would cover all my other buttons. i tried different things with changing levels and those sort of things, but nothing seemed to worked. (i was able to display a button on top of the swf but its AS woudlnt work) does anybody know how to do this? can someone explain it quite simply and in detail? i just want to load an swf in my project, and have a button on top of it with which i can unload this swf. (note that i cannot edit the settings of the panorama swf except for its size and dimensions and stuff, i cannot add a button or AS into it)

View 1 Replies

ActionScript 2.0 :: Unloading XML Before Loading Another?

Jul 20, 2006

This image gallery I am working on loads the thumbnails(from the XML) into a scrollbar. It works for the first one fine, but when I click on another button for another gallery it adds the thumbs of the new gallery at the end of the ones already there, but what I trying to do is have the previous thumbs unload then load the new xml with the appropriate thumbnails.I have tried removeNode(); to unloadMovie(); and various other functions but nothing works. The XML does not unload before the next one loads EVER. The removeNode(); doesnt even remove all the children, which i thought it was supposed to.

Code:
xmlData.firstChild.removeNode();

This is in a function called on the release of all buttons, but it doesnt do anything. This function is located in the same frame as the loadXML function. Is this the wrong place to put it?

View 4 Replies

ActionScript 3.0 :: Assistance Unloading Flv's From Swf's Imported To Main Stage?

May 11, 2009

I have my main.fla which imports external swfs that contain flv's. I have three buttons that navigate the main timeline to frames 2-4. At frames 2-4 an external swf gets loaded into an empty movie clip via this code. Each loaded swf acts like a menu with some nice vidoes loading in the background.The problem i found is the flvs continue to play as i navigate between menus, which makes the main swf/fla slow down becuase the pc is working harder to deliver all the stuff running in the background. I've added this code to frame 1 of my empty movie clip that is in my library that has the instance name 'menu1'I keep getting the error "Access of undefines property mc1"I have the source files for my site here if you can take a look and see what I'm doing wrong. I have removed this code so i don't get the error and have tried other things to no avial.

///////////////////////
var loader:Loader = new Loader(); addChild(loader); loader.load(new URLRequest(MovieClip(this.parent).src));

[code].....

View 2 Replies

ActionScript 3.0 :: Assistance Unloading Flv's From Swf's Imported To Main Stage

Sep 15, 2011

I have my main.fla which imports external swfs that contain flv's. I have three buttons that navigate the main timeline to frames 2-4. At frames 2-4 an external swf gets loaded into an empty movie clip via this code. Each loaded swf acts like a menu with some nice vidoes loading in the background.
 
The problem i found is the flvs continue to play as i navigate between menus, which makes the main swf/fla slow down becuase the pc is working harder to deliver all the stuff running in the background. I've added this code to frame 1 of my empty movie clip that is in my library that has the instance name 'menu1'
 
I keep getting the error "Access of undefines property mc1"
 
I have the source files for my site here if you can take a look and see what I'm doing wrong. I have removed this code so i don't get the error and have tried other things to no avial. [URL]
  
///////////////////////
var loader:Loader = new Loader(); addChild(loader); loader.load(new URLRequest(MovieClip(this.parent).src));
////////////////////

[Code].....

View 3 Replies

ActionScript 2.0 :: Loading & Unloading Movieclips

Aug 8, 2010

I start off my game with an empty movieclip located in the middle of the stage. I then load a movieclip using the loadMovie method. At some point I would like to unload the movieclip and then reload another one, sort of a different scene if you will. The new movieclip has a number of other nested movieclips that I will use as buttons and I have coded a function that is called that creates these buttons. Here's what it would look like:[code]The roomSetUp function contains info on how the room should look and the button codes. The problem is that the setup function runs before the new movieclip is loaded. Seems that there is no way to have Flash 'Yield' until the movieclip is loaded and then go to the last function. Any suggestions other than MovieClipLoader?

View 2 Replies

ActionScript 3.0 :: Loading SWF With Each Button And Unloading Old One

Sep 18, 2008

I am making a site and I want each button to load an swf, which would be the content of each page. When I click on each button the swf will load, however, the old swf will not go away.

View 2 Replies

ActionScript 1/2 :: Loading/unLoading XML Data?

Jun 15, 2009

I have an accordion style btn that expands and contracts base on the user's cursor.
When the btn expands it loads an external XML file. The problem I'm having is that after the btn contracts the loaded XML content is still in place. Is there a way to unload this XML content after it has loaded?

View 5 Replies

Professional :: Loading And Unloading External SWF?

Apr 1, 2010

I'm trying to load an external swf and unload it after its completion. I have tried a few things and am stuck. Here is my current code to loading the swf, which seems to be working fine, its the unload I cant get:

import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
function startLoad() {
[Code] .....

View 3 Replies

ActionScript 3.0 :: Loading And Unloading External Swf?

Nov 29, 2010

I have a external swf that has an embedded video that loads automatically. Once it loads I have a button that unloads it and reloads. The first time I unload it, it works fine. The second time the video unloads but the sound continues? This happens each time I load and unload; the sound continues to loop.
 
stage.scaleMode = "noScale";
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs1/ME_video1a1.swf");

[Code]....

View 4 Replies

ActionScript 3.0 :: Loading And Unloading An SWF File?

Dec 2, 2010

I'm currently working on a educational project for e-learning. This  project has multiple buttons for opening several specific SWF files.  What I want to accomplish is to be able to use my container file with 3  primary buttons for the named SWF files and have them load in a specific  location in the container SWF. Then I have a separate button that just  needs to close the loaded SWF file. FYI, the 3 primary buttons will be  covered by the loaded swf file. I'm including my AS3 code for review. I  can load a SWF and close it once. After that, it doesn't work.

[Code]...

View 2 Replies

Actionscript 3 :: Loading And Unloading New Models?

Dec 3, 2010

am using pv3d to load a couple of models for a school project. The models typically don't do much, they just spin on a dial when fired up. At any given time, there are only two models shown. My initial thought is to utilize two global Collada instances and have a function call the Collada load function to load the new models into the instances. Looking through the Collada parser, it would seem that the load function appends the new model, leaving the existing models up there, as opposed to loading in a new set of vertices.

Fair enough. At this point I decide that I should remove the models from the scene, and create new ones every time the function fires.Here is where my problem lies. This probably from my lack of understanding on the workings of AS3/pv3d, so please bear with me. When I remove the models from the scene and add them again, the models do not appear within the scene. However, the model instances still remain traceable when I run a trace.Here is the code for reference. I omitted the portions which are duplicates.Instances are created on a global level as onRenderTick can't seem to reference it if I create it on any other level

public var model:Collada = new Collada();
public var model2:Collada = new Collada();

The initial properties such as x y position and pitch are set when the dials are created

public function setupDials():void {
var materialList:MaterialsList = new MaterialsList();
var bitmapFileMaterial:BitmapFileMaterial = new

[code].....

View 1 Replies

ActionScript 2.0 :: Loading & Unloading Music?

Jun 26, 2009

add a couple of music files to a CD presentation using actionscript. I know how to load one track but how do I unload a tack when it's finished and load another after that? Here is the code I have so far:

myMusic = new Sound(myMusic_Mc);
myMusic.loadSound("Doin It.mp3");
myMusic.start(0,5);

View 0 Replies

ActionScript 3.0 :: Loading / Unloading Swf With Button

Aug 12, 2009

I have this code that unloads all swfs that the home swf connects too. by going back to the first frame label of the home.swf. Instead of it going to the first frame label of the home.swf I need the code to load another swf.The new button name is "back_btn", instead of the homebtn.[code]

View 4 Replies

ActionScript 2.0 :: Loading/unloading MC With Button More Than Once?

Oct 4, 2011

I have a button that when clicked it shows a movie clip and when clicked again it removes the movie clip. I'm having trouble getting the button to do this action more than once. Is there some code I can add to the button to make the actions start from the beginning? I'm worried once the button is clicked to remove the movie clip, the action is only being read from the function down. Here's my code:

ActionScript Code:
my_btn.onPress = function()
{
captionFNtst(true,"tst",this);
this.onPress = function()

[Code].....

View 0 Replies

ActionScript 3.0 :: Loading/Unloading SWF With Buttons?

Dec 12, 2011

loading a SWF file and then removing it with the use of buttons. It's a fairly simple situation, but I just can't seem to get it to work.

Here is the code:

function newvid(event:MouseEvent){
var tv_loader:Loader = new Loader();
tv_loader.load(new URLRequest("tv.swf"));
addChild(tv_loader);

[Code]....

The scene basically says click on button and tv turns on...but I can't seem to get the off button to work. I think I am missing a step some where in the code.

View 5 Replies

Actionscript 3.0 :: Loading / Unloading External SWF's?

Nov 13, 2008

I am slowly learning AS3 but have hit a bit of a brick wall though I am sure it is something that many will see as easily resolvable, just my lack of knowledge and understanding of AS3 at this moment.

My query is I am trying to create a SWF which loads in (3) external SWF's using three movieclips I have within the main SWF. I have managed to get the external SWF's (1.swf, 2.swf, 3.swf) to load in when each of the movieclips / AS3 buttons have been clicked but I cannot figure out how to unload the current selected SWF file (e.g. have initially click on btnOne which displays 1.swf yet when click on btnThree to display 3.swf, 1.swf has not been removed from the stage and overlaps 3.swf) when I want to load another SWF file (sorry if this does not make sense). Below is the test code I have tried:

Code: Select all/////////////////////
///////Loaders///////
/////////////////////
//One

[code]....

My question is how do I unload (or removeChild I guess) the current SWF from the stage when I click on another movieclip / AS3 button to load another external SWF without the mish-mash as can be seen in the uploaded test files?

View 14 Replies

ActionScript 2.0 :: How To Loading/unloading Movie (MX)

Oct 25, 2003

i have a little problem (not so little for me) with laoding movies:on the main movie, i have a button which loads a movie withthe following script:

horta.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("03_horta.swf", "container");

[code]....

View 13 Replies

ActionScript 2.0 :: Loading/Unloading External SWF's

Aug 4, 2004

I am Using Flash MX ActionScript.

Anyways i have a series of buttons, and I would like them to each load a external SWF file into a movieclip. I have accomplished this so far but, I would like it so that whenever I click a button it unloads any already loaded SWF file that is already there. This is what I Have So far

on (release) {
loadMovie("movie.swf", this.movieholder);
}

View 3 Replies

ActionScript 2.0 :: Loading/ Unloading External Swf

Dec 8, 2008

I am loading an external swf file into my main swf movie with a button. But I donot know how to unload it. Here are the scripts.

on (release) {loadMovie("Main content.swf","Main1");
}

Main1 = the holder on the stage

View 2 Replies

ActionScript 3.0 :: Loading And Unloading A Swf File?

Mar 21, 2012

i am making a game of  3 different levelsi have 4 swf file1 for the user interfaceand 3 swf for the level of the gamesim gonna link the userinterface file to the 3 levels using the load function etc.the problem is how to unload the swf file when game over or when the user wants to quit and go back to the user interfaceim not sure if you got my point clearbut to be more specific each swf has its owns fla and as files independently and from the user interface as im gonna load the filesi know how and when to load thembut the problem i have no idea how to unload them when its game over in the game

View 8 Replies

ActionScript 2.0 :: Loading And Unloading Clips?

May 18, 2002

When my flash site loads the menu is displayed on the left and an animation on the right. When I click on a menu item I want the animation on the right to change to a new clip. How do I do this.

View 3 Replies

ActionScript 3.0 :: Loading And Unloading SWFs?

Jul 2, 2009

I'm trying to create a site which loads external SWFs into a Moviefor its content, and the entire site is contained in a Movie Clip located on the main timeline.

I keep getting a 1009 error, so I'm assuming that AS isn't drawing the loader where I want it to be, so I'm fairly certain I'm doing something wrong..haha.

Here's a link to my Files: [URL]

View 2 Replies

ActionScript 3.0 :: Loading And Unloading .SWF Files?

Sep 10, 2009

I have created a site using the most basic amount of AS possible because i am new to it and am just finding my feet, i thought i might be able to get away with using just button links and slideshows but now my site is getting very big and is taking a while to load, i have added a preloader to the beginning of the site in a different scene.On my second frame i have a external .SWF file being loaded, it loads just fine but when i navigate away from the frame it is still there on every frame.

here is my code for the frame;

//////
var SlideshowURL:URLRequest = new URLRequest("Slideshow.swf");
var SlideshowLoader:Loader = new Loader();
SlideshowLoader.load(SlideshowURL);

[code]...

View 7 Replies

ActionScript 2.0 :: Loading And Unloading A FLV Component?

Sep 19, 2009

I need to load a FLV component to the stage and when its done playing (the movie), I need it to unload.

View 1 Replies







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