gree / lwf

LWF - Lightweight SWF
http://gree.github.com/lwf/
zlib License
627 stars 167 forks source link

Switch Animation with label #43

Closed asweare closed 10 years ago

asweare commented 10 years ago

Hello,

recently I am trying to switch animation by label,

luckly I found great example by you guys,

I took at look at the sample and follow exactly same step,

in Flash, and Unity,

when I did simple version with only two images,

it seems to work fine,

so I did it with much more complicated work,

but it just doesn't work , and I have no clue how to fix it.

I used exact same script and everything else in the unity,

do you think you can take a look at my flash file??

my flash file is at

https://www.dropbox.com/s/uj802oj27mh12eg/dragon02.zip

thank you so much for helping me out

splhack commented 10 years ago

The movieclip, which you want to control, should have instance name like "kaiju". screen shot 2013-12-04 at 9 42 13 am

Movie kaiju = lwf["kaiju"];
if (kaiju != null) {
    kaiju.GotoAndPlay("dd_joy01");
}
asweare commented 10 years ago

wow, thank you so much for reply, i tried, to do it for my self, but i couldn't get it to work :(

do you you can give more details on the script ?

this is script i tried to use...

i am designer, i am don't really know much about the script,

so it would be great if u can give me lot more details,

thank you :)


public class kaij : LWFObject // Use this for initialization void Start () {

 Load("switch_animation_with_label.lwfdata/switch_animation_with_label", "switch_animation_with_label.lwfdata/");

if (kaiju != null) {
kaiju.GotoAndPlay("dd_joy01");

}

}
splhack commented 10 years ago
public class kaij : LWFObject
// Use this for initialization
void Start () {
    Load("switch_animation_with_label.lwfdata/switch_animation_with_label", "switch_animation_with_label.lwfdata/");
    GotoAndPlayMovie("kaiju", "dd_joy01");
}

GotoAndPlayMovie, the first argument is the instance name, which you want to control. the second argument is the label name or the frame number that is 1 origin as Flash.

(totally forgot about my own implementation :)

asweare commented 10 years ago

it works perfectly thank you so much !!