bugGnash - The GNU Flash player - Bugs: bug #27050, SWF6: unloadMovie unimplemented

 
 

bug #27050: SWF6: unloadMovie unimplemented

Submitter:  Sandro Santilli <strk>
Submitted:  Fri 17 Jul 2009 08:04:12 PM UTC
   
 
Category:  ActionScript Severity:  3 - Normal
Release:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 24 Aug 2009 03:39:45 PM UTC, comment #6: 

Another difference I spotted is about onEnterFrame calls.
When removeMovieClip is used, no onEnterFrame is invoked.
When unloadMovie is used, the first onEnterFrame is used.

See this:

createEmptyMovieClip('a', 1);
a.onEnterFrame = function() {
        trace(this+' enter frame');
};
a.createEmptyMovieClip('b', 2);
a.b.onEnterFrame = function() {
        trace(this+' enter frame');
};
a.b.onUnload = function() {
        trace(this+' unload');
};

a.removeMovieClip();
a.unloadMovie();

Sandro Santilli <strk>
Group Member
Fri 24 Jul 2009 10:56:05 AM UTC, comment #5: 

Another thing to keep in mind is that unloadMovie'ed clips
must NOT be removed from DisplayList on ::removeUnloaded.

I think we'll need to extend the _unloaded flag to support
multiple states:

 0: normal/loaded/??
 1: unloaded (not to be destroyed automatically on next frame)
 2: removed (to be destroyed automatically on next frame)
 3: destroyed

'unloaded' is a state as onUnload is not called again
if you unloadMovie a clip twice. Still, you can scribble
on an unloaded (unloadMovie) character with no problems
and it's still accessible by name at same depth.

You can definitely find unloaded (state 1) movies in the non-removed zone, so DisplayList::display (and very likely
other places) need to be updated to expect that.

Sandro Santilli <strk>
Group Member
Mon 20 Jul 2009 08:28:27 PM UTC, comment #4: 

Other difference: onUnload doesn't really destroy the DisplayObject, but only its contents, compare the following:

        createEmptyMovieClip('a', 1);
        a.onUnload = function() { trace('unloaded'); };
        _root.onUnload = function() { trace('unloaded _root'); };

        a.lineStyle(10, 0);
        a.moveTo(100, 100);
        a.lineTo(200, 200);

        trace(a.getBounds().xMin);

        a.removeMovieClip();
        a.unloadMovie();

        fun = function() {
                trace("fun, a is "+typeof(a));
                a.loadMovie('green.jpg');
        };

        setTimeout(fun, 1);
        trace(a.getBounds().xMin);

The removeMovieClip vs. unloadMovie.
Make sure green.jpg is in the same dir the .as above is.
You'll notice that after a.unloadMovie you can still load into it
while 'a' is undefined after removeMovieClip.

Sandro Santilli <strk>
Group Member
Mon 20 Jul 2009 08:18:31 PM UTC, comment #3: 

I've found the first difference:
::removeMovieClip will NOT remove static characters
while ::unloadMovie will (try replacing a.unloadMovie with _root.unloadMovie and compare with _root.removeMovieClip)

Sandro Santilli <strk>
Group Member
Mon 20 Jul 2009 07:48:10 PM UTC, comment #2: 

It seems that the bug exposed by my patch is indeed also a bug for the .removeMovieClip case. That is getBounds still return the full bounds of an unloaded/removed clip before it really gets destroyed.
A simple testcase:

 createEmptyMovieClip('a', 1);
 a.onUnload = function() { trace('unloaded'); };
 
 a.lineStyle(10, 0);
 a.moveTo(100, 100);
 a.lineTo(200, 200);
 
 trace(a.getBounds().xMin);
 
 a.removeMovieClip();
 //a.unloadMovie();
 
 trace(a.getBounds().xMin);
 
You'll notice NO difference in the removeMovieClip and unloadMovie. If anyone feels like trying harder to make them different it will help.

Sandro Santilli <strk>
Group Member
Sat 18 Jul 2009 07:36:51 AM UTC, comment #1: 

I found out that the testsuite gives a failure with this
patch applied:

FAIL: astests-v8-Runner: expected: 101 obtained: 6710886.35 [/usr/src/gnash/gnash-head/testsuite/actionscript.all/MovieClip.as:898]

Sandro Santilli <strk>
Group Member
Fri 17 Jul 2009 08:04:12 PM UTC, original submission:  

Attached is a wonderful game which suffer from a blinking
wording not going away. UNIMPLEMENTED unloadMovieclip sounded
like the culprit so I tried implementing that as MovieClip.unload() and indeed fixed that game.

Well, this bug is a reminder as I don't have time to do the
fix properly, but for sure this version does fix that game

Sandro Santilli <strk>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #18432:  unloadMovie.patch added by strk (377B - text/x-diff)
file #18431:  paci.swf added by strk (79KiB - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-17 strk CategoryNone ActionScript
    2009-07-17 strk Attached File- Added paci.swf, #18431
        Attached File- Added unloadMovie.patch, #18432

    Back to the top

    Powered by Savane 3.13-5884.
    Corresponding source code