ActionScript 3.0 :: Loading A New Swf And Getting Rid Of Current Swf File?
Jan 17, 2011
I would like to call a new swf file to run and remove the current one I'm running.the goal is to go from a main menu swf file to a selected swf file. Then there is a home button on the selected swf file which will take me back to the main menu swf. So I need to be able to get rid of the last swf file and just stay on the called swf file.
Here is the code I have done so far but it doesn't work properly because I don't know how to get rid of the current swf as I'm moving in to the called swf. Could someone please help
samplePresentation_mc.addEventListener(MouseEvent. CLICK, samplePresentation);
function samplePresentation(event:MouseEvent):void
{
var loader:Loader = new Loader();
[code].....
View 1 Replies
Similar Posts:
Aug 26, 2004
[URL]
i can do a preloader, that's no problem, but i'm wondering how they have it on this site where the current loaded clip stays there until the new clip slides over it? is it loading into levels? how would you unload the mc underneath?
View 4 Replies
Aug 26, 2004
i can do a preloader, that's no problem, but i'm wondering how they have it on this site where the current loaded clip stays there until the new clip slides over it? is it loading into levels?
View 4 Replies
Dec 11, 2010
I've refactored a whole project, splitting the main FLA file into 1 main FLA file and 10+ asset FLA files. Each asset FLA file main stage is empty and has no Document Class associated. Instead, each asset file's library contains a MovieClip linked to an .as class. The loader is first added to the stage, then is told to start to downloading the 10 asset SWF files.
When the download is completed, my application starts instancing the class coming from the asset files. Now, the problem is the following : when I try to access a stage instance from a downloaded clip (for example, a textfield that has been drag&dropped and named via the Flash IDE) , I encounter the #1009 error, saying the stage instance is null...
View 2 Replies
Dec 11, 2010
I've refactored a whole project, splitting the main FLA file into 1 main FLA file and 10+ asset FLA files. Each asset FLA file main stage is empty and has no Document Class associated. Instead, each asset file's library contains a MovieClip linked to an .as class. The loader is first added to the stage, then is told to start to downloading the 10 asset SWF files. When the download is completed, my application starts instancing the class coming from the asset files.
Now, the problem is the following : when I try to access a stage instance from a downloaded clip (for example, a textfield that has been drag&dropped and named via the Flash IDE) , I encounter the #1009 error, saying the stage instance is null.
View 2 Replies
Feb 2, 2010
I'm trying to to get this loader to unload the current picture before loading in a new one. how I can put that in?
ActionScript Code:
function loadPhoto(url:String):void {
var picLoader:Loader = new Loader();
[code]...
View 2 Replies
Jul 27, 2009
detect current frame number of a movie clip inside a loaded external swf?
its like this, i have a main swf, lets call it "loader_swf", inside the loader_swf i create a movie clip called "holder_mc" which loads an external swf, lets call it "ex_swf". The ex_swf has a movie clip in frame 2 which is the main animation of ex_swf. Is it possible to get the current frame number of the movie clip holding the animation on frame 2? the only thing i know is to get the current frame of main timeline of ex_swf.
View 1 Replies
Jan 14, 2008
I have a number of menu buttons (home, about, contact, etc). Each button loads a new/different movieclip onto the scene. Each movieclip when loaded plays up to frame 25 and stops. When I click on any of the menu buttons, I want the current/loaded movieclip to continue playing until it reaches the end of the clip before loading the next. I tried this actionscript with no luck!
[Code]...
View 2 Replies
Oct 16, 2009
how to preload the current swf file in AS3 ?And is it possible to preload all the code in the current swf?
View 2 Replies
Apr 6, 2011
I have the main fla file (Handwashing.fla) and I want to load another swf file (Quiz.swf) at frame 301 of my fla file. They each work seperately, but once I insert the AS I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
I am only in my 2nd class of Flash and this doesn't mean anything to me.
The files can be downloaded from my server, but I am not allowed to post links and the files are too large to upload. [code]...
View 2 Replies
Aug 15, 2009
I'm pretty new to Flash. I have slowly built up an .fla file to its current size of 44MB. It is in AS3 (CS4) and has numerous jpegs imported into it with animated masks over each.I am now experiencing multiple issues that have made it impossible to work on it.
1. A week ago I started occasionally getting "Flash has has unexpectedly quit" error messages, whereupon Flash would crash. This was before I started adding many of the jpegs and the file size was still something like 5MB. Now I receive these messages almost constantly - If I try to open a second file within Flash or when I just work in my main file for a few minutes.
2. A few days I ago I started getting a few random messages saying "error initializing java runtime environment you may need to reinstall flash". This was fixed by simply restarting Flash, but still troublesome.
3. Rarely I would finish working on something and try to test the movie. It would go through the loading bar, but then nothing would happen. The only way to fix this was to go back to a previous file version and rebuild from there. My current file save has this problem.
Now I am stuck because I have to go back quite a ways to find a file that will successfully test. On top of that if I try to import one of my new movieClips into the older file version, Flash of course crashes.
Is the file too big? It doesn't feel like I'm doing that much. I've definately seen flash sites that have way more going on than mine. Could it be all the imported jpegs? Could I be importing them in a bad way? How can I avoid/fix these issues?
View 2 Replies
May 4, 2010
I have this menu that I am loading my swf files under a as. file and linked to a xml file. It loads perfectly my swf files when i click on the buttons, but when i keep clicking the buttons, it keeps loading it on top of each other...How can i unload the current swf file when i click on the other button.? under the as file i have the following to load my swf files:
private function customFunc(link):void { var request:URLRequest = new URLRequest(link); var loader:Loader = new Loader() loader.load(request) var swfContainer:MovieClip=new MovieClip ; this.addChild(swfContainer) swfContainer.addChild(loader);; trace(link);
}
and under the xml i have the following code :
<buttons> <button name="HOME" linkType="custom" link="ball.swf" /> <button name="DESIGN" linkType="custom" link="rec.swf" /></buttons>
View 3 Replies
Jan 10, 2011
In stage AA movieClip is there in side AA, BB MovieClip is there. I Load a external Swf file from BB MovieClip . Can i get current lavel from external loaded swf file.
View 3 Replies
Jun 24, 2010
I have a simple class file for buttons. on Rollover the movieclip plays frame no 2 and on Rollout it plays frame no 11. This is working fine. Now I want to disable the current button on click/release and enable others. I don't know how to get the other buttons because the this keyword always refer to the current button that is rolled over of clicked.
ActionScript Code:
class ButtonClass extends MovieClip {
var buttonName:String;
public function ButtonClass() {
this.onRollOver = over;
this.onRollOut = out;
[Code] .....
View 0 Replies
Aug 18, 2010
does anybody maybe know how to track/trace the current position of a sound file while it is playing?So that it is updated every frame or second?I figured something with trace(sound.position) onEnterFrame, but didn't succeed in realizing this yet.
View 1 Replies
Jun 25, 2006
I'm trying to figure out how to get the name of the current file being played using a flash 8 video player (custom). Here's the code im using :
[Code].....
How does flash know which video is currently being played? Basically I want to set it up so that there is a 'activeVideo' varible that updates based on what video is currently being played.
View 1 Replies
Feb 18, 2011
I've embeded my swf file in .net application and after navigating to some pages in swf file and pressing f5 or refresh, its navigating to starting page of swf file and browsers path always shows the same path (main.aspx page) in which I am embedding the swf file. After navigating to some pages in swf file also it shows the sam path. So its refreshing the aspx page and giving the starting page. How can I control the browser to stay in current page of swf file.
View 9 Replies
Sep 17, 2009
We have noticed a possible bug in the Flash Player within Mac's latest OS version Snow Leopard.
When a Browse for file dialog is initiated, upon returning to the browser. It's as if there is a layer above the flash app which stops interaction with the mouse. MouseOver events no longer take place and a click is require to remove this layer. If you move your mouse at all after the click this invisible layer returns limiting interaction.
We have tested this with 2 macs running snow leopard and the latest Flash Player. And also verified it is not an issue on Mac OSX previous to Snow Leopard.
It seems to effect only FF and Safari. Opera functions correctly.. Here is a video we created documenting the problem: [URL]
We have not had any customers complain about this yet. But if it's infact a bug, it's just a matter of time.
View 6 Replies
Mar 5, 2012
I have a gfx which I have created 6 shapes and converted them into simple buttons. I have urls sat inside an xml file. How can I get the buttons to use the urls set from within the xml file?Also how can I change the current external photo that is being loaded to load the url from a setting in the same xml file.
View 9 Replies
Jan 13, 2010
i wrote an swf application using action script 2,i want to be able to know the file name of the current running swf file.i know that in php i have __FILE__ to get current running php file, is there something like that in flash?
View 1 Replies
Aug 12, 2009
I need the main.asc file to return the current directory listing to a flash application.
[Code]...
View 1 Replies
Apr 12, 2011
i'd like to do something like this:
[Code]...
of course i could hardcode that - but if I then change something about the as file, the linenumbers won't be correct anymore, or maybe i rename the as file and so on. It'd be great to be able to create that string somehow using compiler directives. Is this Possible in an AIR application created with ActionScript 3.0?
View 1 Replies
Apr 15, 2003
I have a button ( 3 buttons ) and each button is assigned to Load a movie. When you click one of the buttons, the LoadMovie on Level 1 is good. Now here is my problem, how will I unload the current movie before Loading the next one. I want to UNLOAD the CURRENT MOVIE first before loading another MOVIE.
View 2 Replies
Nov 15, 2010
How would you defer loading of other graphics on the page until after the images in a Flash gallery's images.xml file are finished loading?Is there any way to detect for this, or would I only be able to check if the flash swf object is finished loading? I'm pretty sure the swf object would be loaded/ready as with document.getElementById('flashobject').onload = function(){}; before the corresponding images have loaded though, instead of after.
View 1 Replies
Sep 4, 2009
I have a "loader.swf" after which my "main.swf" loades. I have used a loaderPro v3 (AS2) component. Doing that was easy but then when it starts loading, even before the loading completes the main.swf starts playing in the background. And i have no coding in my actions panel.
View 5 Replies
Feb 27, 2012
I have created two buttons for separate audio files. Essentially if you click on the button it will play and stop. This works great! I have also injected a SoundMixer.stopAll(); to ensure if you click between both buttons that it will stop the current audio file to play the next one. My problem is when I select the 2nd button for the first time everything seems to be working...it's when I attempt to click on the first button again, that it will require 2 clicks and then it stops and plays accordingly...anyone know how I could eliminate this annoying two click process?
[Code]...
View 1 Replies
Sep 27, 2009
I have been struggling to get Maven2 to cooperate with me, and was wondering if anyone out there had any ideas on how to get this working.... I am working on a Flash project, and we are considering switching from our hybrid Flex4/FlashCS4 to a pure Flex4 solution. We would like to use the Maven2 build system, so that our developers do not have to manually download, install, and configure Flex4 on their machines.I have managed to create a single-module project using Maven2 with Flex4 (I am using the Sonatype FlexMojos Plugin and their Maven2 repository located at http:[url]....
|- bin
| |- moduleX.swf
| |- moduleY.swf
| |- ...[code]....
Basically, each of our modules has its sources located under "src/<modulename>/" and its test sources located under "test/ <modulename>/", with generated SWF files being placed in "bin" and generated SWC files being placed in "lib". Our assets (things that we would like to be able to reference using the "@Embed" or "[Embed]" tags) live under "share". I have looked at the references on project inheritance and aggregation, but can't seem to find anything that would allow us to keep our existing project directory structure. We would like this migration to be as quick, painless, and non-disruptive as possible. how to create a "pom.xml" file that allows us to keep our current infrastructure.
View 2 Replies
Jan 6, 2011
Got a really big problem here. I keep on getting "NetConnection.Connect.Failed" when I load a .asc file on my main.asc file, i use the method load() in my code. I really don't understand why this happens, but when i comment out the code that loads the asc file, I can successfully connect to fms. I can't figure out what's happening here. Btw, i'm using fms4 in windows 7 32bit.
View 6 Replies
Jan 6, 2010
what I'm trying to do is make a preloader that will preload about 20 external SWF files before it lets you get to my main file. I want to do this because my main file needs the SWFs to be ready to go once its done loading. I have looked around and i found a few ways to do this with the "if (loadedBytes>=totalBytes)" and the code loops back till the files are done loading... this would be just what i need but i cant seem to get it to work. the file just seems to start loading my files but does not loop and just runs the time-line even once i state what frames i want it to loop.
View 6 Replies
Feb 6, 2010
I have a flash file that is 1.5mb in size. As it takes about 6 minutes for someone on dialup to load this file, I have created a smaller swf file and loaded the larger one from it but I don't want the larger one to begin to play until it's fully downloaded. How do I set this up? I have set up the action script 2 as follows: loadMovieNum("top2.swf", 0);
View 7 Replies