Question: Playing a #56

Closed
misugijunz opened this Issue Feb 5, 2014 · 11 comments

Projects

None yet

2 participants

@misugijunz

I've been sent a pack of image sequences in form of JPEGs that I import to flash to animate it. I tried LWFS but it don't accept the published swf from Flash tool. Is there a workaround to play the SWF using only its frame information?

Contributor
splhack commented Feb 5, 2014

Did you use "Publish for LWF"? LWFS automatically installs the command in Flash CS6 or CC, you can find "Publish for LWF" command in Flash "Commands" menu. Would you try it?

If you did use it, could you share your fla file?

@splhack splhack referenced this issue in splhack/Hello-LWF-Cocos2d-x Feb 5, 2014
Closed

[Compilation] Visual Studio 2012 #1

I got this error even after using the publishing script

D:/LWFS/LWFS/.a/lwfs/lib/swf2lwf/swf2lwf.rb:1998:in parse_define_button2' D:/LWFS/LWFS/.a/lwfs/lib/swf2lwf/swf2lwf.rb:2684:inparse_tags'
D:/LWFS/LWFS/.a/lwfs/lib/swf2lwf/swf2lwf.rb:2733:in parse_swf' D:/LWFS/LWFS/.a/lwfs/lib/swf2lwf/swf2lwf.rb:3496:inswf2lwf'
D:/LWFS/LWFS/.a/lwfs/lib/swf2res.rb:71:in swf2res' D:/LWFS/LWFS/.a/lwfs/lwfs.rb:638:inblock in convert'
D:/LWFS/LWFS/.a/lwfs/lwfs.rb:617:in each' D:/LWFS/LWFS/.a/lwfs/lwfs.rb:617:inconvert'
D:/LWFS/LWFS/.a/lwfs/lwfs.rb:390:in block (3 levels) in ' D:/LWFS/LWFS/.a/lwfs/lwfs.rb:373:incatch'
D:/LWFS/LWFS/.a/lwfs/lwfs.rb:373:in `block (2 levels) in '

here is the FLA: https://www.dropbox.com/s/jvaw5ww94l2cd3m/test.fla

Also, I've questions regarding Cocos2d-x LWF API especially about
eventhandler:

  1. How to make the animation stop when it enters specific frame/the end.
  2. Similar to (1), how to pause and continue at later time.
  3. How to create 2 different animation from one LWF, I mean I'd like to
    divide into several parts. For example 1a is a part of animation 1 which is
    not looped (frame 1 - 10) while otherwise 1b is looped (10-end).

Thank you for your assistance.

On Thu, Feb 6, 2014 at 1:27 AM, Kazuki Sakamoto notifications@github.comwrote:

Did you use "Publish for LWF"? LWFS automatically installs the command in
Flash CS6 or CC, you can find "Publish for LWF" command in Flash "Commands"
menu. Would you try it?

If you did use it, could you share your fla file?

Reply to this email directly or view it on GitHubhttps://github.com/gree/lwf/issues/56#issuecomment-34220778
.

Regards,

Oscar Kurniawan
http://about.me/oscarkm

Contributor
splhack commented Feb 5, 2014

Flash CC displays an error message for your data.

Symbol=Tween 18, layer=Layer 1, frame=1:Images exported for runtime sharing are not supported in buttons

In the root movie, frame 102, layer "daun 2", the type of the graphic object is "button". It should be "graphic". Could you fix and republish it?

How to make the animation stop when it enters specific frame/the end.

Write stop() in the frame action panel of the movie. Or you can use an event for stopping. Please take a look at http://www.cocos2d-x.org/forums/18/topics/40551?r=43216#message-43216 .

In action panel,

fscommand("event", stop);

And then

lwfNode->lwf->AddEventHandler("stop", [=](LWF::Movie *, LWF::Button *){
    lwfObject->lwf->StopMovie("_root");    
});

Similar to (1), how to pause and continue at later time.

for continuing,

lwfNode->lwf->NextFrameMovie("_root");

How to create 2 different animation from one LWF, I mean I'd like to divide into several parts. For example 1a is a part of animation 1 which is not looped (frame 1 - 10) while otherwise 1b is looped (10-end).

Set a label in the start of 1b. For example, "loop". And then write an action as the following in the end of 1b.

gotoAndPlay("loop");
@splhack splhack closed this Feb 5, 2014
@splhack splhack reopened this Feb 5, 2014

I got it working with slightly noticeable differences between the swf and
the produced lwf:

https://www.dropbox.com/s/jvaw5ww94l2cd3m/test.fla
https://www.dropbox.com/s/654wlrjoyib3w05/test.zip

with couple images part of spinning animation (frame by frame style) is not
rendered on LWF.

regarding the API

is there a way to capture Event.Enter_Frame (onEnterFrame) event in the API?

On Thu, Feb 6, 2014 at 4:24 AM, Kazuki Sakamoto notifications@github.comwrote:

Flash CC displays an error message for your data.

Symbol=Tween 18, layer=Layer 1, frame=1:Images exported for runtime sharing are not supported in buttons

In the root movie, frame 102, layer "daun 2", the type of the graphic
object is "button". It should be "graphic". Could you fix and republish it?

How to make the animation stop when it enters specific frame/the end.

Write stop() in the frame action panel of the movie. Or you can use an
event for stopping. Please take a look at
http://www.cocos2d-x.org/forums/18/topics/40551?r=43216#message-43216 .

In action panel,

fscommand("event", stop);

And then

lwfNode->lwf->AddEventHandler("stop", [=](LWF::Movie *, LWF::Button *){
lwfObject->lwf->StopMovie("_root");
});

Similar to (1), how to pause and continue at later time.

for continuing,

lwfNode->lwf->NextFrameMovie("_root");

How to create 2 different animation from one LWF, I mean I'd like to
divide into several parts. For example 1a is a part of animation 1 which is
not looped (frame 1 - 10) while otherwise 1b is looped (10-end).

Set a label in the start of 1b. For example, "loop". And then write an
action as the following in the end of 1b.

gotoAndPlay("loop");

Reply to this email directly or view it on GitHubhttps://github.com/gree/lwf/issues/56#issuecomment-34248586
.

Regards,

Oscar Kurniawan
http://about.me/oscarkm

the animation that is not rendered well is under "transisi" folder on the
fla. Thank you.

On Thu, Feb 6, 2014 at 9:44 AM, Oscar Kurniawan misugijunz@gmail.comwrote:

I got it working with slightly noticeable differences between the swf and
the produced lwf:

https://www.dropbox.com/s/jvaw5ww94l2cd3m/test.fla
https://www.dropbox.com/s/654wlrjoyib3w05/test.zip

with couple images part of spinning animation (frame by frame style) is
not rendered on LWF.

regarding the API

is there a way to capture Event.Enter_Frame (onEnterFrame) event in the
API?

On Thu, Feb 6, 2014 at 4:24 AM, Kazuki Sakamoto notifications@github.comwrote:

Flash CC displays an error message for your data.

Symbol=Tween 18, layer=Layer 1, frame=1:Images exported for runtime sharing are not supported in buttons

In the root movie, frame 102, layer "daun 2", the type of the graphic
object is "button". It should be "graphic". Could you fix and republish it?

How to make the animation stop when it enters specific frame/the end.

Write stop() in the frame action panel of the movie. Or you can use an
event for stopping. Please take a look at
http://www.cocos2d-x.org/forums/18/topics/40551?r=43216#message-43216 .

In action panel,

fscommand("event", stop);

And then

lwfNode->lwf->AddEventHandler("stop", [=](LWF::Movie *, LWF::Button *){
lwfObject->lwf->StopMovie("_root");
});

Similar to (1), how to pause and continue at later time.

for continuing,

lwfNode->lwf->NextFrameMovie("_root");

How to create 2 different animation from one LWF, I mean I'd like to
divide into several parts. For example 1a is a part of animation 1 which is
not looped (frame 1 - 10) while otherwise 1b is looped (10-end).

Set a label in the start of 1b. For example, "loop". And then write an
action as the following in the end of 1b.

gotoAndPlay("loop");

Reply to this email directly or view it on GitHubhttps://github.com/gree/lwf/issues/56#issuecomment-34248586
.

Regards,

Oscar Kurniawan
http://about.me/oscarkm

Regards,

Oscar Kurniawan
http://about.me/oscarkm

and I already tried several times to get the event handler working but it
didn't work. What I did.

  1. Let's say I've satuC object in which it is a LWFNode. I added the event
    handler code:
    satuC->lwf->AddEventHandler("halt", [=](LWF::Movie *, LWF::Button *){
    log("halt");
    satuC->lwf->StopMovie("_root");
    });
    I hope that it will stop on a certain frame.
  2. I added a layer of actions then I added an actionscript to a keyframe in
    the frame that I'd like the animation to stop/pause.and even a stop() ~just
    to make sure. But, unfortunately, it didn't stop when I played on my app.
    On the swf, it just stopped. I attached the fla on my previous email.
    Arigatou.

fscommand("event", "halt");

On Thu, Feb 6, 2014 at 10:01 AM, Oscar Kurniawan misugijunz@gmail.comwrote:

the animation that is not rendered well is under "transisi" folder on the
fla. Thank you.

On Thu, Feb 6, 2014 at 9:44 AM, Oscar Kurniawan misugijunz@gmail.comwrote:

I got it working with slightly noticeable differences between the swf and
the produced lwf:

https://www.dropbox.com/s/jvaw5ww94l2cd3m/test.fla
https://www.dropbox.com/s/654wlrjoyib3w05/test.zip

with couple images part of spinning animation (frame by frame style) is
not rendered on LWF.

regarding the API

is there a way to capture Event.Enter_Frame (onEnterFrame) event in the
API?

On Thu, Feb 6, 2014 at 4:24 AM, Kazuki Sakamoto <notifications@github.com

wrote:

Flash CC displays an error message for your data.

Symbol=Tween 18, layer=Layer 1, frame=1:Images exported for runtime sharing are not supported in buttons

In the root movie, frame 102, layer "daun 2", the type of the graphic
object is "button". It should be "graphic". Could you fix and republish it?

How to make the animation stop when it enters specific frame/the end.

Write stop() in the frame action panel of the movie. Or you can use an
event for stopping. Please take a look at
http://www.cocos2d-x.org/forums/18/topics/40551?r=43216#message-43216 .

In action panel,

fscommand("event", stop);

And then

lwfNode->lwf->AddEventHandler("stop", [=](LWF::Movie *, LWF::Button *){
lwfObject->lwf->StopMovie("_root");
});

Similar to (1), how to pause and continue at later time.

for continuing,

lwfNode->lwf->NextFrameMovie("_root");

How to create 2 different animation from one LWF, I mean I'd like to
divide into several parts. For example 1a is a part of animation 1 which is
not looped (frame 1 - 10) while otherwise 1b is looped (10-end).

Set a label in the start of 1b. For example, "loop". And then write an
action as the following in the end of 1b.

gotoAndPlay("loop");

Reply to this email directly or view it on GitHubhttps://github.com/gree/lwf/issues/56#issuecomment-34248586
.

Regards,

Oscar Kurniawan
http://about.me/oscarkm

Regards,

Oscar Kurniawan
http://about.me/oscarkm

Regards,

Oscar Kurniawan
http://about.me/oscarkm

Contributor
splhack commented Feb 6, 2014

the animation that is not rendered well is under "transisi" folder on the fla.

Because these objects are shape in transisi folder. You have to convert these shapes into bitmaps.
http://help.adobe.com/en_US/flash/cs/using/WSb03e830bd6f770ee1f9eac2b12da610f99a-7fff.html

is there a way to capture Event.Enter_Frame (onEnterFrame) event in the API?

Yes.

lwfNode->lwf->AddMovieEventHandler("movie_instance_name", {
    {"enterFrame", [=](LWF::Movie *m){
        log("enterFrame movie:%s currentFrame:%d", m->name.c_str(), m->currentFrame);
    }},
    // {"load", [=](LWF::Movie *m){ }},
    // {"unload", [=](LWF::Movie *m){ }},
});
Contributor
splhack commented Feb 6, 2014

I also converted your https://www.dropbox.com/s/jvaw5ww94l2cd3m/test.fla into lwf, it stops right frame which you added "stop();" action on.
screen shot 2014-02-06 at 10 50 41 am

And you can resume the animation as the following.

lwfNode->lwf->AddEventHandler("halt", [=](LWF::Movie *m, LWF::Button *){
    log("halt %d", m->currentFrame);
    lwfNode->lwf->NextFrameMovie("_root");
    lwfNode->lwf->PlayMovie("_root");
});

or

lwfNode->lwf->AddEventHandler("halt", [=](LWF::Movie *m, LWF::Button *){
    log("halt %d", m->currentFrame);
    m->NextFrame();
    m->Play();
});

You have to make sure the movie instance is exist if you are using LWF::Movie APIs (LWF::Movie::Play and so on). LWF::*Movie APIs (LWF::PlayMovie and so on) automatically uses movie load event for making sure the movie instance is exist.

But you should change the order of actions.

fscommand("event", "halt");
stop();

It means, the event occurred, the event handler executed, and then "stop()" action executed. Thus the movie will be stopped by "stop()" action even though the event handler execute Play() API for the movie.

stop();
fscommand("event", "halt");

It means, "stop()" action executed, the event occurred, and then the event handler executed.

I still can't get the event handler working. What is the LWFS version that
do you use? Can you send me link the LWF you converted. I'm suspecting that
the LWFS/LWF codes I used may be outdated.

On Fri, Feb 7, 2014 at 2:17 AM, Kazuki Sakamoto notifications@github.comwrote:

I also converted your https://www.dropbox.com/s/jvaw5ww94l2cd3m/test.flainto lwf, it stops right frame which you added "stop();" action on.
[image: screen shot 2014-02-06 at 10 50 41 am]https://f.cloud.github.com/assets/81904/2102499/a1c8c8b2-8f5f-11e3-9c03-14c7533c8fad.png

And you can resume the animation as the following.

lwfNode->lwf->AddEventHandler("halt", [=](LWF::Movie *m, LWF::Button *){
log("halt %d", m->currentFrame);
lwfNode->lwf->NextFrameMovie("_root");
lwfNode->lwf->PlayMovie("_root");
});

or

lwfNode->lwf->AddEventHandler("halt", [=](LWF::Movie *m, LWF::Button *){
log("halt %d", m->currentFrame);
m->NextFrame();
m->Play();
});

You have to make sure the movie instance is exist if you are using
LWF::Movie APIs (LWF::Movie::Play and so on). LWF::*Movie APIs
(LWF::PlayMovie and so on) automatically uses movie load event for making
sure the movie instance is exist.

But you should change the order of actions.

fscommand("event", "halt");
stop();

It means, the event occurred, the event handler executed, and then
"stop()" action executed. Thus the movie will be stopped by "stop()" action
even though the event handler execute Play() API for the movie.

stop();
fscommand("event", "halt");

It means, "stop()" action executed, the event occurred, and then the event
handler executed.

Reply to this email directly or view it on GitHubhttps://github.com/gree/lwf/issues/56#issuecomment-34359399
.

Regards,

Oscar Kurniawan
http://about.me/oscarkm

Contributor
splhack commented Feb 10, 2014

Ok, could you try the latest lwfs https://github.com/gree/lwfs ?

Contributor
splhack commented Mar 6, 2014

Any update?

@splhack splhack closed this Mar 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment