|
From: | Matthew Morgan |
Subject: | Re: [Swftools-common] show sprite then delete |
Date: | Fri, 30 Oct 2009 12:23:04 -0400 |
User-agent: | Thunderbird 2.0.0.23 (X11/20090817) |
Chris Pugh wrote:
Ah! I got it! I had to use the Key object. I'm not sure how on_key works, but I never figured it out. If any body else is interested, I've attached the example I came up with.Attached is a simple example with a button trigger. Press shows, Release removes. [ Watch what happens when you change the version number., say version=10 ;o) ] HTH. Regards, Chris.
2009/10/29 Matthew Morgan <address@hidden>:I've been playing around with swfc for the past couple of days, looking though the examples online, and I can't quite seem to accomplish what I need to do. I just need to show a sprite, and when a key is pressed, remove it and show another sprite instead. I've tried several different things, and I can't figure out how to get it to work. Can anyone give me just a basic skeleton of what that might look like?
--*“* When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." *”*
-Linus Torvalds
.flash filename="sprite2.swf" bbox=300x200 version=8 fps=50 compress .box blue_box color=green width=25 fill=blue height=25 .box red_box color=green width=25 fill=red height =25 .sprite box .put blue_box x=0 y=0 .end .sprite box2 .put red_box x=0 y=0 .end .action: _root.attachMovie("box","bl_box",2); keyListener = new Object(); keyListener.onKeyDown = function(){ bl_box.unloadMovie(); _root.attachMovie("box2", "rd_box", 2); }; Key.addListener(keyListener); .end .end
[Prev in Thread] | Current Thread | [Next in Thread] |