ActionScript 3.0 :: AIR - What Is The Fastest Way To Load A .png
Sep 19, 2009
I'm trying to figure out the fastest possible way to load a .png image into a BitmapData object. I am performing multiple processes that do this (load a .png from filesystem). The progress is shown using a loading bar, and I would like to speed up the loading time. Now this process can be called over n number times (via a timer). Right now the method I am using to this is:
[Code]...
View 4 Replies
Similar Posts:
Sep 14, 2009
I have searched google for an answer to my problem, but to no results have helped me to solve it. I am trying to find the fastest possible way to load an external .png (as the title suggests). The reason for this is because I want to speed up the loading time of my Adobe Air Application. It loads in a various number of .png files (with transparency) and displays them in a tilelist via Bitmap.
[Code]...
View 4 Replies
Jan 14, 2011
I have the following function in my FogOfWar class, it calculates if its team can see the position that is passed on the arguments:[code]My problem is that, with only 3 characters in the game, it can only run 4000 times per second, which is not too much.I can implement a cache, so it caches the most commons positions, but, what else can I do to optimize it?
View 2 Replies
May 24, 2011
The question is simple; I need the fastest way to calculate power 2. I need that for this formula which calculates distance between 2 points.var Dist:int = Math.sqrt( (mmx - ox) * (mmx - ox) + (mmy - oy) * (mmy - oy) );
View 2 Replies
Jul 14, 2009
What is the fastest and most efficient way to get RGBA from an image you don't want to display?
I don't care if it uses air or is backwards compatible with a previous version of the player.
Should I be using file io and reading in the bytes and writing my own parser?
Maybe loadBitmap and getPixel?
Are there certain tricks and optimizations to prevent excess work on the player's side?
View 3 Replies
Mar 8, 2010
I have two Sets. Set b is the subset of Set a. they're both very huge Sets. I want to subtract b from a , what's the best practice to do this common operation? I've written to many codes like this , and I don't think it's efficient.
[Code]...
View 7 Replies
Jun 10, 2011
Is there any Fastest way for this line?
ballAngelRadianVector = -ballAngelRadianVector;
And also this:
ballDegree = fee - ballDegree ;
View 1 Replies
Sep 22, 2011
This code calculates the distance between 2 points by using distance formula, Math.sqrt ( (x1 - x2)^2 + (y1 - y2) ^2). My first point has mmx and mmy coordination and second one has ox and oy coordination. My question is simple, is there any FASTER way for calculate this?
[Code]...
View 3 Replies
Dec 10, 2011
Im using a lot of movieclips in an app.Its hitting the performance limits.Im using .png files in animated movieclips.Looking in the clip it says bitmap as type.. source...pngI used .png because i want the alpha background possibility.I then went into some of the movieclips and changed properties convert to bitmap (althoug technicly they already were according to flash)After this i feel the performance has slightly improved.Is this true or just in my mind & wishfull thinking.
View 3 Replies
Apr 12, 2011
I need to know the best method to find an item inside a list (Vector, Array, Dictionary, whatever is faster) of complex type (extensions of Objects and Sprites). I've used "Needle in Haystack" method, but it seems that it isn't fast enough.
E.g. Suppose that I have a collection of Sprites (a pool, in fact). Each sprite will be added to the stage and perform some action. After that, it will die. I don't want to pay the cost to dispose it (garbage collect) and create another (new) one every time so I'll keep the dead sprites in a collection.
Sometimes times I'll call a method that will add a sprite to the stage. This sprite can be a old one, if it is already dead, or a new one, if the pool don't have any free sprite.
One of the scenarios that pushed me to this question was a Particle System. A "head" particle leaving a "trail" of particles every frame and exploding into a flashy multitude of particles... Every frame...
Some times this counts up to 50.000 PNGs with motion, rotation, alpha, event dispatching, scale, etc... But, this is JUST ONE scenario...
At the moment I'm trying to use a Object Pool with a Linked List... Hopes that it will be faster that running a whole Array/Vector or create new instances every frame an let them dye with Garbage Collection.
View 6 Replies
Mar 15, 2011
how to deal with unsorted arrays to get the next higher or next smaller value?
var _myArray:Array = (1,pizza,2,6,8,test,11,16,17,cola)
_myArray.splice(4,1) // > remove number 8 !
trace(_myArray) // > array contains now: (1,pizza,2,6,test,11,16,17,cola)
how can i get the next higher value (= 11) ?
View 2 Replies
Jul 19, 2010
I've got my 3D sphere to triangle collision detection working now, but I need an efficient method of adding the triangles to the broadphase grid.
This is easy enough if the triangles are smaller than the grid nodes, however - especially given the polycounts I'm working with - it's going to be fairly frequent that a triangle is significantly larger than the grid nodes.
Here's an example.See the yellow polygon? Just adding it the grid nodes by it's vertices results in it NOT being added to 4 grid nodes that it does reside in.
My first thought is repeatedly casting rays along one of the edges from the normal of the edge until you find the intersection point with one of the other edges, of course checking for intersections with the grid edges until you reach the destination intersection with one of the other edges of the triangle. This would work, but is not particularly fast.
Although these triangles aren't being added/removed in real time, only when building the level, when constructing a level with say 100,000 polygons total, I obviously want it to be processed as quickly as possible.
View 14 Replies
Sep 26, 2011
I'm trying to write a function where I can specify any amount of array, and the return value will be an array containing the contents of all of the specified arrays.I've done this, but it seems like a really slow and ugly way of doing it:
var ar1:Array = [1,2,3,4,5,6,7,8,9];
var ar2:Array = ['a','b','c','d','e','f','g','h'];
function merge(...multi):Array[code].....
Is there an inbuilt and more efficient / nice way of achieving this? The result does not need to be in the same order as the input - completely unsorted is fine.
View 3 Replies
Sep 7, 2008
I'm loading a background into a background container with the following code:
loadMovie("backgrounds/bkg_wht.swf",bgContainer);
I'd like it to load in a 4 second alpha fading load instead of just a hard load. Any ideas what code I need to write?
View 3 Replies
Jun 2, 2010
I am working with a project that has many scenes. Each scene has a movie clip attached to it. The first scene is simple...just a couple of buttons and that is it. My worry is that when I add all of the videos that correspond with each button and publish the SWF will be a huge file. THE QUESTION: Does flash load ALL scenes of a movie or does it load the first scene and then load the other scenes when the user needs to view them?
My ultimate goal is to just have the first scene load and then when the user clicks on the buttons contained within that scene that only upon release does the corresponding scene load. Maybe I am doing this completely wrong and should look at doing it another way.
View 6 Replies
Jul 16, 2009
I have a rotaing menu that loads in images from an xml file, I would also like it to load in text info from the same xml file to the left side of the images that load in. In my main .fla have created a movieclip and called it 'textInfo' and inside that I have two dynamic text fields called 'headerText' and 'bodyText' where I want to load the text in. this is what I am using to loading in the text in my actionscript, is this correct?
[Code]...
View 22 Replies
Jan 25, 2010
I'm using loadMovie() to load external swf's and then send the swf to a specific frame, depending on the button that is pressed.
Code:
on(release){
_root.mc_mainloader.loadMovie("Main.swf")
_root.mc_mainloader.gotoAndPlay("fadeup");
}
Unfortunately it ignores the second line, which appears to be because the movie hasn't loaded by time it gets to the next line. As a work-around I made an interval to check for the movieclip width to be more than 0 and then run a function that chooses the desired frame, but this is very unreliable. Is there a simple way to load the clip and wait until it is finished, then immediately choose a frame on load?
View 4 Replies
May 6, 2011
I have a Flex application that just load an external SWF, but the application load and unload infinitely my swf.
[Code]...
View 2 Replies
Jun 7, 2005
Is there a way of making a normal loadVars.load load a url depending on a variable you set in the swf?
var reciever = new LoadVars();
loadurl = "test_onload_3.cfm?propertyID="+MY_VARIABLE_GOES_HERE;
reciever.load(loadurl);
so that I can set my variable and then load the variables with the propertyID that I choose in the swf??
View 4 Replies
May 3, 2008
The function below belongs to an XML based photoGallery.swf... Its menu is automatically populated from the same XML file as well (thumbnail picture, title, description). The pictures load into an empty mc called imageContainer.In another empty mc called textContainer, I would like to load some text.swf from the xml list as well.How would you include that in the code?
Code:
function loadTmbs () {
var tmbs:XML = new XML ();[code]......
View 2 Replies
Jul 27, 2009
So I have this flash app I'm making that uses a URL load to load a bunch of plot points from an address. When the loader finishes, it send the data to a plotter function. the plotter function clears the graphics in a shape called graphLine. It then draws a line from one plot point to another using the lineTo function. Basically every 3 seconds it makes this request and redraws the screen and updates the value of a textfield to the current y value. In flex builder 3, it works great in debug mode. The screen updates just fine. However, when I make the release build and test it out in a browser, it loads the data fine, but will not draw it until I stop the graphing process. Any thoughts on this one? Here's the code for the graphing function
[Code]...
View 2 Replies
Apr 2, 2009
I am pulling double duty with this question as it serves two purposes. I am developing a total flash controlled ad system for myself, but also need to use the same theory for a project for work.
Concept: I have a main movie (ad rotator system) that I then want to randomly load other swf's (individual ads) into this main swf after a set period of time. The random load I got set no problem. The problem I am having is to get it to move to the new Frame label of the main movie which then loads the smaller swfs. I am using the LoadMovie with nInterval time delay command in flash to load the movies.
[Code]....
View 5 Replies
Mar 16, 2011
I'm pretty new/bad at actionscript (3) for web. I have a site up for a client/friend [URL], but it takes FOREVER to load. I'm under the impression that a good way to make the site load faster is to load in swf's externally. Right now, the site, in its entirety, is one big movieclip. I have large images (movieclips) for background images. If you look at the site and are kind enough to wait for it to load (aprox. 45 seconds or so) you will notice how the background image changes when you click to go to each section.
I am trying to find a way to load in the background as external .swf's to cut down on the initial load time. I'm also open to any other ideas. Below is the as3 code for my buttons/how they direct the site. I'm hoping to use a similar/generic style to load the background images. I'm hoping to load the movieclips underneath the rest of the site, and use the same naming scheme (e.g. homeBTN.swf) to keep it organized.
[Code]...
View 3 Replies
Nov 19, 2009
An IE issue has me completely stumped. I have a coldfusion page that uses JQuery's AJAX .load function to load in a new flash file that is generated by coldFusion's cfchart tag. This works completely fine in firefox: the new flash file and new html elements load. However in IE: all of the html elements that are geneated with the flash object are loaded, except the flash object and embed tags do not show up at all after running an ajax call in IE. After looking in Fiddler, the flash application type response data doesnt even show up for IE. It does however for Firefox.I thought maybe it has to do with any kind of media, so i changed the chart type to output as a jpg file instead of flash. And it loads completely fine in IE. So something is preventing IE from receiving the flash response data.Here's what i've done so far - and no luck so far:
Added to the HTML header: <META
HTTP-EQUIV="CACHE-CONTROL"
CONTENT="NO-CACHE"><META
[code]....
View 2 Replies
Feb 19, 2010
I have a page that loads loads of swfs*. I'm loading in them all at the same time, Sequentially which is slowing down the intro animation. Is there a way to load swfs sequentially? Or if not load them on a timer (half a sec would do the trick I think)
*there lots of different dynamically generated Flex graphs so it's not possible to have them all in one.
[Code]...
View 2 Replies
Mar 2, 2007
I'm currently working on a project that contains a lot of data, about 14.000 records. This means an xml file of about 3mb. Now my question is: Should I use the xml file to load all the data at once, or should I use a webservice, that provides the data when I need it? Keep in mind that I'm new to webservices. And if I'm going to use a webservice: How do I store the data, in a mySQL database?How fast is a webservice?
View 1 Replies
Mar 24, 2009
I have a little app that can read and write content that is stored in XML files. As those files get updated and re-loaded quite often I have made the experience that the browser tends to use the old/cached XML-data. Can I somehow flag the URLLoader that I use to load the XML to always load the actual file instead of looking for cached versions?
View 4 Replies
Sep 18, 2009
I am stumped. I have tried to load a comboBox with a for-loop to load k school names and can not get it to load dynamically. Here is what works:schools_cb.addItem({label:varLoad.data.school1});It manages to paste the name of school1 into the comboBox k times.Then, when I try:schools_cb.addItem({label:this["varLoad.data.school" + k]});orschools_cb.addItem({label:this.getChildByName("var Load.data.school" + k)});it brings up k blank entries in the comboBox.I am a poor teacher trying to make a signup page for our school's math contest
View 5 Replies
Mar 7, 2011
I need some help? Anyone experience this problem before with IE8 FLASH bug? Can not get this to work on all subsequent refresh to the flash. I have a flash piece which simply renders only on the first initial load. After that, if i refresh or visit the page, it does not load correctly. It seems I am having this problem with the swf only on subsequent loading of the page or whenever a refresh happens.
View 1 Replies
Jul 13, 2009
I am trying to load, unload and load again the same movie clip from library.
View 7 Replies