Actionscript 3.0 :: Know How Much Kb In Data Loader?
Feb 1, 2009
i was folowing the tutorial here about amfphp and loading mysql data, this worked very good. But i was wondering, is their a way to know how much kb in data u are loader?
Like the bytesTotal and bytesLoaded with a Loader / URLLoader?
I am new to action script 3.0. o understand how can I load data with URLLoader.So, I have an aplication like:
var PATH:String = "http://www.somesite.com/myFirstPage.php?a=10&b=20"; var urlRequest:URLRequest = new URLRequest(PATH); var urlLoader:URLLoader = new URLLoader();
I have a problem with connecting as3 with php. I get the data return from php is wrong. This is my code AS3: var file:String="test.php"; // Define global variable function GetXMLfile(){ var loaderphp:URLLoader=new URLLoader(); var urlRequest1:URLRequest = new URLRequest(file); loaderphp.addEventListener(Event.COMPLETE, GetCharInfo); [Code] .....
Code: var Slice1:Sprite = new Sprite(); Slice1.addChild(evt.target.loader); var Slice2:Sprite = new Sprite(); Slice2.addChild(evt.target.loader);
I found out the hard way what happens when you and the same object to multiple parents (it packs up, and moves out).So what is the work around for this, besides multiple loaders? LoaderMax? My evt.target.loader is an image. So maybe bitmap data?
I am having a bit of an issue with my traces not working. Basically I have 4 loaders that loads up XML data and displays it for it to be checked. My issue is that the first two traces work for the first two loaders but the last two traces do not work. Usually I get a 1009 error if I try to dig into the data.[code]...
Why this does not work?...It should send and load Vars but it does not even trigger when complete... var postVars:URLVariables = new URLVariables(); postVars.userId='cat'; postVars.folderId='dog'; var request:URLRequest = new URLRequest(); [Code] .....
I'm having troubles accessing the data loaded by external class.[code]...
Now, I want to create another external class (called MainMenu) that will be initiated from the Main class.This class should create the menu based on the loaded XML class.
My question is, how can I make use of the loaded XML content via XMLLoader class within the MainMenu class?
I am calling some data from php, which simply retrieves some data from MySQL. The tables retrieved are called dynamically and so I have a list of those tables sent to actionscript below and called by event.target.data.its and event.target.data.ces. These will have a list of the tables called. I then send the name/value pairs to actionscript from php by using those table names (all inside of php here) dynamically.
I have been working on a flex application with java, as i have used Life Cycle Data Service for communication, i wana know, is there any function of flex, where i can see the loading status in percentage, that how much record is being loaded.Problem is, if there is lengthy record, no body comes to know, whats happening with software, like in Comboboxes or Grids, users usually think it as a BUG in application, but ofcourse it is not.I need such graphical loader, which keeps on loading with proper status in percentage, until it receives all data from JAVA (SQL Server).
Trying to make a grid based question answer game and load variables from a text file using for loops into an array. I wanted to reduce redundant code and use for loops to populate my arrays. The issue I am having is with my arrays being lost/destroyed outside of the loader function.
I understand that if an array is declared inside the function, naturally the array would be destroyed upon exit of the function. However I am declaring the arrays outside of the function so the arrays should remain intact after I exit the function.
BTW - I'm not having an issue with the loading of the data. The data is loading correctly. The array is simply being destroyed after the data has loaded.
//Create the arrays to hold the //categories, questions, and answers var categoryArray:Array = new Array(); var quesAnswArray:Array = new Array();
I'm building a simple flash webpage using as3 in order to get accustomed to it. I've got some code for a preloader which, the end result works fine,but I cannot get the preloader assets to update with the loader data.To put it simply, I cannot get the code to update my text field that would display the percent done text.It only shows at 100 when it should go 1, 2, 3, 4...etc.Also I cannot get the bar_mc (just a simple bar graphic) to scale along with the percent loaded.
Code: function handleLoadProgress(e:ProgressEvent):void { while (percentDone < 100) { totalBytes = loaderInfo.bytesTotal;[code]....
I'm making a card game and each card has a certain symbol on it which is loaded from an external .png file. I don't want to make it so that it has to load the .png every time it make a card, so I made it load in the preloader/background. How do I make new objects that looks the same as the loader, like copying the loader's data or something?
So I am trying to load variables from a .php file into a movie clip and then plug in those variables to various fields and for some reason its not working...so heres whats going on...(this is for the staff page for my church)
We are loading the variables into the movie clip which contains our various fields...the value for staffID is created in the previous frame when the user click on that person's icon, we know for sure that this is being passed correctly to this frame, because I have a text box in the main timeline which displays the number.
The resulting string from the .php file looks like this...
Within the movie clip that the variables are being loaded into we have this....it loops till the var load is done and then writes the information to the fields...
while (L ne "stop"){ if (staffNameE ne ""){ staffName = staffNameE;
So I am trying to load variables from a .php file into amovie clip and then plug in those variables to various fields andfor some reason its not working...so heres whats going on...(thisis for the staff page for my church) (and yes I have read theutorials :P )In the primary timeline we have this line...
We are loading the variables into the movie clip whichcontains our various fields...the value for staffID is created inthe previous frame when the user click on that person's icon, weknow for sure that this is being passed correctly to this frame,
I want to end any previous data loading progresses.. But I can't manage to do this. I tried lots of things (as you can see couple of them below), but it just can't stop downloading of images. I click to first gallery button, it starts to download thumbs and the first picture. Then I click to second gallery button and it adds more download progress to the previous ones.. (Every gallery has 4 thumb, this way every click adds 4 thumb and 1 picture. It's download count grows 5+5+5 to infinite) This code is from my thumb class.. Every thumb downloads it's own little image..
I have an arbitrary number of files that I need to load in an AIR app.I want to iterate through an array of File object and create and launch Loaders for each one's File.url.When they are done (event COMPLETED or IOErrorEvent.IO_ERROR), I want to stuff their data somewhere. If they fail, I want to make an exception report. I cannot find any way to reference the File object from the event listener (certainly not the IO_ERROR)The best way would be to create individual event handlers for each Launcher that had the File information "hard-coded" into it. At the very least, I could use the function itself as an index to a Dictionary:
foo(fileToLoad : File) : void { var theCompletedHandler : Function = {
[code]....
Can I use event.currentTaget and use the Loader instance as an index? Will that have any weird dependencies ?
I have two swf files, each one almost with the same classes, the most important one is a Singleton class, each swf does "singleton.getInstance()". The diference is that one swf is like a container and the other one is like a module. So when the container loads the module from an absolute path like loader.load("file://c:/modules/module.swf") or loader.load("[URL]"), two different singletons (same class) are created
But when the container loads from a relative path like loader.load("module.swf") , just one singleton is created (that is what I want) I am just intrigued with this behavior, could someone explain me this? PD: I believe is something related to loaderContext and applicationDomain but It also appears that isn't working right. -Patricio Foieri , Vertigo Labs
The title describes the problem: Loader.load() is firing the INIT event, but in my listener it's reporting loader.content as null. The description for INIT event is "Dispatched by the associated LoaderInfo object when the properties and methods of the loaded SWF file are accessible."I'm loading a lot of JPG images, and 95 percent of the time it works fine; the init listener fires and reports valid loader. content.I absolutely need loader.content available because I need to set the bitmap smoothing property to true.I've tried using Event.COMPLETE and it has the exact same problematic behavior.
I'm feeling a bit low now as I have been suffering this for months. A simple loader loads my simple game and runs VERY FAST on even slow pcs BUT when I build this other loader, it goes quite slowly and I don't know where the app is going wrong. WHERE is the processing consumptoin coming from out of my app.
I have the following code which simply loads an external swf, puts it in the right place and should all be hunky dory.This works:
Code: var myLoader:Loader = new Loader(); addChild(myLoader); var url:URLRequest=new URLRequest("foobar.swf");[code].....
to set the dimensions of the loader so the external swf doesn't 'spill over', the result is a blank screen. No matter how high I set those dimensions it just doesn't display anything.
I got this very strange behavior from FlashPlayer debugger 10.1 r82. When I call loader.load method, no ADDED event is dispatched to the loader object. But if I open the file and call loader.loadBytes instead, an ADDED event is dispatched to the loader object. I suspect the ADDED event is dispatched because the content is being set as the child of Loader object, but why in the other case it is not dispatched?
the file loads correctly but the loading screen only flashes up at the end.The only thing being exported in frame 1 is the loader image, and that is extremely small.Is it possible that there's a queue of things being loaded and the loader image is at the bottom of that queue? Since that was one of the last things added to the project
i have a main loader swf file called loader.swf and it loads an RSL.swf (runtime shared library for my swf files) and then 10 swf files, each one to a container (fE.: movieclip '01' in loader.swf, then movieclip '02' and so on). the 10 swf files have a lot of references to RSL.swf, and i have to use RSL.the problem is when loader.swf loads the RSL and the other 10 swfs the loader throws errors like this:
Code: *** Security Sandbox Violation ***[code]...
then i put in EVERY swf files (loader,RSL and the other 10) the code Security.allowDomain ("*") but throws the same errors...
I'm loading some images with Loaders, cloning the BitmapData to a new Bitmap, and adding the Bitmap as a child of a Sprite. So far, so good. I want the Loaders I'm using to be removed by garbage collection, which they seem to be. The problem, or so it seems, is that when the Loaders are cleaned up, the Bitmaps I'm creating lose their data.
Edit: All this is happening when a class is instanced, and many copies of this class are being used as actors in a game. As the Actors are being created the older ones are losing their BitmapData to garbage cleanup. When all of them are finally loaded, only the last few are visible. I've rewritten my posted code as a class. If I prevent the Loaders from being cleaned up by somehow keeping a reference to them, the Bitmaps don't lose the data, but I don't want these Loaders hanging around.
I am attempting to load multiple images in AS3 and I'm exploring different options on how this can be done.I would like to have to only use one Load() instance and handle the various image assignments in the onComplete handler...here is my first attempt:
var buttonLdr:Loader = new Loader(); buttonLdr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); buttonLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadCo