movieclip

AS3: Error 1009:

£可爱£侵袭症+ 提交于 2019-12-26 07:44:58
问题 In a little game I have to make for college I render a menu at runtime, using movieclips i made of buttons i drawed in illustrator. I imported the illustrator file in flash professional like I always do, and made a AS linkage like I do with my other movieclips that run fine. But when I try to render these buttons I get a error 1009, a null reference. I use AS3 by the way. private function initMenuComponents():void{ var btnPlay:MovieClip = new Play(); var btnOptions:MovieClip = new Options();

AS3: Error 1009:

狂风中的少年 提交于 2019-12-26 07:44:11
问题 In a little game I have to make for college I render a menu at runtime, using movieclips i made of buttons i drawed in illustrator. I imported the illustrator file in flash professional like I always do, and made a AS linkage like I do with my other movieclips that run fine. But when I try to render these buttons I get a error 1009, a null reference. I use AS3 by the way. private function initMenuComponents():void{ var btnPlay:MovieClip = new Play(); var btnOptions:MovieClip = new Options();

AS3: Error 1009:

你。 提交于 2019-12-26 07:42:06
问题 In a little game I have to make for college I render a menu at runtime, using movieclips i made of buttons i drawed in illustrator. I imported the illustrator file in flash professional like I always do, and made a AS linkage like I do with my other movieclips that run fine. But when I try to render these buttons I get a error 1009, a null reference. I use AS3 by the way. private function initMenuComponents():void{ var btnPlay:MovieClip = new Play(); var btnOptions:MovieClip = new Options();

access dynamically loaded movieclip (stage > scrollpane > myloader > movieclip)

独自空忆成欢 提交于 2019-12-25 04:17:59
问题 what I'm trying to do is accessing snapText = scrollPane.source.textSnapshot; from an external swf. I've tried: trace("-->: "+scrollPane.source.textSnapshot.getText(0, 1000)); trace("-->: "+myLoader.content.textSnapshot.getText(0, 1000)); trace("-->: "+mc.textSnapshot.getText(0, 1000)); trace("-->: "+mc.getChildAt(0).textSnapshot.getText(0, 1000)); trace("-->: "+mc.getChildByName(myLoader).textSnapshot.getText(0, 1000) ); trace("-->: "+scrollPane.content.textSnapshot.getText(0, 100)); all of

AS3 : MovieClip script stop when done playing

岁酱吖の 提交于 2019-12-25 01:35:25
问题 I am a beginner with AS3 and I'm having a problem with MovieClip class. I have a character that move through a simple script that handles collision, sound etc. Everything was working seemlessly so far but when I started adding animation, the character would stop at the end of the animation cycle. Does someone comfortable with AS3 knows what's wrong here ? Thanks in advance =) 回答1: Inside the Flash IDE, try clicking the instance of your character that's not looping the way you want it to (and

AS3 - Access MovieClip from stage within a class

坚强是说给别人听的谎言 提交于 2019-12-24 16:42:30
问题 I have been stuck on this for a long time and have looked at past questions on here about this similar issue such as this post: How do I access a movieClip on the stage using as3 class?. I use the constructor to listen for the ADDED_TO_STAGE event, and then initiate the main function to set up the eventListeners from the ADDED_TO_STAGE handler. Within the same handler I also try to get a MovieClip from the stage using the following code: player = stage.getChildByName("player") as MovieClip;

Get MovieClip in another frame

試著忘記壹切 提交于 2019-12-24 14:29:52
问题 I'm in frame 1 of a movie, and I want to use getChildByName("mc_movieclip"); to get a reference to mc_movieclip. The problem is that mc_movieclip does not exist in frame 1 but only in frame 5. How can I get a reference to this MovieClip, even though it's in another frame? 回答1: The easiest way to fix this is that you put a copy of mc_movieclip on frame 1 and make it hidden. mc_movieclip.visible=false will do the trick. Note: if your mc has animation (in its timeline) then you have to restart

How can I trigger a function at Main from an instanced object — the right way?

时间秒杀一切 提交于 2019-12-24 06:47:09
问题 I want to keep total control over my game from the Main MovieClip and nowhere else. But I don't want to pass its instance through constructors neither do any .parent reference thingy from its children. Seems too workaroundish and unstable. A sample situation: public class Main extends MovieClip { public function Main() { addChild(new MainMenu()); } public function startGame():void { trace("Game started"); } } public class MainMenu extends Sprite { public function MainMenu() { var option

Targeting multiple MovieClips which have the same instance name

元气小坏坏 提交于 2019-12-23 05:19:49
问题 On the stage, I have 3 MovieClips who have the same instance name, which is zeroMC but all three are an instance of different MovieClips. The first zeroMC is an instance of blank1,the second zeroMC is an instance of blank2 and the third zeroMC is an instance of blank3. I want to make all three movieclips gotoAndStop at 2, but when I do zeroMC.gotoAndStop(2); only one goes to and stops at 2. I also tried var containers = [zeroMC, zeroMC, zeroMC]; for (var i:int = 0; i<containers.length; i++) {

How to maintain a movieclip's color between frames?

流过昼夜 提交于 2019-12-20 06:27:48
问题 My app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target's color change and go to the next frame 2. In frame 2 I have a button to return to frame 1. How can i maintain the MC color when I return to frame 1? public class test extends MovieClip { public function test() { var myMCTable:Array = [myMC1, myMC2, myMC3, myMC4, myMC5]; for (var i:uint = 0; i < myMCTable.length; i++) { myMCTable[i].doubleClickEnabled = true; myMCTable[i].addEventListener(MouseEvent.DOUBLE