ActionScript 3.0 :: Reloading SWF A Second Time Gets An Error
May 15, 2011
I'm having an odd issue with reloading SWFS. I start of with loading my SWF:
var req:URLRequest = new URLRequest( "RegionalIntro.swf" ); introSWF = new Loader();introSWF.load(req);addChild(introSWF);Then once I'm finished I unload:
removeChild(introSWF);introSWF.unloadAndStop(true);Now when I want to reload the SWF I run the first bit of code again I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.I cant work out why I'd get that the second time it loads and not the first. It's supposed to just be the same? This is being done inside Windows Projector .exe file, it's going to run as a kiosk application. I can catch the error by surrounding all of the code in the function at the top of the stack trace with a try/catch block. I trace the error and its the same, the weird thing is all the code executes as expected. All works fine and then throws an error
View 2 Replies
Similar Posts:
May 12, 2011
I'm having an odd issue with reloading SWFS. I start of with loading my SWF:
var req:URLRequest = new URLRequest( "RegionalIntro.swf" );
req.method = URLRequestMethod.POST;
req.data = true; // POST requests require non-null data
[Code]....
What I can't work out is why that works the first time, but when it's reloaded it doesn't work?
EDIT2: The plot thickens, I can catch the error by surrounding all of the code in the function at the top of the stack trace with a try/catch block. I trace the error and its the same, the weird thing is all the code executes as expected. All works fine and throws an error ... very odd! I'd hate to leave it like this without finding out why it's doing it though ...
View 2 Replies
Oct 22, 2003
I am making a Flash website. I click on a link,... lets say 'Contact' The 'Contact' page opens. I click on 'Contact' again while it's open,... It opens again. I need to know how to prevent the link from reloading each time you click it
View 2 Replies
Oct 22, 2003
I am making a Flash website. I click on a link,... lets say 'Contact' The 'Contact' page opens. I click on 'Contact' again while it's open,... It opens again. I need to know how to prevent the link from reloading each time you click it
View 2 Replies
Jul 25, 2011
I am encountering some very strange behaviour with a Flex 4.1 app I am writing which gets in the way of testing. It seems that I can reload the app 16 times and then on the 17th, the loading process fails withError #2046: The loaded file did not have a valid signaturet seems to be consistently happening on the 17th reload on both Firefox 5.0 and Chrome 12. I am not sure if it's relevant, but I am running Flash Player v10.2.159.1 (also happens with 10.3.181.34) on Ubuntu 10.04. Happens with both regular and debugger versions of the player. When I run the app on Windows FF5, it doesn't seem to happen. Closing the current browser window does not seem to fix it. The only way around it is to completely close all browser windows and restart the browser. And then again after 16 successful loads, the 17th fails.
At this point I'm thinking of chalking it as a Linux Flash bug but I'd like to make sure and check if anyone knows if there's something I should be doing to prevent this.The user from this post seems to have had the same problem but I guess he didn't notice the pattern I have.== UPDATE ==I just realized that after my app starts throwing the 2046 error, trying to load any other Flash that uses signed RSLs also shows the 2046 error (e.g. this app), which means the problem is not specific to my app and most likely related to the Flash cache or something of the sort.
View 4 Replies
Oct 6, 2011
I use UrlLoader.load() in my flash app. And I'm handling UncaughtErrorEvent.UNCAUGHT_ERROR to stop the app when an uncaught exception occured. UrlLoader.load() works when you are connecting the internet normally. But if the connection to the internet was lost after your browser loaded the app, SecurityError happens when UrlLoader.load() is called. I can not catch the SecurityError by using try catch and UNCAUGHT_ERROR happens and it stops my app. I don't want to stop the app when UrlLoader.load() failed because I'm just using UrlLoader.load() to log some unimportant information.
And I think timeout error also can be ocurred if it takes a long time to load. And I also don't want to stop my app due to the time out error. How can I solve those problems? And are there more other type of errors which can be ocurred and stop my app?
View 1 Replies
Jan 30, 2009
i am new to flash and i am trying to develope a 3d site using flash cs3 but i got an error i an attaching the program and theerror displayed is shown below [code]
View 1 Replies
Nov 14, 2011
I'd like to know whether there is a way to add an error handler for a #1502 execution time error in AS3.
A couple of notes:
I am aware that the max script execution time can be set on the publish options. It takes values as high as 16 bit (0-65535). So there is a max of 18 hours. The script does not get terminated after 60 seconds in the context I use it
I use it in an application built with mProjector. There is an event listener on a button that opens a file browser dialogue. As long as the browser is open the event handler does not continue. If the maximum script execution time is exceeded I get the #1502.
View 3 Replies
Jun 30, 2011
I have a flash file where the first frame contains two buttons, one of which takes the user to the second frame, and the other takes them to the third frame. At each of those frames, various text fields and variables can be manipulated via SimpleButtons. Both Frame 2 and Frame 3 have "back" buttons to take them back to Frame 1.
Currently when the user navigates back to Frame 1 for the second time (thus playing it for a third time), my second button appears to no longer exist, and I receive an error. Both buttons on Frame 1 were placed via the Flash IDE. Why is my button popping out of existence, when it did perfectly fine the previous two times? Below is my code for Frame 1. The "back" buttons simple remove event listeners and then call gotoAndStop(1)
var inited:Boolean;
var cache:SharedObject;
var libsans:Font = new libsansreg();
[code]....
View 1 Replies
Jul 24, 2009
we face a problem in development which cause runtime error 2022. We have a button in libaray which has bitmaps for Up, Over, Down. We want to link these bitmaps to actionscript to make some changes on the bitmapdata. But when this button first added onto stage it will cause runtime error 2022. We even tried add movieclips to encapsule these bitmap and add movieclip in the button. The error still there. Is any way to bypass this problem? Or any document about error 2022? I searched in google but all what I can find is a simple explaination same as which in flash doc.
View 7 Replies
Nov 10, 2009
When I was running my fla, this outputed: " Error: Error # 1502: A script has executed for longer than the default timeout period of 15 seconds.at test.fla: MainTimeline/frame1 ()".
View 2 Replies
Mar 4, 2010
I have an mc that has 12 buttons on 12 layers all btns have alpha tweens for 10 frames so the appear like this
btn 1 alpha fr 1 to 10
btn2 alpha fr10 to 20
btn3 alpha fr20 to 30 and so on.
at the end of the clip there is a stop.on the first frame of the button actions I have as follows
btn_loreal.addEventListener(MouseEvent.CLICK, addLorealswf_click);
function addLorealswf_click(evt:MouseEvent):void {
MovieClip(this.root).gotoAndPlay("loreal");
}
[code]....
I keep getting the 1009 error soon as the mc gets to the last frame NOW, if I put all the buttons and remove all frames from 11 on so all buttons alphatise at the same time and the mc ends on frame 10 the error disappears How can I alphabetize each button at a different time without getting the error?
View 2 Replies
Jan 30, 2009
I have build a simple flash application to try to make changes to an xml and save it. The application has two buttons: load xml - that loads the xml and write xml - that saves whatever is in the textbox to the xml. Then when pressing load xml again, it should load the modified xml.
You can see the file here: [URL]
It works fine on localhost, but as I uploaded it to the sever it doesn't work!
flash code:
Code: Select allvar myLoader:URLLoader = new URLLoader;
var xml:XML;
var myRequest:URLRequest;
[Code].....
View 2 Replies
Jan 9, 2012
I have a character added as Child in the Main Time line and i am trying to make a class for that same char to control it, but as soon as i start it gives me this huge annoying error that says It has a compile time-constant error in the
private function checkKeysDown(event:KeyboardEvent):void{
Full class code below
Code:
[code]....
View 2 Replies
Nov 5, 2009
I have frame 1 and frame 2 which are almost the same. Both have a movie clip TAB. This tab has buttons: button 1, button 2, button 3. When I click button 1, it will show a text, and so on..If I am at frame 1, and I click button 2, it is ok. But when I go to frame 2, TAB movieclip is still at button 2! I think it is not reloading.
View 2 Replies
Jun 16, 2011
URL...Once you get to my portfolio menu homepage, click on Print design. Everything there loads fine.The trouble is going back to the portfolio movieclip and having it display those menu buttons again.As you can see, if you try to click the view portfolio button at the top, it loads that movieclip to wherever you left off at.Basically, my question is: How can I have my "view portfolio" button reload/refresh the movieclip (page1) from the beginning in my pagecontainer_mc?
-page1 is a movieclip that shows my portfolio buttons.
-page2 is a movieclip that show the "about me" section.
-pagecontainer_mc is an empty movieclip that loads page1 or page2.[code]
View 5 Replies
Dec 29, 2009
I have an image that I am attempting to load, and then reload. Here is my code for the loading of the image:
public function loadImage(url:String, _w:int, _h:int):void
{
this._stwidth = _w;
[code].....
View 3 Replies
Feb 18, 2011
I have a flash animation made on the main timeline of the SWF with a couple of layers, some functions and some keyframe labels. For example, i have a movieclip of a star that come across the screen and then triggers a dispatchEvent for the main timeline to go to frame label "next".[code]That SWF alone works perfectly. Problem comes when I try to load this SWF into another one.What happens is the loader keeps reloading the SWF over and over, overlapping them and the actionscript that's on the main timeline of the loaded SWF is ignored, the timeline plays continuously. Here is the code i use to load the SWF:[code]I have found a workaround by putting the entire animation inside one main movieclip and put that movieclip on the main timeline (one keyframe, one layer, no actionscript) and then load it. That way it works fine but it feel more like a patch than a solution. I would really like to know why it's bugging when you try to load an external SWF that use the main timeline with multiple layers, keyframes and actionscript.
View 1 Replies
Jun 26, 2009
I have an external SWF with some classes.I have a separate (main) SWF with the design and basic code that calls on the external SWF's classes.If I had to change code in the external swf and republish it, how do I use the updated SWF's class without having to republish the main SWF (the one with the design)?
View 0 Replies
May 26, 2009
I have 4 buttons on Layer 1. button_1 to button_4. On Layer 2 I have 4 movie clips each with a timeline span of 5 kf's and a second layer above with a Stop action on the 1st and 5th kf. Each button has a piece of AS on it as follows:
on (release) {
_root.slide_1.play();
}
Each movie clip has an instance name from slide_1 to slide_2. Now when I preview the SWF and click on each button each MC will load and play BUT I have to click on the same button again to make the MC disappear. If I click 1-4 in that order once I click the 4th button and the MC loads for slide_4 I cannot make any of the previous MCs load anymore.
Now I realize there are more advanced ways to make this happen and I am using Flash CS4 but I'm not much of a programmer and can't seem to figure out why this is happening.
View 13 Replies
Jun 12, 2009
I created an external .swf that plays an mp3 and functions as a mute/unmute sound toggle.On its own it plays/toggles fine, but when I use loadMovie to load it into my main .swf it just starts reloading over and over until the song has started one after the next and it becomes a jumbled mess of overlapping songs.I'm going to keep searching through the forums, but does anyone have any clues? I use loadMovie for an animated gif .swf in the same main .swf and that doesn't give me any issues so I'm curious to know what my oversight is.
View 2 Replies
Sep 17, 2008
This is my first time using flex. I tried compiling thecripts below usingmxmlc example.mxmlAnd I get:Error: Type was not found or was not a compile-time constant:UIMovieClipThis is on a windows machine. If I type just "mxmlc" I getthat I'm using version 3.1
View 17 Replies
Dec 27, 2011
I am trying to make an animation with three seperate buttons that when clicked on make one set of text disappear and new text appear in its place. My code so far looks like this:
stop();
//---Bio Button Text---\
go.addEventListener (MouseEvent.CLCIK, bioplay);
[Code].....
View 26 Replies
Sep 29, 2009
Flex HTTPService giving timeout error as web service take more time to response. Due to large voueme Is there any work around to handle overcome the error
View 2 Replies
Feb 11, 2011
I have a symbol with name and class name "cat". I also have buttons with names and classnames of values "upButton" "downButton". I dragged the symbols onto the stage and gave them instance names of "cat", "upButton", and "downButton", and tried to control the position of the cat using the buttons, however I got the error message:
"type was not found or was not a compile-time constant"
So I tried changing the name of the instances to cat2, upButton2, and downButton2, and it works perfectly fine. So am I not allowed to have instance names identical to the class name? This is strange because in the book I am working out of, the instance names are identical to the class names.
View 2 Replies
Apr 8, 2011
I am trying to create a a menu (eventually on two rows of three buttons) Here is code so far:
the pages are on timeline at 10, 11 12 ( 13 14 15.)
Code: Select all
stop();
var menu_label:Array = new Array("Homepage","Projects","About us");
var total:Number = menu_label.length;
[Code].....
View 1 Replies
Jan 26, 2011
I have to dynamically load an image in 2 separate places, but I don't want to have to load the same image twice (this consumes more bandwidth and makes the user wait longer than needed).Is there a way to, say, copy the contents of a UILoader into the contents of another? I am aware that flash performs caching, but I still see a slight loading delay on subsequent reloads.I am using as3, btw, on flash cs5.
View 1 Replies
May 19, 2009
I have a website i'm working onnd it works fine in safari and firefox, but when I run it in explorer it doesn't Whats going on is that when you go to the homes section of the site, each home's section is a swf that is loaded into the main movieclip.In explorer these swfs load fine the first time around, but when you return and want to load the swf/section and see it again, they get stuck and although they appear to load, i'm not sure if they have and are getting stuck on the first frame or they are not loading, or there is something going on with the cache.I am loading from the main movieclip using a container with the following code:
var homeLdr:Loader = new Loader();var homeURL:String = (MovieClip(root).gotoArea)+"Eng.swf";
//gotoArea names the swf to loadvar homeURLReq:URLRequest = new
[code].....
View 6 Replies
Apr 9, 2010
I have a SWF movie inside of a jQuery UI tab, and the problem I'm having is that the SWF gets reloaded everytime I click away from the tab onto another tab, and then click back. I can inspect the DOM and see that the div containing the SWF is still in the DOM when I click away, so I don't know why this it seems to reload it when I click back to the tab.[code]...
View 2 Replies
Aug 27, 2011
show flash object in a popup, without copying DOM "object"? I need same instance of flash in the popup.
I guess something similar Stop reloading flash file when using show and hide methods, but I really haven't found yet any good solution for popuping in that case.
View 2 Replies