ActionScript 2.0 :: Handling External Images In Memory

Nov 7, 2006

I'm using the Flash 9 AS3 Public Alpha IDE. I'm loading a suite of 256 external png images using the Loader class. There are multiple "suites" of these images, but once the .swf starts and a couple of settings are loaded, only one of the suites actually needs to be loaded for that session. Only a small handful of these images are displayed at a time, but this handful changed rapidly. Images are quickly loaded, animated, unloaded, etc. Currently I'm using the Loader class to load the images whenever I need them and then I remove them from memory when I'm done. Because they are used so often, and without much forewarning before they become needed, this solution is no longer effective.

If I place all of these images in the Library and setup their linkage properties individually, everything works fast and efficient loading them with getDefinitionByName, but this is not practical to have to recompile my .swf file everytime the images change (not to mention setting up the linkage for 256 images is very tedious). The other complication is that multiple classes that are not directly connected with each other need access to these images, which means the images need to have some sort of global access (like they with getDefinitionByName). most effecient way to load all 256 images into memory and then give them global access to be *quickly* reproduced, duplicated, multiplied and animated by any class?

View 1 Replies


Similar Posts:


ActionScript 1/2 :: Loading External Images Causes Memory Leak?

Aug 8, 2011

I have been working on an Actionscript 2.0 project that basically loads external images.Everytime i load and unload a new image, memory increases to 1 or 2 MBsIf all the images are in cache, then it increased to 4 or 8 KBsIn the unloading of images, I have removed loader and the container of the image.

////////////btn_load.onRelease = function(){ loadImage();}btn_unLoad.onRelease = function(){ unLoadImage();}var mcListener:Object = new Object();var container1:MovieClip;var mcLoader:MovieClipLoader;var loader_reference = this;var n=0;function loadImage(){ var image_arr = ["http://xyz.com/image1.png","http://xyz.com/image2.png","http://xyz.com [code]...

View 1 Replies

Actionscript 3.0 :: Memory Handling - Crossfading Loaded Swfs?

Mar 15, 2010

I have a huge memory handling headache in a project I am working on. This is basically what the program does. I have a main shell swf that loads a xml document. This xml document points to a interface swf and many content swfs. The interface swf has my container, buttons, and preloader. The content swfs holds images, audio, and other interactions.

My shell loads a content swf and adds it to a container movieclip with in the interface swf. When a new content swf is loaded, it needs to crossfade on to the old swf.Each content swf is set up as such: all of the content is in a movieclip that is exported on frame 1. There is also a large string of text that sits on frame one that is loaded into the interface swf.

1 . I can't figure out how to load / unload the swfs to set them up for garbage collection while still crossfading them when they load.

2 . When I built a test to see if the swfs would unload correctly, It would not unload any bitmap data within the swfs.

My current code is below. This works fine functionality wise but nothing is removed from the memory. I can't figure out how to add an unload script without breaking the crossfade.

Code: Select allvar slide:MovieClip=null;
var isLoading:Boolean=false;
//buildSlide is passed a content swfs url

[code]....

View 1 Replies

ActionScript 3.0 :: Method Of Handling Galleries Of Images?

Jul 13, 2010

I am working on a Flash/AS3 site used to view galleries of images. When the site is loaded, it loads an external XML document which contains the relevant information. An example of the XML looks like this:

[Code]...

I am fairly isolated from any sort of programming community (aside of course from this website and some others) and am curious if this is a reasonable method to manage externally loaded data?Are there other methods that could be recommended?The above functions are wrapped inside of a class of their own. I just pulled them out for the example.

View 2 Replies

Flash - Handling External Functions Files In CS5?

Mar 14, 2011

I was told recently by a Flash developer that I respect that using

include "functions_file.as";

is not the appropriate way to import a list of functions into an AS3, Flash CS5 document.We're not talking about objects and packages, just a list of functions.

View 2 Replies

ActionScript 3.0 :: Unloading Images From Memory?

Jan 31, 2011

I want to make this VERY SIMPLE image gallery, and i'm just using this code:

var i =new Loader();
i.load(new URLRequest("imagens/1.jpg"));
galeria.addChild(i)

I change images just with a button that tells to go to a different keyframe with a new code, like this:

i.load(new URLRequest("imagens/2.jpg"));
galeria.addChild(i)
i.load(new URLRequest("imagens/3.jpg"));
galeria.addChild(i)

The problem is... when I check the Task Manager the memory usage of the Flash player keeps going up and up without reducing everytime I click the "Next image" or "Previous Image" buttons. Even when loading the same image.I tryed many things to "unload" the image from the memory but none of them worked...

View 1 Replies

ActionScript 2.0 :: Handling Exceptions When External Data Doesn't Load

Sep 23, 2010

I'm loading external data from a txt file into a MovieClip. It contains data that is crucial to the presentation viewing. It is necessary to load, not right away but at some point (the sooner the better). When the txt is on the same server it works instantly, but I'm loading data from another server.

Two problems: the onLoad code is stuck if the file doesn't load (connection problem, server down?) and in offline mode what happens if the data is purged out of browsers cache (history problem)?

How can i handle these exceptions?

1. Some code that uses a "timer" to periodically try to load the data again if the connection is slow and the txt doesn't loads the first time?

2. When it doesn't load at all, and the onLoad fails, how can I simulate notOnLoad - exception for data download fail? And retry the dataLoad?

I've already made cross-server data loading possible using crossdomain.xml policy.

The site is still in development. This problem occurred when the server which contains the data.txt was down due to maintenance, and when one of the test-visitors was downloading so much in the background that his connection didn't had enough bandwidth to load data correctly (browser thought he had connection problems).

View 3 Replies

Actionscript 3 :: Loading Images In Flex Cause Memory To Go Way Up?

Jun 29, 2009

Loading images into Flex (size < 100kb) causes IE7 memory increase by a megabyte per image. What's going on here? Here is the code I have -- this for each image:

[Code]...

View 3 Replies

ActionScript 3.0 :: Loading Images Takes Up Too Much Memory?

Jul 1, 2009

I am working on an application, using Flash CS3 + AIR, that involves some heavy content loading. I need to fetch some 140 gif files each around 400x400 in resolution and 50KB in size and display them in a TileList. The code that I am using is pretty standard stuff, (excerpts from the cellrenderer of my TileList):

[Code]...

View 2 Replies

ActionScript 3.0 :: Removing Images From Memory In A Loop

Aug 14, 2009

I've made a script which loads in, at intervals, images in a sequence (image1.jpg, image2.jpg ). However I've being doing my nut as to how to remove the preceeding image from memory as looking a the Windows Task Manager, each image gets added again and again, accumulating memory usage. I've tried removeChild, and null; stuff, but to no avail.I want it to go through the 10 images, and with each step to the next image, remove the last one from memory.[code]

View 2 Replies

ActionScript 2.0 :: Creating A High Score Table In Flash Using External File Handling

Feb 8, 2012

Creating a high score table in flash, using external file handling, can be achieved using server-side scripts, such as PHP. However, as this is not allowed for my game (school project), I need a way to write a few variables directly to a text file and read it back again. Is this possible? I am using AS 2.0. Any other ways in which a high score table, which is portable and can be saved and updated

View 3 Replies

Actionscript 3 :: How To Reduce Memory Usages While Loading Sprite Sequences Of Images

Jun 7, 2011

I've made a *.swf file of the sprite sequences of 1000 images with (780 x 480) size. After that I embed this with another one class to show but every time it crushes during run time because of insufficient memory (assume that I have 2GB memory space). Which is the best way to implement such big sprite sequences in AS3 by avoiding the memory problem?

View 3 Replies

ActionScript 3.0 :: Keeping External SWF In Memory

Feb 22, 2011

So I am loading external swf's. These swfs contain a 16 frame image sequence on the stage. When I load the swf's and go to each frame via actionscript, they load into memory and they play fast and smoothly. If they sit on a single frame for a certain amount of time, the rest of the frames are dumped from memory and the image sequence plays slow again until each frame is displayed and stored in memory again. I really want to keep all the frames of these timelines in memory until I choose to unload the swf's manually.

View 1 Replies

ActionScript 3.0 :: Load External SWF Memory Usage?

May 4, 2009

Did a website, but at the end of it... i needed to translate everything So I simply made a duplicate translated all the text, and added a button on each that will jump between the languages. Button added to main stage. Inside button on DOWN action:

if (MovieClip(parent).mainContainer.numChildren!=0)
MovieClip(parent).mainContainer.removeChildAt(0);
var ii:int=parent.numChildren-1;
trace(ii);

[code]...

I have tried to remove all children from the stage, but then upon loading, I get an error; looks like I removed the stage,timeline etc. So I had to leave the parent.numChildren at -1 to leave the mainContainer (but clean it inside). It works, but now Firefox memory increases each time I click on the Language Change button:

126K
208 K
288.5K
369.7K
450.0K

EDIT: The line stage.addChild() creates error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at final_webMon_fla::MainTimeline/frame1()

View 3 Replies

ActionScript 3.0 :: Remove External Swf Completely From Memory?

Dec 10, 2011

I have read many many post and I don't find the answer of how to remove completely a swf load external.Every time I load and unload I see the windows memory task manager and see that the memory increase and don't reduce when remove child.

this is my code:
var oneLoader=new Loader();
bt1.addEventListener(MouseEvent.CLICK, swf1);

[code]......

View 7 Replies

ActionScript 3.0 :: Flash Memory And How To Deal With External Swf?

Jul 23, 2009

I'm currently building a website that contain different game. each game is an external swf. I'm auto-preloading it while displaying textual stuff in order to have a minimum of preloading time.

Everything work well but imagine I've got 5 external swfs. If I decide to close one game and remove the loader child, when I click back to view this game, I have to reload it again.

So, is there a problem (memory or performance) if I do not delete my 5 loader childs in order to lead them only 1 time?

View 0 Replies

Unloading External Swf File Keeps Memory Usage Growing Up?

Dec 7, 2009

The idea is very simple: I have a submain.swf with 5 buttons. Each button loads an external .swf loader.load(URLRequest);After playing first external swf, before I go to next one, I try to unload it1. remove all its associated listeners:com_loader.contentLoaderInfo.removeEventListener(Event.INIT-PROGRESS-C OMPLETE, idFunction);2. unload it:

View 3 Replies

ActionScript 3.0 :: Remove External Swfs Completely From Memory?

Jan 14, 2011

I have developed a touchscreen application that works perfectly fine except for the memory issue. Basically, the touchscreen app works kinda like a website with navgation on the side and content displaying next to it. I separeate each section into external swfs, and load each one up when it is needed, thinking it would reduce memory used on the pc. But unlike actionscript 2, AS 3 would not remove the external swfs from the memory. You can remove it from the stage and you won't see it, but the swf will still stay in the memory! So... as you navigate through the app, loading up all these external swf, even I do loader.unloadAndStop();, the swf is still there, and they just keep piling up in the memory as you navigate from the app. After leaving the touchscreen for a day or 2, having all these users naviage through it,  all the external swfs will just completely consume all the resources and freeze the pc.

View 1 Replies

ActionScript 3.0 :: Loading External Movies And Memory Leak?

Aug 20, 2009

I have an interface that needs to load in external activity pages - there's quite a few of these. I've been trying to create an external class to take care of movie loads, but it has a bad memory leak. I've been reading about using unload() and unloadAndStop() but haven't gotten these to work (there are no noticeable differences in system memory usage or performance). Everything grinds to a halt once I've used up about 13+ Mb of memory.

The document class has lots of code (of course) so I'm just showing the code that relates here:

Code:
package {
public class Interface extends MovieClip {
static public var _ui:MovieClip;

[Code].....

View 0 Replies

ActionScript 2.0 :: Memory Leaks When Loading In External Swfs

Dec 8, 2009

I have a problem in that i have a holder swf which loads in other swf's externally. My problem is that the holder loads all the movies in correctly but the memory usage of the swf just keeps going up and up even though i am trying to remove the movieclip after each has finished it's run.

[Code]..

View 0 Replies

ActionScript 3.0 :: Memory Usage When Loading External Movies?

Dec 13, 2010

I have a flash application running on some local machines. There are 3 movies the flash loads and plays. Each time a movie is played, it makes the amount of RAM the swf is using increase. This is being ran in a museum and users step through the 3 movies over and over and over, causing the swf to use gigabytes of RAM and eventually locking up the flash player.

Here's where I create the movie playback component.

ActionScript Code:
var flvPlayer:FLVPlayback = new FLVPlayback();
addChild(flvPlayer);

The 3 movies are on 3 different frames in the timeline, for each frame I have this code that loads each movie.

ActionScript Code:
flvPlayer.source = "resources/LADEE_overview.f4v";
flvPlayer.play();
flvPlayer.addEventListener(MetadataEvent.CUE_POINT, cuepointfound);

I use the cuepoints to display some text on screen. I also call a function that does flvPlayer.stop(); each time the user navigates away from a movie frame. So is the RAM usage growing because of the flvPlayer.source = "whatever" being triggered each time the movie is called up?

View 5 Replies

Actionscript 3.0 :: Remove External Swfs Completely From Memory

Jan 14, 2011

I have developed a touchscreen application that works perfectly fine except for the memory issue. Basically, the touchscreen app works kinda like a website with navgation on the side and content displaying next to it. I separeate each section into external swfs, and load each one up when it is needed, thinking it would reduce memory used on the pc. But unlike actionscript 2, AS 3 would not remove the external swfs from the memory. You can remove it from the stage and you won't see it, but the swf will still stay in the memory! So... as you navigate through the app, loading up all these external swf, even I do loader.unloadAndStop();, the swf is still there, and they just keep piling up in the memory as you navigate through the app. After leaving the touchscreen for a day or 2, having all these users naviage through it, all the external swfs will just completely consume all the resources and freeze the pc.Also, is it better to develop touchscreen application with actionscript 2 since it doesn't have this pressing memory issue?

View 1 Replies

ActionScript 3.0 :: Loading / Unloading External SWF - Prevent Memory Leaks

Sep 19, 2011

Im creating a flash projector which has a holder swf with an empty movieclip. A series of external SWFs are loaded into the empty movieclip on the push of a button. Once the clip has been loaded, other external SWFs can be replaced in the empty movieclip at the push of a button. As memory leaks and garbage collection seem to be an issue, I was wondering the most memory efficient way of loading, unloading and replacing these external swfs so that memory leaks are kept to an absolute minimum.

View 1 Replies

ActionScript 3.0 :: Unload External SWF To Free Up Flash Player Memory

Apr 29, 2009

I'm having real problems with unloading external SWFs, I've spent 2 days looking for a solution and looking at this forum and using the code supplied and Flash help files and much much reading and trying, I still cannot achieve the desired results.I have a Menu.swf which hosts many buttons which loads External SWFs ... simple enough and fairly common.These External SWFs are the same size as the menu and so loads completely over the top of Menu.swf which is exactly what I want to happen.I have a button on these External SWFs which I want to, delete the External SWF from the Flash player's memory and remove all event listeners (which I guess will happen if the External SWF is deleted from memory)The reason why I want it to remove the movie completely from memory is that I have 18 items and by the time it loads the 18th item, the player is going slower then trying to swim in hummous.[code]

View 2 Replies

ActionScript 2.0 :: Pulling External Images - Make The Small Images When Click To Appear In The Place Of The Main Image

Oct 17, 2004

I am pulling external images, I have my main image, and five small images, I have that to make the small images when click to appear in the place of the main image, but I am not obtaining to make they to click, I am placing my archive who to want to make download

View 2 Replies

Actionscript 3 :: Greensock LoaderMax Memory - Clean The Memory Which Been Occupied By The Previous Queue

Jan 31, 2012

I have a bit trouble with LoaderMax memory occupy, i have a queue, and i am keep loading images depend on user's action. if they click load more and it keep load, but i would like to clean the memory which been occupied by the previous queue (i have remove all the children been added by the loading previously). is there a way i can do it? the behavior like this.

[Code]...

View 1 Replies

ActionScript 3.0 :: Memory Monitor That Allows To See The Memory Leaked And Find Its Location?

Sep 26, 2010

I have an FPS monitor running and notice that I am getting choppiness here and there, bringing my game from 40 to 27 fps and back and forth at certain stages. I have an idea of where it is happening, but do not know for sure. I looked up quite a few memory monitors but haven't found anything decent yet. Is there a memory monitor that allows you to see the memory leaked and find its location? If not, how about just he memory leaked?

View 4 Replies

ActionScript 2.0 :: Memory Management - Take Less Memory For Scrolling

Aug 2, 2007

I'm making an isometric game and I need to know which takes less memory for scrolling, making everything invisible that you can't see? Like if(!this.base.hitTest(worldHitter))this._visible = false; Or would it be better to remove the movieclips unseen and then reattach them when i should see them?

View 2 Replies

Flex :: Flash - Total Memory Usage And TaskManager Memory Usage Are Different?

Aug 24, 2010

I wrote an application in flash AS3, and when I trace from flash the total memory usage of the total application is only about 9MB, But at the same time Task Manager Shows the memory usage as 110MB. Around 100MB difference.Flash Trace Method System.totalMemory difference of the Trace from the Beginning of the application to end of the application.

View 2 Replies

ActionScript 3.0 :: Remove / Unload External Swf File(s) From The Main Flash File And Load A New Swf File And Garbage Collection From Memory?

Sep 12, 2009

I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?

View 15 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved