ActionScript 3.0 :: URLLoader - OnComplete - First Load Quirk?
Jul 9, 2009
Wondering if anyone has an incite on this. I have a basic Shell class that I'm using to load in all of my assets including two xml files and one css file. Currently I'm using a single URLLoader to load in the three external files. Through testing (Using FDT Pure in Eclipse 3.3.3, publishing using 'FDT AS3 Application') I'm running into an interesting issue.Basically the first file that I try and load, regardless which xml file or css file, my onComplete doesn't seem to be getting called. But everything runs gravy if I insert this line before beginning my loading:
ActionScript Code:
this._urlLoader.load(new URLRequest(""));
Here's some more of the code:
[code].....
View 1 Replies
Similar Posts:
Oct 1, 2009
When using the Adobe Facebook API, When you request a collection of FacebookUsers, the data is returned in a FacebookUserCollection. This collection has a function with the following signature:
public function getUserById(uid:int):FacebookUser
Nothing looks out of the ordinary here until you realize that the uid data you retrieve from Facebook (at least when retrieving as XML) is returned as String. So calling getUserById with a uid you've received gives you a compiler error unless you cast it as int, like so:
var fbUser:FacebookUser = someCollection.getUserById(int(someUID));
Still looks pretty pedestrian, right? So what happens if the uid is something like '3005006709168111' (as a random example).
Try casting that as an int and tracing the results.Many of the UIDs I've been testing against are sufficiently large that they cause int to roll over and thus are not *actually* the UID they should be once they are interpreted by the function... and when you look through the data that's being compared in this instance, the uids associated with the FacebookUser class are not int at all, they are Strings!Why does this function require int as input when it's comparing against Strings, and when FB uids are sufficiently large that they rollover Flash's int type?
View 1 Replies
May 23, 2011
I have encountered an interesting problem when I try to load an .xml file using a URLLoader (within my own custom class). I have several configuration .xml files which I use to configure the application when it launches. For example, in the code below, myCustomLoader is a custom class I wrote that takes an .xml file as a parameter. The myCustomLoader class encapsulates all the instantiation of the URLLoader class and error handling etc. The code below operates as expected, the configuration files load into memory, and they're accessible throughout my App.
[Code]...
View 7 Replies
Dec 17, 2008
I want to use URLLoader to load a textified article from my joomla website [code]...
View 13 Replies
Sep 20, 2010
I am trying to use URLLoader to load an XML file from server (same domain as swf). This should be too simple but I am getting Error #2032: Stream Error.If I trace the HTTP status event it just shows status=0 though I have read that Mozilla doesn't supply status codes to Flash Player so maybe it's not informative.I have sniffed the HTTP traffic with Charles and Flash isn't even trying to load the url - no request is made, so it doesn't even fail.I can browse to the url, which is on an internal url that looks like:URL...I have tried putting a crossdomain.xml in there (with and without a to-ports="8080"), though it shouldn't need one.Neither the onOpen nor onActivate events fire, just one HTTPStatus and then the IOError.I have copied the common URLLoader code from Adobe example, mine looks like this:[code]
View 2 Replies
Oct 1, 2010
I have Flash website, and I load data from XML file with urlLoader. If I change data in XML-file, refresh doesn't update data in site. I need to publish it again! How can I make this automatic, that I only need to refresh when data is changed? I can't allways publish when I change somethin in XML-file.
View 3 Replies
Dec 1, 2010
I'm currently trying to make a fun little SWF that lets the user input the URL of an image online, then play around with that image via filters, painting, etc, and save their finished work to disk. However, I'm running into some issues once I upload the SWF online. My SWF works without any problems at all from the Flash sandbox, but once online there seems to be a problem.To overcome the issue of not being allowed to smooth an image loaded from an external source, I am using a URLLoader with dataFormat set to BINARY to load the image. Then I have a regular Loader loadBytes from the loaded data of the URLLoader. This allows me to apply smoothing and chang ethe bitmapData of the loaded image.
This works for a select amount of images online. The problem here is that for most images, the URLLoader never finishes loading, nor does it produce an error. It doesn't even produce a ProgressEvent. The .load method of the URLLoader executes with error.
View 6 Replies
Apr 22, 2010
Is there a timeout on the connection made by URLLoader.load? If there is, what's its value, where is it documented and can it be changed? Also, what event (if any) gets dispatched if the timeout occurs? Is there a difference between AIR and browser application in those regard?
View 2 Replies
Apr 23, 2011
I'm creating a website using Adobe Flash Professional CS5. I'm trying to read the content of a text file with URLLoader.load(path) inside a for loop. The path changes every iteration. When I trace the data from the event handler method, it returns only the last path's text file's content. It seems like it's calling the event handler method only after the for has done looping.
CODE:
var myData:URLLoader = new URLLoader();
myData.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void
{
[Code]....
View 2 Replies
Aug 6, 2011
there you are, you set up your AS3 code to load XML via a URLLoader and URLRequest, as normal. You then take your XML file, and upload it to a server. You then run your program, and trace out the XML you receive. So far so great, and you see the results of your XML traced out. Then you change something on your XML, either adding to it or removing a line. You then run your program again from CS5.5, and trace out the XML, and it shows the same results that it did before you made any changes. I deleted the XML file from the remote server, and it is like it stored it in cache, and still able to read it. If I change the url or file name, it gives me an error, which it should.
If I point the url back to my remote XML file, and run the program again, it gives me the XML results I had in the beginning, before I made any changes to it (regardless if the XML file exists). The only fix I have found so far, is closing CS5.5, and reopening, and then it can see the changes. I did that, and it was able to see my XML changes on my remote server, but again, only one time. If I try to change anything, or delete the XML file, it still pretends as if its there, reading the results that it read the first time I run the program. Is this a cache issue? Anybody else experience this? I never remember running into this problem using CS5/CS4/CS3, only CS5.5. Of course, I can test it all locally first, and then upload the XML file to the remote server when I know that no other changes need to be made, but still, this is really weird!
View 1 Replies
Dec 20, 2011
I'm trying to send about 1 MB of binary data to server via URLLoader. But when I call method load of this class, my application hangs for about 1-1.5 seconds, then uploading runs normally.
View 2 Replies
Jan 21, 2010
I'm planning to load images via URLLOADER onto the stage.....i want each image to be on a diffrent frame of the main timeline how do i tell each one which frame it belongs to?
View 5 Replies
Jul 14, 2009
I understand the Flash and AS3 is single-threaded, at least at the user level. I would like to understand how asynchronous data loading is handled by the Flash player.
For instance, if I run CPU-intensive code that runs beyond the normal frame (lets say it runs on ENTER_FRAME, and consumes 1/4 per call). Does this leave any CPU cycles to load data from a URLLoader?
If http loading is truly synchronous, right down to handling the TCP/IP stack, one would get horrible performance. In Windows programming, I can do http access asynchronously (in which case the Windows libraries are doing either input on a separate thread, or doing hardware-level interrupts to handle the data -- I provide an asynchronous callback that may be on its own thread). Or, I can do synchronous download, in which case there will be hardware buffering, but my application is actively waiting for each buffer of data to be delivered by the hardware/OS combination.
URLLoader is asynchronous, but what does that mean? Does it mean that I can run the CPU and still download data? Or, will my download speed slow to a crawl if my Flash application is under heavy CPU load? Understanding how this works will help me design my product better, which both uses a lot of CPU, and downloads a lot of data (to the bandwidth limit of the network, if possible).
View 2 Replies
Feb 23, 2010
I have a flash element in a page that load a chart based on some complex queries that can take up to a minute to load. I call the query with this code :
var chartData:URLLoader = new URLLoader();
chartData.addEventListener(Event.COMPLETE, onLoaded);
chartData.addEventListener("httpStatus", onHttpStatus);
[code]......
View 1 Replies
Jan 6, 2011
I have a Flash movie that behaves as follows:Movie loads > tries to load an XML file using URLLoader.load() > uses the data in the XML to load some images into the movie.The requirement was for updates to the XML file to be picked up within 10 minutes, so I have added a querystring parameter to the XML URL which is a timestamp to the nearest ten minutes, e.g.1-40**This all works for me as expected in IE and Chrome, and it works locally for me in Firefox. However, on our production server (IIS) in Firefox, the following behaviour occurs (by observing Firebug):First load:SWF loads > XML Requested and loads > images requested and loadSubsequent page loads:SWF Loads > no request for the XML (no request shown in Firebug)Firebug shows the following information about the XML file from the first successful request:
Response Headers
Cache-Control max-age=31536000
Content-Length 640
[code]....
View 1 Replies
Mar 5, 2012
1 - SWF must have ability to loading binary data from any domain.
2 - SWF cant load policy XML file from url, cause upload form allows me only to upload swf files, so I cant include any other data.
I tried:
Security.allowDomain("*");
But it works only for SWF files.I tried to embed policy XML file:
var dataXML:XML =
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
[code]....
This will make an security error, if file is from different domain than SWF file.Its possible to get binary data from JavaScript using ExternatInterface in AS3 code.Here is cross-browser library for reading files binary: binary reader and later version jDataView.
View 4 Replies
May 5, 2009
I have a small Flash app that generates a security sandbox violation when flash.net. URLLoader() is called.I have been very careful to check for mistakes in my network/security settings, e.g., -use-network=true, cross-domain policy file, Security.allowDomain(), Security.allowInsecureDomain()
, Security.loadPolicyFile(), etc.
I have been working on this issue all day.I have read every Web page I can find on the issue to no avail.***Objective***1) Upload a SWF file, XML config file, cross-domain policy file, JPG files, [code].........
View 2 Replies
Jul 16, 2009
I use flex builder to compile a single class to load an text data from the same domain.it works perfect in IE browser. But something is wrong with the firefox browser.take a look at the following code:
[Code]....
View 2 Replies
Oct 24, 2011
I am trying to get my PHP variables from my load.php document to my flash-document.That all works fine and I am able to get my data down to flash variables inside my function.But, I would like to be able to access this data from outside of this function which gets the data - unfortunately I cant, or.. Don't know how to. I hope that you are able to shed a light upon my problem. So here goes, this is my code:
Code:
var myLoader:URLLoader = new URLLoader()
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
[code].....
View 1 Replies
Jul 23, 2009
How to retrieve xml data in an aspx page after sending it using URLLoader.load
This is the flash code i am using:
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT; //tried by giving VARIABLES also urlLoader.addEventListener(Event.COMPLETE, handleComplete);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
[Code]....
I were able to accept data in above statement when i send a string in var1 say "test". But on sending xml above error is getting.I have tried to load the xml data in XMLDocument also.
In AS20 i used sendAndLoad method to send and reterive xml data.
View 2 Replies
Nov 2, 2011
Ran into a weird Flex bug (i guess)... I am uploading using URurlLoader.load(urlRequest)... on cancel button click, urlLoader.close() is called.. but this doesnt abort the upload the file shows up on the server. Is this a Flex bug or am I missing something? Can anybody confirm if they have been able to abort an upload / load with the urlLoader.close() method call?
View 1 Replies
Jul 13, 2011
I am making rest calls with a urlload.load(urlRquest).
also
urlRequest.method = URLRequestMethod.POST;
urlRequest.contentType = "application/xml";
When I make the calls within the Flash IDE, I get HTTPStatusEvent.status = 400 (or whatever) when an error occurs. And the IOErrorEvent.data contains xml (or sometimes a string).
However, when I run the swf in a browser (Firefox Mac or PC), the HTTPStatusEvent.status = 0, and the IOErrorEvent.data is empty. (Interestingly in Safari Mac, I do get the 400 status, but still no data.)
View 1 Replies
Mar 31, 2012
Since URLLoader is async, how to make sure the order of data from server side is the same as the loader.load() call? In other words, the data order in totalResults is the same order of url-related content?
Following is code snippet:
1.for each(var url in urls) {
loadData(url);
}
2.private function loadData(url:String):void {
[Code].....
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
Aug 25, 2010
This is my code.
//width variable
var widthSize:Number;
var heightSize:Number
var TIMER_DELAY:Timer = new Timer(3000, 1); // 8 second delay
TIMER_DELAY.addEventListener(TimerEvent.TIMER, EXMove);
wedding_mc.alpha = 0
[Code]...
The way I have it with wedding(); does not work exactly like I wanted. So, how do I use onComplete to execute wedding() function after the EXMove is done? Second, my wedding_mc's width and height are linked, so, why can't I just tween only Width or Height instead of both?
View 28 Replies
Feb 13, 2012
I'm trying to use URLRequestMethod.GET to get some xml from our website.In ie7 the onComplete never fires so it gets stuck but it works great in every other browser. I know that to fix a similar problem with preloaders you change the onComplete to a ProgressEvent and check to see if bytesLoaded == bytesTotal.This doesn't seem to work for URLRequestMethod.GET because when bytesLoaded = bytesTotal it doesn't mean that you have your data. Is there another way to check to see when the data is finished?
View 7 Replies
Mar 3, 2011
if I assign an onComplete function in a TweenLite.to() call.. I can't seem to figure out how to remove the onComplete function of that tween incase I don't want it to be called for some reason..
example..
ActionScript Code:
TweenLite.to(current_slide,1,{x:0,onComplete:hideOld});
ok so i have a prev and next buttons .. and want to have it so that i can cycle through my slides (right now they overlap each other).. well with each it assigns the onComplete for that current_slide..
what i want to do is make it so that if there is a new tween for a new slide that the old current_slide doesn't call the onComplete..
so i store the old current_slide as previous_slide and then I tried to cancel the onComplete like you do other properties with killTweensOf()
this doesn't work it still gets fired..
ActionScript Code:
TweenLite.killTweensOf(previous_slide,false,{onComplete:true});
i think its cause this is only supposed to remove tweenable properties and not callback functions.. but there doesn't seem to be able to prematurely remove a onComplete function.
View 2 Replies
Nov 11, 2009
I'm trying to get onComplete (frame 5 in this case) to skip to a given frame after a series of animations. Here is what i have written so far. Shouldn't this work?
stop();
import gs.TweenMax;
import gs.plugins.*;
[code].....
View 2 Replies
Jan 10, 2012
I have an onEnterFrame function, and when the clip goes passed a certain x value, it tweens alpha to 0, and then on complete, it removes its listener and is removed from the stage ... here's the loop :::
Code:
function loop(e:Event):void
{
[code].....
View 1 Replies
Aug 6, 2009
I am trying to add an onComplete with staticRate to the (gskinners) GTween in an attempt to Optimization the SWF Framerate similar to what Lee Brimelow has done in the following project [URL] . My action script is below.
public function staticRate():void{stage.frameRate=5;}
public function animationRate():void {stage.frameRate=30;}
private function onClick(e:MouseEvent):void {trace("BUTTON: SINGLE
[Code].....
View 3 Replies