Flash 8 Memory Usage
hi there, I created a flash screen presentation of my portfolios (flash 8 pro) and noticed that the memory usage is pretty high.
To give you an overview of what's happening, in the beginning there's a short intro (memory usage bout 20mb), then it transitions into the main menu screen where there are buttons to jump to diff. parts of the presentation and a main animation, (nearly the whole part of the animation when it's running, memory goes up to bout 30-40mb, then when it's near the end, it jumps to bout 100-130mb+, if IIRC)
When i click on a button to go the the main collection portion of the presentation, memory usage jumps again to a whopping 220-250mb+ region and when I continue to navigate to other parts it goes up to nearly 300-320mb and that's the max it goes.
Now I have a lot of ram in my system so I didn't notice anything, I was told this by a friend of mine who was looking at my stuff on his PC and that's when i realised flash is using a lot of RAM.
2 questions, is this normal and is there anyway to make it utilize less RAM?
Thanks in advance for any help rendered and have a nice day!
Best regards,
Wen
FlashKit > Flash Help > Flash Newbies
Posted on: 06-25-2006, 07:44 AM
View Complete Forum Thread with Replies
Sponsored Links:
Memory Usage By Flash
i building a appliction using flash mx and swf studio 3.1.
i have problem with memory usage that build up , slow down the computer and causing bugs...
I solve this by minimize and maximize of the appliction, by really like a way to tell my flash application what is memory usage of that app.
any one know a way to do that?
thanks
kuller
View Replies !
View Related
Flash 6 Memory Usage
Hey guys and gals, Does flash 6 have any type of memory control?
I have an app that is dynamicly loading pictures externally using .loadMovie and when I want to goto the next picture, I .unloadMovie the current picture and .loadMovie the next one. This does not seem to remove the old picture out of memory because I hit an *out of memory* error when I hit my 1.1meg limit when more than 1.1 meg worth of pictures have been loaded. (not at one time)
Any Ideas?
EDIT: I would also like to know if any newer flash versions have any kind of memory control if flash 6 doesnt.
View Replies !
View Related
Flash Memory Usage
Well I got two questions here about memory usage of flash programs.
1.
I made a flash game and when I play it the memory usage looks normal but if I leave it running for a long time it seems to just keep going up and up.
And the weird thing is that when I minimize it the memory usage will go back down low and I restore it and continue playing the usage will still be low. But if I just leave it for a long time it'll just take up a lot of memory.
What is done during this time is just a single frame playing over and over with an onEnterFrame used to detect a key pressed on the keyboard and an image that scrolls across the screen by continuously changing _y parameter and then going back to the top after reaching the end and repeats.
So would it be a memory leakage somewhere? When I use something like this:
if (Key.isDown(69)) {
count = 1;
for (i in _root) {
trace(count+". _root."+i+" = "+_root[i]);
count++;
}
trace("
");
}
it shows me that I'm not creating more objects and whatnot so it's not because of that I think.
NEW: Oh, what was moving across the screen was actually a movie clip containing many water drops simulating a raining effect. I took that out and everything is fine in terms of memory usage now so far.
So how can I fix this? I want to have dynamically dropping raindrops but I don't seem like I can do this. What I currently have is a movie clip containing two layers of rain. One that has _y increasing faster and one with _y increasing slower. So when it reaches a certain point I set _y to the top of the stage so it loops infinitely.
2. In general how can I reduce memory and CPU usage?
thanks
View Replies !
View Related
[Flash Player] Memory Usage
hi all,
this might be not the right board to post this in, but i couldn't think of a more appropriate one. so here goes:
i made a flash application (with f mx 2004 pro, as2) that loads up to 300 small xml files (ca 5 KB) upon a button click (i load these files subsequently using setInterval() to wait till each file has been parsed).
this xml data is then crammed into a total of ca 20 arrays.
when i run this application in flash (test movie) or directly in the flash player (via double click), everything works as expected.
the problems start when i run the aplication in the browser (IE, firefox). sometimes pieces of data disappear, re-appear or seem to vanish for good.
it's even worse when the application runs on a remote server.
btw: these xml files are regularly updated by a content management system.
after examining the application's behavior, i tend to believe that this task is too much for the flash browser plugin (i tested fplayer 7 and 8).
my question now:
is there a way to see whether the player creates buffer overflows? is there a limit as to how much data the player can handle at once?
is there another, more reliable way to load that much xml data?
has anyone of you ever encountered problems like this?
sorry for the long post...thanx...
View Replies !
View Related
Memory Usage And Bitmapdata Issue In Flash Game Design
We have a huge movieclip of 5000 by 5000 pixels with different (transparant) layers.
We can make an instance of the movieclip and work with it, we can move layers, scale them, ...
But as soon as we add the MovieClip to the stage the ram memory-usage jumps to 200 MB!
My guess is that flash retrieves all the bitmapdata from the MovieClip (all 25 million pixels) so it can display it. And all this data takes up around 200MB.
For cpu performance and obviously the memory-issue we use bitmapdata with clipRect to extract a single 'screenshot' of 600 by 400 and add that to the stage instead of the entire mc.
At first the memory-usage is reasonable, but as we start to explore the map it goes up again. It keeps rising to the point that, when you have explored the entire map, the memory-usage is back at around 200MB, same as when we added the mc to the stage.
We use BitmapData.dispose() but this doens't seem to help either as the garbage-collector doesn't free up the ram instantly.
We tried using tiles, we cut the entire mc up in tiles and added and removed the necessary tiles, but again, the memory starts low and rises as we explore the map.
It's hard to believe that all those papervision-applications run so smoothly using BitmapData while we only use a couple large jpg's and have such extreme memory-usage.
Is there any way to make the garbage-collector pass (we use flash player 9) or reduce the memory-usage?
Any help or tips would be greatly appreciated!
View Replies !
View Related
Memory Usage
I will try this again...
I have a application made in flash mx and swf studio 3.1
I want my application to "know" what is the memory usage of the app,
I talking about the details i can see in thee Prosses tap in the task manger.
Does anybody know how flash application can get this kind of data?
thanks
View Replies !
View Related
Memory Usage
Hi,
A heavy graphic oriented movie consumes much memory. Some images are loaded into a Sprite. If the Sprite is removed by removeChild() method, will it removes all the images loaded, form memory as well. If not, loading it as external SWF need to be considered as a solution?.
Pls help,
Thanks,
Manu
View Replies !
View Related
Memory Usage
Hi,
A heavy graphic oriented movie consumes much memory. Some images are loaded into a Sprite. If the Sprite is removed by removeChild() method, will it removes all the images loaded, form memory as well. If not, loading it as external SWF need to be considered as a solution?. ( This is related to AS3.)
Pls help,
Thanks,
Manu
View Replies !
View Related
Too Much Memory Usage
Hi!!
If you look at the pic
(http://uploadyourimages.com/view/338...emoryusage.jpg)
If u look at the bottom left, there is my task manager.it says memory usage is 221,612K (216MB). isn't that too much? whenever I make a flash movie with some pics in it. the memory usage goes up like crazy. I was making another movie other day and memory usage was going up to 200+... if there any way to avoid that? because not all computers have the same amount of memory, some computers will just crash when I run this on those computers.
Please tell me what can I do to fix this problem. also what should be memory usage for a normal flas movie, I know it depends on what type of movie it is, but just gimme a rough idea.
Thanks
Mr.Flash MX
View Replies !
View Related
SWF Memory Usage
I'm trying to analyze what's sucking up memory in my SWF. I can use the debugger to view what MovieClips are resident in the SWF, but how can I view what Objects are present in memory?
View Replies !
View Related
Var Memory Usage
I was just wondering if anyone knows if Flash deletes temporary variables from memory when they are used within functions?
For example would "banana" in the following example be deleted/removed from memory (RAM) at the end of the function, or is it better to do it manually?
Code:
function monkey():Void {
var banana:String = "something";
}
View Replies !
View Related
Memory Usage Problem.. Please Help
Hi,
I'm working on an application which loads a new xml file
(which is around 7 kb) every second. When I monitor my
RAM memory usage it is expanding every time a new file
is loaded and the data is processed. This goes on and on
untill the memory is completely full.
Is there a way to flush the memory?... all the previous
loaded xml files are not important to the application once
they are processed..
thanks
View Replies !
View Related
Memory Usage Of The Function
In the following code i am calling getInitialUserFiles() function from getTechnology function. I am wondering if i am doing this the right way. Will this code affect performance?
function getTechnologyList() {
var dataList = new Array();
var techFileLoader = new LoadVars();
techFileLoader.load("TechSupport");
techFileLoader.onData = function(src) {
var techSupport = new XML(src);
techSupport.ignoreWhite = true;
techSupport = traceNodes(techSupport);
_root.SERVERIP = "http://"+techSupport.firstChild.childNodes[0].attributes.ip+":"+techSupport.firstChild.childNod es[0].attributes.port;
dataList = techSupport.firstChild.childNodes[1].childNodes;
for (i=0; i<=dataList.length; i++) {
if (dataList[i].attributes.enabled == "true") {
_root.buttonsPanelTop.techSelection.dropDown.addIt em(dataList[i].attributes.label, dataList[i].attributes.module+"~lkdel~"+dataList[i].attributes.compile_servlet+"~lkdel~"+dataList[i].attributes.run_servlet+"~lkdel~"+dataList[i].attributes.category);
}
}
getInitialUserFiles();
};
}
function getInitialUserFiles() {
var SCCommunicator = new LoadVars();
// further code
}
View Replies !
View Related
Memory Usage Curiosity
I'm working with a byteArray and I'm keeping tags on the memory as I go. When I populate the array, I'm only using 1 and 0 for each byte so I thought I could save some time (about 100ms it turns out) by only writing the ones and leaving the zero spots undefined.
However, when I do this, the size of the array in memory doubles! It's not too bad (about 5mb) but I'd really like to know why so I can make a more informed decision on whether the memory or processing speed is more valuable in this situation. Any thoughts?
View Replies !
View Related
How Much Memory Usage Is Acceptable?
I don't know much about memory, but I've been testing a few of my sites to see how much memory they're using as one of them has been crashing browsers.
I'm using Activity Monitor on Mac to test this, and I've found that my sites seem to increase the browser's "Real Memory" usage by 10MB - 70MB. The one that's crashing browsers gets up to 140MB.
Is there any kind of a guideline or some other way to test memory usage that would be useful in knowing whether a site was safe for use?
View Replies !
View Related
Memory Usage Problem
Help. My site is working, but each time I load a new swf the memory usage in Firefox or IE7 goes up. Sometimes it goes up to 600 MB or more. At this point the site slows to a crawl. Is there a way to clear the memory or reduce it in a flash app?
View Replies !
View Related
Memory Usage Problem
Hi,
I am working on an online multiplayer game project implemented on Flash CS3 with AS3.
I have problems with the memory usage of the project. I have read over the forums about the "uncontrollable" behaviour of garbage collector, weak references and so forth and I tried to use the tips I found.
However the memory usage of the application is still unbalanced. When I run the project on IE or Firefox, the memory usage comes out to be about 220 MB. The strange thing is when I minimize IE window, the memory usage decreases to about 30 MB. When I maximize it back, memory usage increases to about 65 MB. However when I do the same things on Firefox, memory usage is not effected at all and is always about 220 MB.
Any idea about what this 220 - 65 = 155 MB difference of memory usage on IE before and after I minimize and maximize it back is about? Why does it happen on IE and why not on Firefox? Of course I cant ask the player to open the game on IE, but not Firefox, and minimize the browser window before beginning to play, etc. I just hope the answer might help me to understand where my mistake is - and hopefully it is my mistake, not a bug about Flash Player, and there is a way to get over it.
Any suggestions are most appreciated. Thanks in advance.
View Replies !
View Related
CPU/Memory Usage Issue
I am looking at different ways of streaming audio through my flash movie, however the method i am using is causing some obvious worries for me.
the code to play the audio stream i am using is :
var stream1 = "http://64.236.34.67:80/stream/1038" //example radio stream
var streamer = new sound()
streamer.loadsound(stream1,true)
This code works perfectly, however it is loading the streamed audio into my computors memory, without discarding old data. The result of which is a flash movie which continually increases it's memory usage. Listening to an audio stream for any longer than 10-15 mins would start to lag the computor noticeably.
Is there any way that i could get my flash movie to play the stream without using the ever-increasing memory storage... or perhaps a way to 'empty' the data stored in my temporary memeory which has been stored as a result of this flash movie playing? A nice little bit of code would do wonders...
*sigh*
Kind Regards
James
View Replies !
View Related
Increasing Memory Usage
Hi all,
I have a problem with my swf file. The file itself is quite complex and has loadVars, loadMovie, setInterval, for loops and attachMovie commands.
initially I am creating a spinner dynamically from images in my library. I have made sure this is only done once. I have also made a mask that only shows three images at the time. All this is done at the first frame and using attachMovie.
The code itself that spins the spinner uses setIntervals, that are always cleared as well as for loops that always finishes. I am using loadVars to get the position where the spinner will stop.
The problem is that the memory usage increases everytime when I start using the spinner.
I read few threads on the forum about _xscale, attachMovie, dynamically loading sound etc. issues, but didn't find an answer that was clear which one is actually causing this issue.
Has anyone found a solution?
Thanks
View Replies !
View Related
Memory Usage When Using The Timer
Hi, this is a problem with Flash 9 - Im using the Flash 9 Alpha preview
Can anyone tell me why when you use a timer with a small interval that the memory usage goes up?
E.g with this code (you'll need a text field called fpst on the stage):
var fps:Timer = new Timer(20, 0);
fps.addEventListener("timer", fpsHandler);
function fpsHandler(event:TimerEvent):void {
fpst.text = System.totalMemory;
}
fps.start()
Wait a few seconds and the memory usage will go up. If you increase the value from 20 to 200 the memory will still go up but very very slowly.
Is this known behaviour? Im building a game which uses the timer to execute code everyframe so I need it to execute very fast.
Is there another solution? I dont want to use enterFrame handlers.
View Replies !
View Related
Memory Usage Problem.. Please Help
Hi,
I'm working on an application which loads a new xml file
(which is around 7 kb) every second. When I monitor my
RAM memory usage it is expanding every time a new file
is loaded and the data is processed. This goes on and on
untill the memory is completely full.
Is there a way to flush the memory?... all the previous
loaded xml files are not important to the application once
they are processed..
thanks
View Replies !
View Related
Memory Usage / Performance
HI folks,
I am loading a xml file into my .fla with a list of image urls and load that info into an array.
I am looping through the array and dynamically create a new movieclip, load the image using the MovieClipLoader() and tween it across the screen (TweenMax) and onComplete of my tween I remove it via removeMovieClip().
I've traced the movieclip after removal to make sure it's gone and it is.
So here's my problem, the whole thing runs fine for 5 - 10 minutes and then gradually my FPS goes down until I am at like 2 - 3 fps after 30 minutes.
I am not sure where the problem is, I am pretty sure I am removing the dynamically created movieclips, so they should be gone from the memory.
Anything else you can think of?
View Replies !
View Related
OnClipEvent Question (memory Usage)
I want to use onClipEvent (enterframe) to monitor a variable and perform certain actions based on the value of that variable... that's no roblem. I just have the action applied to an MC.
My question is this: If I add a similar clip event to multiple clips does it use a lot more memory to run? I may need ise onClipEvent on about twenty clips inorder to accomplish what I want.
Thank you
View Replies !
View Related
Viewing Variable Memory Usage?
Is there any way in the debugger to view how much memory a variable uses?
I've got arrays populated with custom objects that contain arrays with more custom objects...and so on down the line.
This is all fed from an XML file, I just want to keep tabs on how much memory this eats up.
View Replies !
View Related
Class Constructor And Memory Usage
Code:
class MyClass{
public var $test:String;
public var $foo:Function;
function MyClass(){
this.$test = "hello";
this.$foo=function(){}
}
public function boo():Void{ }
}
when i put in the constructor a function does it copy in memory every time an instance of the class is being made????
beacuse i know in other languages when u put a function out side the constructor
it dosent matter how many times u have made an instance of the class the function will always been made only once!
does it the same for function in constructors?
thnaks in advance
peleg
View Replies !
View Related
Extreme Memory Usage When Using SoundLoaderContext
Hi,
I did a simple test how to work with multiple mp3 files
with AS3. The folder where my swf is, contains a folder "mp3Folder"
with two songs in mp3 format: 1.mp3 and 2.mp3. I used the
SoundLoaderContext() Constructor so only the first bit of
the songs are loaded. I was planning to populate the songs array
more in this way. But when I checked the memory usage of my
PC I discovered loading 1.mp3 and 2.mp3 with SoundLoaderContext()
is taking about 20 MB of memory while the mp3 files are about 3 MB
each and the buffersize together is 6 seconds.
Main piece of the code is:
Code:
var songAmount:Number = 2;
var songs:Array = new Array(songAmount);
var context:SoundLoaderContext = new SoundLoaderContext(3000, false);
for (var i = 0; i < songAmount; i++) {
songs[i] = new Sound();
songs[i].load( new URLRequest("mp3Folder/" + (i+1) + ".mp3") ,context );
}
The reason for the "load" is I want to extract metadata from the mp3 files so
I can display this and the user can choose a mp3 file from a list. I assume in
my example above the mp3 files are loaded completely. Anyway there was no
problem extracting the absolute path and other data after loading.
I think you understand I am no AS3 expert. So I have two questions:
- Why are the mp3 files loaded fully when using SoundLoaderContext()?
- How can I extract metadata from a mp3 file without loading it (completely)?
Thanks very much for your reply, Paul
View Replies !
View Related
Memory Usage Of A Class Instance
Hi all,
I have a game object class that carries all the properties & methods for not only the game itself but also those needed for the level editor. I'm wondering whether this is sensible - when playing the game, the instances don't need the editor specific properties. Do they still use memory if they're null? Will a class instance always use the same amount of memory as the .AS file used to create it + the variable space?
PMF
View Replies !
View Related
Extreme Memory Usage When Using SoundLoaderContext
Hi,
I did a simple test how to work with multiple mp3 files
with AS3. The folder where my swf is, contains a folder "mp3Folder"
with two songs in mp3 format: 1.mp3 and 2.mp3. I used the
SoundLoaderContext() Constructor so only the first bit of
the songs are loaded. I was planning to populate the songs array
more in this way. But when I checked the memory usage of my
PC I discovered loading 1.mp3 and 2.mp3 with SoundLoaderContext()
is taking about 20 MB of memory while the mp3 files are about 3 MB
each and the buffersize together is 6 seconds.
Main piece of the code is:
ActionScript Code:
var songAmount:Number = 2;
var songs:Array = new Array(songAmount);
var context:SoundLoaderContext = new SoundLoaderContext(3000, false);
for (var i = 0; i < songAmount; i++) {
songs[i] = new Sound();
songs[i].load( new URLRequest("mp3Folder/" + (i+1) + ".mp3") ,context );
}
The reason for the "load" is I want to extract metadata from the mp3 files so
I can display this and the user can choose a mp3 file from a list. I assume in
my example above the mp3 files are loaded completely. Anyway there was no
problem extracting the absolute path and other data after loading.
I think you understand I am no AS3 expert. So I have two questions:
- Why are the mp3 files loaded fully when using SoundLoaderContext()?
- How can I extract metadata from a mp3 file without loading it (completely)?
Thanks very much for your reply, Paul
View Replies !
View Related
Slideshow Memory Usage Problem...
I made a slideshow component but it never gets to delete the movieClip when the image has completed its fadein fadeout. Please have a look, it is getting stuck in a loop in function StartFader. Look at the
ActionScript Code:
if(Clip_mc._alpha == 100)
{
this.LoadNextImage();
}
the code runs the LoadNextImage but never receach the code below that, so it never clears the memory of those pics. Every image that is loaded in uses x amount of memory and is never cleared for as long as the slideshow is running for. Just copy the code into a new blank movieclip file and link it with the following name: PictureLoader. Draw a white square inside this new movieclip starting on x=0 y=0 and make it 400x300 in size;
To start the slideshow this is what you need:
Drop the Component onto the stage
Give it an instance name ie: slideShow
then call it like this:
ActionScript Code:
var images_array:Array = new Array();
for(i = 1; i <= 6; i++)
{
images_array.push("Images/Slide"+i+".jpg")
}
this.slideShow.interval = 1000;//Milliseconds
this.slideShow.transitionSpeed = 5;//Speed of the _alpha increment
this.slideShow.LoadImages(images_array);
ActionScript Code:
#initclip
var interval:Number;
var imageIndex:Number;
var startTimer:Number;
var transitionSpeed:Number;
var imageArray:Array;
var startFadingIn:Boolean;
PictureLoader.prototype = new MovieClip();
function PictureLoader()
{
this.imageIndex = 0;
this.imageArray = Array();
this.startTimer = getTimer();
Depth = this.getNextHighestDepth();
mask_mc = this.createEmptyMovieClip("mask_mc", Depth);
mask_mc.rect_mc = mask_mc.createEmptyMovieClip("rect_mc", 0);
this.DrawRoundedRectangle(mask_mc.rect_mc, 400, 300, 25, 0xFFFFFF, 100);
this.setMask(mask_mc);
};
PictureLoader.prototype.LoadImages = function(Filenames:Array):Void
{
this.imageArray = Filenames;
Filenames = null;
delete Filenames;
if(this.startFadingIn)
{
var clip_mc:MovieClip = this.LoadImage(this.imageArray[this.imageIndex]);
clip_mc._alpha = 0;
this.StartFader(clip_mc);
}
else
{
this.StartFader(this.LoadImage(this.imageArray[this.imageIndex]));
}
};
PictureLoader.prototype.LoadImage = function(Filename:String):MovieClip
{
var Depth:Number = this.getNextHighestDepth();
img_mc = this.createEmptyMovieClip("img"+Depth, Depth);
img_mc.loadMovie(Filename);
//Work around to clear memory
/*
var oldDepth:Number = Depth - 2;
if(this[("img")+oldDepth] != null)
{
this[("img")+oldDepth].unloadMovie();
this[("img")+oldDepth].removeMovieClip();
delete this[("img")+oldDepth];
}
*/
if( (this.startFadingIn) )
{
img_mc._alpha = 0;
this.StartFader(img_mc);
}
return img_mc;
};
PictureLoader.prototype.StartFader = function(Clip_mc:MovieClip):Void
{
var FadingIn:Boolean = true;
this.onEnterFrame = function ()
{
if(FadingIn)
{//Fade In
if (Clip_mc._alpha < 100)
{
Clip_mc._alpha += this.transitionSpeed;
}
else
{
this.startTimer = getTimer();
Clip_mc._alpha = 100;
FadingIn = false;
}
}//end if(FadingIn)
else
{//Fade Out
if( (getTimer()-this.startTimer) < this.interval)
{//Preview wait
return;
}
if(Clip_mc._alpha == 100)
{
this.LoadNextImage();
}
if(Clip_mc._alpha > 0)
{
Clip_mc._alpha-=this.transitionSpeed;
}
else
{
Clip_mc._alpha = 0;
Clip_mc.unloadMovie();
Clip_mc.removeMovieClip();
delete Clip_mc;
delete this.onEnterFrame;
_level0.Debug("Clip_mc deleted");
}
}//end else if(!FadingIn)
};//end this.onEnterFrame = function ()
}
PictureLoader.prototype.LoadNextImage = function():Void
{
clearInterval(this.LoadImageInterval);
if(this.imageArray.length >= 0)
{
if(this.imageIndex < (this.imageArray.length-1))
this.imageIndex++;
else
this.imageIndex = 0;
var img_mc:MovieClip = this.LoadImage(this.imageArray[this.imageIndex]);
img_mc._alpha = 0;
this.StartFader(img_mc);
}
return;
}
PictureLoader.prototype.LoadPreviousImage = function():Void
{
if(this.imageArray.length > 0)
{
if(this.imageIndex > 0)
this.imageIndex--;
else
this.imageIndex = (this.imageArray.length-1);
var img_mc:MovieClip = this.LoadImage(this.imageArray[this.imageIndex]);
img_mc._alpha = 0;
this.StartFader(img_mc);
}
return;
}
//
PictureLoader.prototype.DrawRoundedRectangle = function (target_mc:MovieClip, boxWidth:Number, boxHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number):Void
{
with (target_mc)
{
beginFill(fillColor, fillAlpha);
moveTo(cornerRadius, 0);
lineTo(boxWidth-cornerRadius, 0);
curveTo(boxWidth, 0, boxWidth, cornerRadius);
lineTo(boxWidth, cornerRadius);
lineTo(boxWidth, boxHeight-cornerRadius);
curveTo(boxWidth, boxHeight, boxWidth-cornerRadius, boxHeight);
lineTo(boxWidth-cornerRadius, boxHeight);
lineTo(cornerRadius, boxHeight);
curveTo(0, boxHeight, 0, boxHeight-cornerRadius);
lineTo(0, boxHeight-cornerRadius);
lineTo(0, cornerRadius);
curveTo(0, 0, cornerRadius, 0);
lineTo(cornerRadius, 0);
endFill();
}
}
Object.registerClass("PictureLoader", PictureLoader);
#endinitclip
View Replies !
View Related
Bitmap Data Vs Memory Usage
Simple question
Usign cacheAsBitmap is usedfull in many case. I just wondering if the memory usage used when a clip is set to true will be free when the clip will be removed from the timeline.
I want to used cacheAsBitMap for some clip, but don't want to load all the computer memory when the user come on my website.
Tanx for you help
View Replies !
View Related
Bitmap Data Vs Memory Usage
Simple question
Usign cacheAsBitmap is usedfull in many case. I just wondering if the memory usage used when a clip is set to true will be free when the clip will be removed from the timeline.
I want to used cacheAsBitMap for some clip, but don't want to load all the computer memory when the user come on my website.
Tanx for you help
View Replies !
View Related
String Vs. Value Object Memory Usage
Does anyone know how much more memory a value object uses in comparison to a string.
For example if I am passing a large amount of value objects through local connection will it use a lot more memory than just passing a large amount of strings to be parsed on the other side?
View Replies !
View Related
String Vs. ValueObject Memory Usage
Does anyone know how much more memory a value object uses in comparison to a string.
For example if I am passing a large amount of value objects through local connection will it use a lot more memory than just passing a large amount of strings to be parsed on the other side?
View Replies !
View Related
Memory Management, Mysterious Usage.
Hey, I have an object with a few properties, and some function to return them, each time these functions are called the memory ups at least 100kb ( about 30 on the call, and 75 on the return ). these functions don't do anything except return a value. After a while it starts to pile up.
ex.
function getTotal(){
return this.total;
}
anyone know why this would cause such memory issues? I can't see why any memory is being allocated at all.
View Replies !
View Related
Memory Usage Issue With Playing A Loaded Swf
My company is currently developing a game which requires the loading of multiple movie clips from file. And my question involves memory issues with loading and playing them.
A movieclip loads up with a fairly small amount of memory used and then as they play they use a larger portion of memory, after they are done playing however it seems as if they are cached from that point on and the memory usage doesnt decrease.
Is there a way anybody knows of that after a movie clip plays the memory used from each individual keyframe can be released until it plays again, (just like it was when it loaded...) without actually unloading it and loading it back up.
View Replies !
View Related
DisplayObjects Off-list Memory And Processor Usage
A classic problem with scrolling content back in the day is the fact that display objects off screen, even if masked or set to !visible, would still require substantial processing power and memory. If you had a lot off screen, or a few far off screen, Flash rendering runs out of steam fast. A classic example would be a scrolling game: logically you could simply create a huge MovieClip containing your level and move the MovieClip to simulate scrolling, but in reality Flash would come to crawl as you MovieClip or object collective bounds got large, no matter how you hid them when off screen. The solution was to dynamically remove objects via removeMovieClip or gotoAndStop to an empty frame to clear Flash rendering from worrying about it, then use addMovie or gotoAndStop to a frame with graphics to bring it back when it came on screen.
Now AS3 introduces the completely new model where display objects can be in memory, but not in any display list.
My idea is to simply addChild/removeChild objects from the display list based on whether they are in the viewable area or not. This eliminates the need to store tons of abstract data about objects which don't physically exist, like you needed to do when using attachMovie/removeMovieClip.
My question: is that sufficient to free up the processor and memory? Obviously the display object will still be in memory, but so would arrays storing all the properties.
I hope that makes sense.
Basically my question is: does removing a child from the display list via removeChild completely remove it from the rendering processor, and should I be worried about memory use of them as they sit idle off screen?
Thanks for any thoughts!
View Replies !
View Related
Memory Usage MUCH More Than Loaded File Sizes
I'm working on a new website that has a different background image for each page. The file sizes of the images are anywhere from 100-200KB. However, I'm monitoring the memory usage of my browsers, and as each image loads, the memory usage jumps by 5-10MB. Why in the world does Flash need so much memory for an image load?
In an attempt to reduce memory usage, upon each image load I pulled the bitmapData from the loader into a new Bitmap object and unloaded and nulled the loader. Unfortunately that didn't result in any memory decrease (or increase). If I didn't pull the bitmapData and just unloaded/nulled the loader, the memory is released just fine, but obviously that leaves me without an image.
I guess my question is: is this normal? Does Flash just use extraordinary amounts of memory to store image data? Is there any way to reduce the footprint?
A million thanks to anyone who has any insight.
View Replies !
View Related
Every Time I Load An External Image The Memory Usage Goes Up
I need to get this project out asp. So here is the problem. Every time I load an external image the memory usage goes up until the app just bogs down. Once an image is loaded the first time I put it into an array and then pull if from an array. But when I look at the memory usage in windows holy ..... what the
Help me I am dying here I know a little about garbage collection but it's done at random intervals???????
My ass is on a sling here. I have read Grant Skinners blog and others but still haven't found a solution. I need to load external images without the memory usage stalling the app.....
Please helllllllllllllllllllllllllllllllppppppppppppppppp p
View Replies !
View Related
How To Avoid The "Abort Script" Error & Memory Usage Issues
hi,
i am workin on a game that loads levels. when a level is loaded, the items to be shown in the level are placed on stage by using (while/for) loops (i use alot of arrays in the process). Now the thing is that in some cases, my level has loads n loads of stuff in it and when my application gets on to placing them, i get the error "script in this movie is causing Flash Player to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?". I know this is because my loops have run thousands of times. When i press "No", the script continues to run and within a few seconds my level loads completely with no problem. My question is: is there a way to skip this error? as it will be confusing for my user
I also have a second question, my application file size is 99KB and including the sprites, the maximum the whole thing would go is 2MB. But when I run it and load one of my heavy loaded levels, the memory usage go's upto 110 MB. The memory usage starts from 80MB and seems to grow continuously until it reaches 110 and then goes down and up. Note that this is running in the internet explorer. The memory seems to be possibly some garbage data, (because when i ran some other web app that consumed the memory, the memory usage of my application went down from 110 to 80) but i dont know much in this area. Can someone guide me how i can get rid of any extra memory usage. In cases of average sized levels, the usage go's upto 70 MB. So my second question is: any idea ??
View Replies !
View Related
Static Methods Vs. Instance Methods And Memory Usage
Hello all, I'm pretty green to OOP (at least "real" OOP) and am trying to wrap my tiny little brain around something. I understand the difference between static and instance methods in the practical sense, i.e. how the static modifier affects a method for in a class. What I'm not 100% on is memory usage and whether I should even care. Here’s my specific scenario for context:
I am creating a package for list generation, rendering and editing, there are a number of classes in the package; Item, PlainList, EditableList and DragDropList. At a minimum, one of the list constructors is passed a target movie (where to draw the list), itemName (symbol name for Item constructor) and dataList (data items for Item constructor). There is also an EventDispatcher that fires "onInitList", "onInitItem", "onSelectItem", etc. These lists could be hundreds of items long and contain sub-list instances. So, long story there could be thousands of list/item instances at a time.
The majority of methods (in pretty much all classes) could be written as static by simply passing the target instance. For public methods, I would make lightweight wrappers that call the appropriate static method, for example:
Code:
class PlainList {
public function PlainList( target:MovieClip, itemName:String, dataList:Object, margin:Number, xOffset:Number, yOffset:Number, rows:Number ){
//bunch'o'code here
}
public function draw( type:String ){
if ( type == "grid" ) PlainList.drawGrid( this );
else PlainList.drawList( this );
}
private static function drawGrid( pl:PlainList ){
//bunch'o'code here
}
private static function drawList( pl:PlainList ){
//bunch'o'code here
}
}
As I understand it, if I use static methods, the method is instantiated only once for the class and there is only one pointer to it. If I were using instance methods each method is uniquely instantiated with it's own memory space and pointer for ever instance of the class. Given that there could be thousands of class instances at a time each with 20-30 methods, does the technique described above make sense? Will I be saving memory? Is this bad OOP? And finally, although right now I am using AS2 in Flash 8, I will be updating to Flash 9 ASAP, any implications regarding AS3? For example, usage of the "protected" and "final" modifiers? Thanks.
View Replies !
View Related
Memory Leaks In Flash? Cus My Program Is Using Over 235,000kbs Of Memory
ANY HELP APPRECIATED as i've spent 2 days on this (started 2 days 3 hours ago)... please help me
I have only 16 images in my program, its a slideshow, all my images have a small image selection which on(rollOver) shows that image in a bigger screen, however when my program launches, I do ctrl + alt + del, and my memory usage for that swf file I made is at 235,000kb of memory, and my laptop can't handle it, (its 70mb) and the original .fla file is (70mb)
Is there anyway to fix this, I belive my scripts are leaking, I know for a fact, im not cleaning my locals... or globals...
if I declare a variable should I set it to null?
Question 1: Should I remove local variables? if so how do I do it?
Question 2: Should I remove global variables? if so how do I do it?
Question 3: Any other things I need to know?
this is my code for start up, which hides all images not in the first 4 places (which is suppost to be visible) the others are turned invisible...
Code:
_global.b = Array();
_global.end = 16;
_global.b[0] = btn_1;
_global.b[1] = btn_2;
_global.b[2] = btn_3;
_global.b[3] = btn_4;
_global.b[4] = btn_5;
_global.b[5] = btn_6;
_global.b[6] = btn_7;
_global.b[7] = btn_8;
_global.b[8] = btn_9;
_global.b[9] = btn_10;
_global.b[10] = btn_11;
_global.b[11] = btn_12;
_global.b[12] = btn_13;
_global.b[13] = btn_14;
_global.b[14] = btn_15;
_global.b[15] = btn_16;
_global.X = 40;
_global.Y = 30;
var t:Number = Array();
for (var i:Number = 0; i<4; i++)
{
t[i] = (i*100)+80;
}
for (var i:Number = 0; i<_global.end; i++)
{
var b = _global.b[i]._x;
_global.b[i]._x = (i*100)+t[0];
if (b != t[0] and b != t[1] and b != t[2] and b != t[3])
{
_global.b[i]._visible = false;
}
else
{
_global.b[i]._visible = true;
}
}
code for scrolling through my list of images (as it only shows 4 on the screen at one time)
basically, each image is 90 * 68 (width/height) the X position of the first image is 80, and it increments by 100 each time, until the 5th image, in which its 30, the start up code above, spaces them out by 100 (as I normally dont have enough room to fit 16+ images spaced out by 100) it also does other things
Basically, t gets the X position of last image... then
And basically hides and unhides images pending if they're X position is 80, 180, 280, 380...
Code:
on(release)
{
var t:Number = 0;
for (var i:Number = 0; i<_global.end; i++)
{
t = (i*100)+80;
}
for (var i:Number = 0; i<_global.end; i++)
{
if (_global.b[i]._x > 79)
{
if (_global.b[i]._x == 80)
{
_global.b[i]._visible = false;
_global.b[i]._x = t+100;
}
if (_global.b[i]._x > 579)
{
_global.b[i]._visible = false;
}
if (_global.b[i]._x == 480)
{
_global.b[i]._visible = true;
}
_global.b[i]._x -= 100;
}
}
}
The next code is for "enhancing" my images a little bit, it increases its Width & Height by 30 and 40... and decreases by that on rollOut / dragOut
(as you can dragOut and rollOut doesn't happen therefore I need it so you can't "increase" the image height & width without decreasing when your mouse moves off it)
Code:
on(rollOver)
{
gotoAndStop(2);
var b = btn_1
b._width = b._width + _global.X;
b._height = b._height + _global.Y;
b._x = b._x - X/2;
b._y = b._y - Y/2;
}
on(dragOut)
{
var b = btn_1;
b._width = b._width - _global.X;
b._height = b._height - _global.Y;
b._x = b._x + X/2;
b._y = b._y + Y/2;
}
on(rollOut)
{
var b = btn_1;
b._width = b._width - _global.X;
b._height = b._height - _global.Y;
b._x = b._x + X/2;
b._y = b._y + Y/2;
}
Thats it, they're basically 1 of each different thing I have... it basically stays the same, I have 32 images (large_1-16, and small_1-16)
They're exactly the same size, but I wasn't sure if I could use 1 image twice, for different things (they're size is 2500 * 1900 give or take a 100 or so)
View Replies !
View Related
Flash Usage?
Hi, I'm considering using FlashMX to create some aspects of my site.
What I want to do is use a flash navigation menu, but have the links load actual html webpages.
so I would have a navbar made in flash with links like Home|FAQ| etc..
Then when clicking on home(which btw will have a rollover) the window will reload the home page. If clicking on FAQ the window will load the HTML FAQ list.
So I guess my question is..can Flash send urls to the browser as urls, so that I won't have to create an entire flash site with flash content in place of html content?
Because I really am not skilled enough to go beyond menuse for the moment.
Any help will be awesome! thanks.
View Replies !
View Related
Flash XML Usage
I have an XML looking like this:
Code:
<item>
<beat>1<beat>
<greens>0</greens>
<reds>0</reds>
<yellows>0</yellows>
<blues>0</blues>
<oranges>0</oranges>
</item>
<item>
<beat>2<beat>
<greens>0</greens>
<reds>1</reds>
<yellows>0</yellows>
<blues>0</blues>
<oranges>0</oranges>
</item>
<item>
<beat>4<beat>
<greens>0</greens>
<reds>0</reds>
<yellows>0</yellows>
<blues>0</blues>
<oranges>1</oranges>
</item>
<item>
<beat>7<beat>
<greens>1</greens>
<reds>0</reds>
<yellows>0</yellows>
<blues>0</blues>
<oranges>0</oranges>
</item>
I want Flash to retrieve the information from this XML (beat1.xml, same folder as fla/swf). I have a variable in flash (_root.beatst) that'll correspond to one of the beat values in that XML. When it requests (on a button release), I would like to have Flash retrieve the corresponding greens, reds, blues, yellows, and oranges values from the XML and store them in same-named variables inside the flash.
Is this possible? If so, how?
EDIT: Another thing - I'd like to make it so that when the flash tries to look up a beat value that doesn't exist (like "3"), it returns 0 for all the color values.
View Replies !
View Related
Being Able To To See CPU Usage Of A Flash Application?
hey there..
im currenlty making a game in flash.
and im currenlty experimenting with a lot of stuff to make the game run better and faster on slower comps. but sometimes when doing small changes, or doing changes on for example a monster when only having 1 monster and not dozens of them, it can be very hard to know if the game actually runs faster than it did be4, and uses less cpu usage. so anyone know of a good and easy way to check this?
i know the task manager can do this, but it's very hard to see.
if u for example made a change which makes the appliaction use 1 less in the CPU usage, but when u check on the task manager, and it keeps changing from 60-80 for example, u cant rly see the difference. get my point?
so.. a good way of seeing it would be very apreciated
View Replies !
View Related
Sprite Usage In Flash MX 04
I was wondering if anyone has any tips on how to make flash movies using sprites such as Mega Man X. Mainly, I want to make my own side stories, using the same sprites in the official games. If there is such a site that explains it all, that would be GREATLY appreciated. I have Flash MX 2004.
View Replies !
View Related
Bitmap Usage In Flash MX 7.2
Hi,
There is a bitmap which "Fades in" at the end of a movie on the timeline and from the last frame it navigates to another movie that has the same bitmap inside it.
Now, the problem is : even though the same "bitmap dimensions" and x,y positions ( with both having the same jpg settings,etc ) are set in both the movies... there appears to be an unexpected shift in the bitmap position itself while moving from one movie to another.
Is this a problem with Flash rendering bitmaps or could anyone tell me the other possibilities for such a thing to happen?
Thanks,
Ram
View Replies !
View Related
|