3

I want to jump to a specified frame in an animation to show different stages.

With the original SWF-file this works fine when I call a Javascript function

Here is the original HTML code:

<OBJECT id="flashname" data="'.$flashmovie.'"  type="application/x-shockwave-flash" width="600" height="332">
    <PARAM NAME=movie VALUE="'.$flashmovie.'"> 
    <PARAM NAME=quality VALUE=autohigh>
    <PARAM NAME=bgcolor VALUE=#FFFFFF>
    Your Browser is not able to show this object.
</OBJECT>

In javascript I simply called:

flashname.TGotoFrame('_flash0',frameNumber);

Now I have a Swiffy HTML file and would like to have the same effect. But it doesn't work.

The swiffyobject is shown, but always the first frame. I could not switch to another frame by default.

I tried

var stage = new swiffy.Stage(document.getElementById('flashname'), swiffyobject, {  });

stage.start();
stage.gotoAndStop("frame");
stage.flashname.TGotoFrame('_flash0', 1);
stage.TGotoFrame('_flash0', 1);
flashname.TGotoFrame('_flash0', 1);

Any Ideas how to solve this problem?

M S
  • 31
  • 2

2 Answers2

2

As of current Swiffy runtime v7.3:

stage.Ka.N.o.gotoAndStop(frameNumber)

EDIT: Swiffy runtime v7.4 stage.Ga.O.s.gotoAndStop

Note: "o" is sort of root. _level0 and etc are accessible under "o".

How I found it: By looking for the constructor of the prototype that had gotoAndStop() and family and set debugger breakpoints. Then I traversed up the call stack (in debugger: step out, step into constructors referencing object if applicable, repeat) to find where it was being created and then referenced.

It would be nice if Apple and Google would open source parts of Swiffy so it can be hacked/customized/improved. If anyone knows how to contact them about this, please post.

user120242
  • 14,918
  • 3
  • 38
  • 52
  • This is exactly the kind of information I was looking for, thanks. As you note, it would be great if Google open sourced this, and I'd be pleased if they'd at least give some decent documentation for things like this... and put a top level alias to this object that we could rely on rather than have it potentially change with every build of swiffy. – Hudson Dec 18 '15 at 18:10
0

stage.Ka.N.o.gotoAndStop(frameNumber)

And as requested user120242 I give a link that explains the features in Swiffy https://gist.github.com/trongthanh/3095503

S.Alfano
  • 21
  • 9