|
查看: 1748|回复: 9
|
关于flash cs3 的 actionscript
[复制链接]
|
|
|
惨了。。。我一向是用flash mx的。
最近换了flash cs3,想做个button都难。
以前是选择了button的图,然后去action,写:
on (release) {
nextFrame();
}
button 就完成的。
可是现在的flash cs3,我选了button的图,去到action那里,却只看到:
“Current selection cannot have actions applied to it。”
请问各位大大,新的flash cs3是怎样做button 去另一个frame的啊? |
|
|
|
|
|
|
|
|
|
|
发表于 3-8-2008 10:24 AM
|
显示全部楼层
回复 1# 幽灵 的帖子
我想有两个solutions。
1。 把file save为 cs2 的format。那以前mx的script就可以用了。
2。 在cs3的button, 我的方式是给button一个instance Name。 比如说我的Button Instance Name 是 "nextBut"。
然后在mainstage的第一个keyframe写以下的script -
nextBut.onRelease = function ()
{
nextFrame();
}
你可以尝试以上方式看看.  |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 3-8-2008 04:30 PM
|
显示全部楼层
原帖由 HSONG 于 3-8-2008 10:24 AM 发表 
我想有两个solutions。
1。 把file save为 cs2 的format。那以前mx的script就可以用了。
2。 在cs3的button, 我的方式是给button一个instance Name。 比如说我的Button Instance Name 是 "nextBut"。
...
第一个方法刚刚试了,还是不能像以前那样。。。虽然能写scrip在button了,可是preview的时候,还是好像没有set 到酱。
第2个方法,昨天在网上找了类似的。。。
多加一个actions的layer。。。
stop();
button.addEventListener(MouseEvent.CLICK,launchbutton1);
function launchbutton1(event:MouseEvent) { nextFrame(); }
可是只可以去下一个frame,如果到了最后一个frame,要回到第一个frame,那么要怎么写啊? |
|
|
|
|
|
|
|
|
|
|
发表于 4-8-2008 11:14 AM
|
显示全部楼层
回复 3# 幽灵 的帖子
我讲的方式的actionscript不是code在button的。 你必需开一个新的layer, 然后把nextBut.onRelease = function ()
{
nextFrame();
}
paste 在里面。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 4-8-2008 07:39 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 5-8-2008 09:59 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 12-8-2008 04:33 PM
|
显示全部楼层
如果你在开始flash的时候选择了 action script 3.0, 就必须把你的coding 写在timeline上。
如果你不会action script 3.0, 我建议你选择action script 2.0 做。
你必须要检查如果 _currentFrame ==最后一个frame, 就gotoAndPlay(1);
如果你要用action script 3.0, 就必须先去study OOP ( Object Oriented Programming), 而且对于没有programming 底子的人来说不容易明白。 |
|
|
|
|
|
|
|
|
|
|
发表于 12-8-2008 09:18 PM
|
显示全部楼层
回复 7# inez 的帖子
|
hi inez... 你有什么好的Web Site Tutorial可以学AS3的吗? 我懂有很多,不过你有没有那一个可以推荐的? |
|
|
|
|
|
|
|
|
|
|
发表于 25-9-2008 10:29 AM
|
显示全部楼层
|
其实你说得很混淆....其实assign AS to button不会很难啊。你可以启用 Script Assist的功能,它可以帮你~~ |
|
|
|
|
|
|
|
|
|
|
发表于 27-10-2008 07:59 PM
|
显示全部楼层
要回一个frame就放
prevFrame()
要回到最前面frame就放
gotoAndStop(1) |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|