ActionScript 3.0 :: URLLoader To Access A PHP File
Jul 15, 2009
Say I'm using a URLLoader to access a PHP file.Is there some way to verify, from the PHP file, that it is Flash attempting to connect?Like, does Flash Player send some sort of unique data to the server when requesting the page that I can use to verify the integrety of the data (in order to prevent people sending data to the PHP file from any other souce)?
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.
I'm loading external logo into my SWF with following code: var request:URLRequest = new URLRequest("logo.swf");var logoloader:Loader = new Loader();logoloader.load(request);addChild(logoloader);logoloader.x = 5;logoloader.y = 5; Everything works fine as long as I have logo.swf in right place. Is there an easy way to improve that code so that it wouldn't matter if there is logo.swf, logo.png or logo.jpg as long as one of those files exists in right place? I just would like to give my clients change to use other formats than SWF if they like, because some of them doesn't have flash or any other software with SWF exporting capability. all of them have Photoshop or some other Image software....
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.
All I can find information on for the URLLoader object in Actionsript 3.0 involves loading XML files, which I don't want to do. I'm trying to load in a .txt file that I want to parse, line by line with each line being delimited by a comma. Anyone know a method of doing this or a place where I can find some information on how to do this?
does anybody have a good explanation of the as operator? On one hand it seems to me, that it is often better to use as instead of instantiating a new object.But then there are situations, when this operator let's me down. For example when loading a text file in XML format through an URLLoader:
private function completeHandler(event:Event):void { var loader:URLLoader = URLLoader(event.target); trace("completeHandler: " + loader.data);[code]...
Why do I have to use a constructor here? Why can't I say var x:XML = loader.data as XML; and save some memory?
I've made a little flash, with AS3, to view the data generated by some program I wrote... The data is in a .csv file and are loaded to the memory with a URLLoader object.
The flash loads well .csv files which can come to almost 50 MB in size... But when I try to load a file with 160 MB, the player just stop working... I run the last flash player version, outside of the browser...
I've heard that the Flash has limitations on the amount of memory it can store... But in another question, they say it has not.
What may be causing the crash? - I don't think it is the code, since it runs smooth for small files...
I am trying to download a heavy swf dynamically to my site using URLLoader class. I'd like to know if it is possible to use a symbol inside the swf as a separate object?[code]Embedding the swf increases the initial load time of my site and I want to make it dynamic. How can I access the Kungfu symbol from Fight.swf after it is downloaded using the URLLoader class?
I have a scheduling application that allows users to save any changes. When the user clicks the save button, Flex sends all the information to a coldfusion script which picks the information apart and sends saves it to the database. That all works well and good, but I would like to be able to display some sort of text to the user saying something like "Your file was successfully saved" or "There has been an error.
I've developed a preloader for an ActionScript 3 application that uses URLLoader to load an encrypted swf. This has been tested on different OSs, Flash Players and browsers and everything works as expected except for a series of PCs being used by a colleague on a corporate network. The PCs at fault use Flash Player 10.0.22.87 with IE6 on WinXP and get security sandbox error #2048 depending on the contents of the file being loaded! Some of the tests and results include:removing 99% of the contents but keeping first 6k (works)replacing contents with 4 bytes 00 (works)inserting 16 bytes: EF BB BF <html></html> at beginning of file (works)inserting 16 0s at the beginning of the file (fails)xor FF all bytes (fails)I've tried other tests such as different file extensions, Security.allowDomain(ť), crossdomain.xml, Security.loadPolicyFile(¦), dataFormat = URLLoaderData Format.BINARY etc but I think these are all irrelevant due to the fact that the app sometimes works.The code is just the standard new URLLoader(), adding event listeners, then calling load(new URLRequest(¦)). The test app doesn't include the loadBytes() so this isn't the issue either.
The PC at fault could be behind a firewall or using a proxy. At this stage my only theory is that their antivirus, firewall or proxy is examining the contents and sometimes decides to intervene, perhaps with a redirect. This would also explain why (according to the web server logs) the files are being requested even though the security sandbox error is generated. However, this does not explain why Flash generates the error in the first place, depending on the contents.It's not possible for me to visit on site or get them to modify their settings or configuration, but I can ask them to run various Flash Apps for testing.URL...I can come up with a workaround (such as ensuring the file always starts with dummy <html> tags and then strip them before decrypting), but I'd prefer to get to the bottom of this issue if possible to be confident it won't occur again; this is for a Facebook application so it's possible it will be used in a large variety of environment
I have run into a problem with the URLLoader that I havent encountered before. I have reviewed my code several times and maybe I am missing something.
Basically, I have a separate loader class that I want to communicate to a php file located in the same directory. That php file forms an xml markup within and returns the location of a background image from the database. As you can see from the code, I have event listeners for progress, loaded, and IOerror.
This works fine in IE and Chrome. However in FF and Opera, my custom progress bar shows 100%, but the info bar shows "IO Error" (which is kind of a visible trace statement on the swf for informational purposes) and it does not go anywhere.
I am trying to load an external text file but keep receiving the following error message:
Code: Select allTypeError: Error #2007: Parameter url must be non-null. at flash.net::URLStream/load() at flash.net::URLLoader/load() at lee.dataload::TextLoader()
this is the code i'm using, i'm very new to actionscript so it's probably loaded with errors:
I am wondering if it is possible to use random file access for reading and writing data to file in Actionscipt 3.0 similar to that what is in Visual Basic?
I have basic knowledge of Flash and AS3.0. Suppose i have a flash swf file(main.swf). In this main.swf file, i loaded another swf file(sub.swf) by writing the following code snippet in main.swf file as shown below:
var textLdr:Loader=new Loader(); var noteUrl:String = "AddNote.swf"; var noteUrlReq:URLRequest=new URLRequest(noteUrl); textLdr.load(noteUrlReq); addChild(textLdr);
Now, how to acess the data present in main.swf into sub.swf.Note: Here data represents values/data stored in variables/objects of main.swf file.
i have a function(initialize) inside the a.as File.i want to access the that Variable from aaa.fla file?.How Can i access the Variable?my main class is a.as file ,inside a.as file i load the aaa.swf file
public function initialize(parameters:Object, stage:Stage, loaderInfo:LoaderInfo, pluginHostWhitelist:Array):void { sourceId=loaderInfo.parameters.src;
[code]....
My aaa.fla Its in Another place
import fl.motion.ColorMatrix; import flash.filters.ColorMatrixFilter; var sourceId:String// here i want to access the "sourceid" variable from a.as file trace(sourceId)
i have a function inside the a.as File.i want to access the that Variable from a.fla file?Both are Different places.But i load the a.swf into a.as.How Can i access the Variable?
ActionScript Code: function initialize(parameters:Object, stage:Stage, loaderInfo:LoaderInfo, pluginHostWhitelist:Array):void {
I have the need to change a variable in a child Flash file.
The setup is a parent Flash file, that has called a child Flash, and placed it in a movieClip.
I can send a variable using Javascript to the parent Flash file, but not directly to the child Flash file. Is there a way that I can access the child Flash file directly with Javascript?
Or do I need to send the variable to the parent Flash file, and then have the parent send the variable to the child Flash file? Is there a sort of dot notation that I can use with Javascript to get to the child Flash file without first accessing the parent, when the child is added to the parent using the loadClip function in flash?
We have a swf file that we want to secure and make available only to authorized users.
I embedded the file in an aspx page and that works fine, since ASP.NET handles the aspx page, I can use ASP.NET authorization features and in the web.config restrict the access to roles="AllowedUsers" for example.
However smart users could still get to the file by accessing directly for example www.mysite/flash.swf. We want to make that kind of access secure.
I need a bit of assistance in a game making.Basically ve got the mysteryNumber inside thefunction working but I need functions in the other ActionScript files to access themysteryNumbe.So basically I have a:
Main.as (with the mysteryNumber function) function init():void {
I wrote a custom class and I need it to change the attributes of movie clip for me, not sure how the syntax goes, this is what I thought was right, but om a newbie:
Typing either localhost or 127.0.0.1 in any browser on a Macintosh (os 10.5) does not give access to the host computer.The following Actionscript code generates the following error:
var XMLURL:URLRequest = new URLRequest("http://localhost/quoteRotator/quotes1.xml"); Error opening URL 'http://localhost/quoteRotator/quotes1.xml' Error #2044: Unhandled io error . . .
I have two flash files myVideo1.swf and myVideo2.swf Each one contents FLVPLAYBack component . myVideo1.swf FLVPLAYBack component instance name is "video1" myVideo2.swf FLVPLAYBack component instance name is "video2" I want to be able to access myVideo2.swf from myVideo1.swf using as3. I want when I click play button on myVideo2.swf the myVideo1.swf would stopped. Bother flash files are in the same folder.
Having some issues accessing my param tags from within actionscript. Essentially I have the following tag:
<param name="config" value="config" />
But I am unable to access it. There are two issues that I have, and I've been searching the internet high and low for the answers.
1) How do I even access the parameter? I have some people saying use _root.config, LoaderInfo(this.root.loaderInfo).parameters["config"], and just config. None work, and searching for this stuff is so hard because it's so generic.
2) I assume that once I do find out how to access the param that is being passed, I'm going to have issues with accessing it from another file because I read somewhere during my searching that other files do not have access to global variables. If this is the case, how do I do that? I have seen _globals thrown around a couple of times and some people say it works, some don't.
I have two flash files myVideo1.swf and myVideo2.swf Each one contents FLVPLAYBack component . myVideo1.swf FLVPLAYBack component instance name is "video1" myVideo2.swf FLVPLAYBack component instance name is "video2" I want to be able to access myVideo2.swf from myVideo1.swf using as3. I want when I click play button on myVideo2.swf the myVideo1.swf would stopped. Bother flash files are in the same folder.