Skip to main content
Participant
December 3, 2009
Question

Hope Flash can Release the Ram in the further

  • December 3, 2009
  • 3 replies
  • 447 views

For Example 1:

i had 2 Timeline in Same Line Scripting.

Timeline : [a1] [a2]

[Timeline a1]

stop();

this.addEventerListener(Event.ENTER_FRAME,dosomething);

function dosomething(e:Event) {

     trace("it doing");

}

gotoAndStop(2);

[Timeline a2]

stop();

When it gotoAndStop(2) , Event Listener also is running.Ram cant release there.

Another Exmaple 2

If my TimeLine like that , not release ram is correct,that is my suggestion

Timeline :

[a1      ]

[a2][a2]

[Timeline a1]

stop();

this.addEventerListener(Event.ENTER_FRAME,dosomething);

function dosomething(e:Event) {

     trace("it doing");

}

gotoAndStop(2);

In Example 2, "it doing " output is correct.

But In Example 1 , "it doing" output of Event is wrong , because i no need use that Event anymore...

This topic has been closed for replies.

3 replies

_Godmark_Author
Participant
December 4, 2009

Hi all ,

i know what you talking about that , my main point is "suggestion"

something Like MovieClip Loader , when i include another swf , and this swf has a Event

When Main Swf unload this swf also the Event is running,

And I know what is weak reference too.

When i develop big project , i need release a lot of event or develop own class to remark all Event

Event just a most of one

something like dictionary with weak reference, when i try GC , it also can trace the data , havn't release any ram

Timeline just one suggestion

like .net , it can use the "using" or "Dispose" to release the function all ram when it end

When a create Object reference it many place , never release with GC , and need develop many code to free it

I Know any coding , in there i just suggest for futher part

Thanks,

Godmark

December 3, 2009

>>because i no need use that Event anymore...

Then remove the listener. If you don't remove it, or use weak references so it can be garbage collected then it will continue to run - as it should.

December 3, 2009

well that is the thing with the movieClips and why sprites were created.  see a movieClip has a timeline and will always play its timeline.

the only reason you get the event is because you are listening to it.  By listening to it you are using the memory as well as slowing down the screen update.

true this is only a few fractions of a second, but this can all add up which is why chosing the proper class to use in each instance is very importatnt.

if you were to use a sprite, and use a timer, you no longer need event frames.

and you can kill the timer when you need.

The problem is that the adobe team, (my opinon) is too focused on the future technologies rather than correcting their current issues with the player because they want it to also be backwards compatible.

Consider this, if the population is 98% flash player 10 why continue to offer player 4 on their website if you search for it.  only push for flash 10 and that way they can continue to correct their issues.

They cant decide whether to make a flash release for designers or for the developers.  CS4 was a total waste of my time.

I suppose only time will tell.