Posts

Showing posts with the label actionscript-3

Alert/ Dialog box in AS3

Alert/ Dialog box in AS3 I am working on a app using Adobe flash Builder which should pop up a Alert window once a particular event has been triggered. Another event needs to be called when the Alert box is closed. But I do not see the Alert class in mx.controls library. It seems like the class (which existed in AS2) has been removed from AS3. Is there any other way to accomplish the same functionality? Thanks, Pritesh You are mistaken. Alert has never been removed. – RIAstar May 16 '12 at 15:59 Alert Maybe. can you please post some links or examples on Alert in AS3? – 22kar May 16 '12 at 16:21 Pure AS3 doesn't have alert it's a Flex component. After ...

Action Script 3 - ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller

Action Script 3 - ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller I'm following this tutorial for Action Script 3 on http://markbennison.com/actionscript/as3-space-shooter/2-coding-projectiles/ I'm on part 2 Coding projectiles I don't know why its saying Error all the time when I press play "ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller." Here's the exact code im trying to work through to shoot bullets when spacebar is pressed, there are more but idk how to fix the Argument Error. function addBullet(startX, startY): void { //declare an object instance from the bullet Class var b: Bullet = new Bullet(); //set the new bullet's x-y coordinates b.x = startX; b.y = startY; //add the new bullet to the stage stage.addChild(b); //store the object in an array bullets_arr.push(b); } function moveBullet(): void { //loop through all instances of the bullet //loop from '0' to 'num...

getting error TypeError: Error #1009: Cannot access a property or method of a null object reference

getting error TypeError: Error #1009: Cannot access a property or method of a null object reference I'm trying to call a function on two buttons nav1or2.navi1.navBtn1.addEventListener(MouseEvent.CLICK, goSmall); nav4.navi4.navBtn4.addEventListener(MouseEvent.CLICK, goSmall); function goSmall(event:MouseEvent):void { gotoAndPlay(41); } the second button nav4.navi4.navBtn4.addEventListener(MouseEvent.CLICK, goSmall); is not working and i m getting this TypeError: nav4.navi4.navBtn4.addEventListener(MouseEvent.CLICK, goSmall); Error #1009: Cannot access a property or method of a null object reference. please help. Can you show some more of your code? Is nav4.navi4.navBtn4 on the displaylist when you try to add the listener? – putvande Aug 9 '13 at 13:57 nav4.navi4.navBtn4 this is the code only, of if nee...