bugGnash - The GNU Flash player - Bugs: bug #24839, A particular flash file doesn't...

 
 

bug #24839: A particular flash file doesn't play correctly

Submitted by:  Chuck Crisler <chuckcrisler>
Submitted on:  Fri 14 Nov 2008 05:04:51 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 15 Nov 2008 01:31:20 PM UTC, comment #7:

The problem was in character::visible_getset(), which used the boolean value - to_bool() - of an as_value. This is version dependent, but for version 7 interprets all strings as true. So setting _visible to "0" was true, when it should be interpreted as false.

The fix means using the numerical value - to_number() - instead, so that "0", 0 and false become 0; "1" or true become 1; "8" is 8; and "string" is NAN.

We can check for NAN and inf, which should be understood as false, then everything else is the same as a C++ implicit cast to bool (0 is false, everything else true).

It makes the game much more fun, anyway.

Benjamin Wolsey <bwy>
Project Member
Sat 15 Nov 2008 10:30:49 AM UTC, comment #6:

_visible setter is called with string: 0, which Gnash interprets as true in to_bool().

It seems this is correct behaviour for boolean values: the as_value "0" is false in version 6 and true in 7 and 8 for both Gnash and Adobe, so I guess we shouldn't be using to_bool() here.

Benjamin Wolsey <bwy>
Project Member
Sat 15 Nov 2008 10:13:02 AM UTC, comment #5:

Sorry, I meant the other way round: _visible should be false, Gnash traces true.

Benjamin Wolsey <bwy>
Project Member
Sat 15 Nov 2008 10:09:07 AM UTC, comment #4:

Indeed if you do

trace(/btn1._visible);

immediately after setting /btn1._visible to 0, flashplayer traces true and Gnash false.

Nothing to do with /btn1 vs btn1, though.

Benjamin Wolsey <bwy>
Project Member
Sat 15 Nov 2008 09:57:20 AM UTC, comment #3:

Just numbers and strings.

The only thing that should stop you from clicking on a button is the _visible property, as far as I can see. I'm only guessing still, but I imagine the buttons are overlaid on the images and are made invisible by clicking. Only they don't become invisible.

Is the target syntax /btn2 likely to be a problem?

Benjamin Wolsey <bwy>
Project Member
Sat 15 Nov 2008 09:43:55 AM UTC, comment #2:

What types are in the _root.img array ?

Sandro Santilli <strk>
Project Member
Sat 15 Nov 2008 09:28:33 AM UTC, comment #1:

Gnash displays the bitmap if you click twice (should be on first click), and doesn't hide them again if you pick two different ones. After selecting six squares twice, you win.

It makes the game a bit unsatisfying.

Using listswf_d from ming, it's easy to see how the SWF is programmed.

if( (this._name=='btn2') ) {
/btn2._visible = 0; // I don't see what this is for.
_root.step++;
_root.step = _root.step; // Odd disassembly
_root.checking++;
_root.checking = _root.checking;
if( (_root.checking==1) ) {
_root.option1 = _root.img2[1];
_root.firstbtn = 'btn2';
} else {
if( (_root.checking>=2) ) {
_root.option2 = _root.img2[1];
_root.checking = 0;
_root.secondbtn = 'btn2';
_root.gotoAndPlay(4);
}
}
}

Each click should increment _root.checking. If this value is 1, it sets _root.option1. If it's 2, it sets _root.option2 and goes to frame 4, resetting _root.checking to 0. I guess frame 4 is supposed to check whether they are the same.

Frame 4 is probably:

Mouse.hide();
if( (_root.option1==_root.option2) ) {
++pair;
eval(firstbtn)._x = 1000;
eval(secondbtn)._x = 1000;
}

You probably win when pair has reached 6.

So the problem appears to be that Gnash is interpreting clicking twice on the same square as a pair and it's not displaying the bitmap on the first click. One of them might follow from the other.

Benjamin Wolsey <bwy>
Project Member
Fri 14 Nov 2008 05:04:51 PM UTC, original submission:

This specific flash file doesn't work properly. It properly displays a 4x4 grid. You are supposed to pick 2 successive squares of the same fruit (that is hidden). However, when you pick the squares, they don't display the bitmap that is hidden. This does work with the flash plug-in in FireFox.

Chuck Crisler <chuckcrisler>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #16843:  Memory.swf added by chuckcrisler (7KiB - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by bwy (Posted a comment)
  • -unavailable- added by chuckcrisler (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 26 Nov 2008 10:18:48 AM UTCbwyStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 15 Nov 2008 01:31:20 PM UTCbwyStatusNone=>Ready For Test
    Fri 14 Nov 2008 05:04:51 PM UTCchuckcrislerAttached File-=>Added Memory.swf, #16843

    Back to the top


    Powered by Savane 3.1-cleanup1