As3 Error #1069 Property Not Found
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AS3- ReferenceError: Error #1069: Property not found up vote 0 down vote favorite Can someone tell me why I get this error? ReferenceError: Error #1069: Property roll_mc not found on com.usmanzubairi.theAges.TheAges and there is no default value. at com.usmanzubairi.theAges::PirGame/rolling() package com.usmanzubairi.theAges { import flash.display.MovieClip; import flash.events.*; import flash.media.*; public class TheAges extends MovieClip { private var game:PirGame; private var game2:PreGame; private var game3:SupGame; public function TheAges() { stage.addEventListener(MouseEvent.CLICK, startGame); } private function startGame(event:Event):void { if (event.target != player_btn) { removeEventListener(MouseEvent.CLICK, startGame); game = new PirGame(); addChild(game); } else { addChild(player_mc); player_mc.visible = true; player_mc.play(); } if (event.target == player_mc.tom_mc) { removeEventListener(MouseEvent.CLICK, startGame); game2 = new PreGame(); addChild(game2); } if (event.target == player_mc.pete_mc) { removeEventListener(MouseEvent.CLICK, startGame); game = new PirGame(); addChild(game); } if(event.target == player_mc.sam_mc) { removeEventListener(MouseEvent.CLICK, startGame); game3 = new SupGame(); addChild(game3); } } public function gameOver():void { removeChild(game); game = null; stage.addEventListener(MouseEvent.CLICK, startGame); } } } Here's the PirGame document class code: package com.usmanzubairi.theAges { import flash.utils.Timer; import flash.events.*; import flash.display.*; import flash.geom.Matrix; import flash.net.SharedObject; public class PirGame extends MovieClip { public function PirGame() { addEventListener(MouseEvent.CLICK,rolling); } private function rolling (event:Event):void { if (event.target == MovieClip(root).roll_mc) { addChild(roll) roll.visible = true; runner_mc.visible = false; roll.play(); } } } } Thanks. actionscript-3 flash share|improve this question asked Feb 18 '14 at 11:50 user3302134 112 Are you going to
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AS3: http://stackoverflow.com/questions/21852864/as3-referenceerror-error-1069-property-not-found ReferenceError: Error #1069: up vote 0 down vote favorite I'm trying to load a sound file into my Flash project. I keep getting this error however. ReferenceError: Error #1069: Property COMPLETE not found on flash.events.Event and there is no default value. at LoadSND/soundLoaded()[C:\Users\Admin\Desktop\Final Project\LoadSND.as:38] The relevant code: package { import flash.events.*; import flash.media.*; import flash.net.URLRequest; public class LoadSND { //declare variables private var sndTrack: http://stackoverflow.com/questions/26581148/as3-referenceerror-error-1069 Sound; private var sndChannel: SoundChannel; private var sndVolume: Number; private var newTrack: String; private var canRepeat: Boolean; public function LoadSND(myTrack: String, myRepeat: Boolean = true) { // constructor code // set a default volume and track sndVolume = 0.5; setTrackData(myTrack, myRepeat); } private function loadSound(): void { // first stop all old sounds playing SoundMixer.stopAll(); // create a new sound for the track and a new sound channel sndTrack = new Sound(); sndChannel = new SoundChannel(); // load the required sound sndTrack.load(new URLRequest(newTrack)); // when loaded – play it; sndTrack.addEventListener(Event.COMPLETE, soundLoaded); } private function soundLoaded(Event): void { // finished with this listener so remove it sndTrack.removeEventListener(Event.COMPLETE, soundLoaded); // call the play sound function playSound(); } private function playSound(): void { // assign music to the musicChannel and play it sndChannel = sndTrack.play(); // setting the volume control property to the sound channel sndChannel.soundTransform = new SoundTransform(sndVolume, 0); // but add this one to make repeats sndChannel.addEventListener(Event.SOUND_COMPLETE, playAgain); } private function playAgain(Event): void { // remove this listener and repeat playSound() sndChannel.removeEventListener(Event.SOUND_COMPLETE, playAgain); playSound(); } private function setTrackData(myTrack: String, myRepeat: Boolean): void { // update the new track information n
using your existing account on the new forums, check out this thread. Register Help Remember Me? Forum Today's Posts FAQ Calendar Forum Actions Mark Forums Read https://www.kirupa.com/forum/showthread.php?363764-ReferenceError-Error-1069 Quick Links View Forum Leaders What's New? Advanced Search Forum Flash ActionScript 3 [Flash] ReferenceError: Error #1069? Results 1 to 5 of 5 Thread: ReferenceError: Error #1069? Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode April 19th, 2011,10:24 PM #1 Varixable View Profile View Forum Posts 2 as3 error posts Registered User ReferenceError: Error #1069? Hey guys I'm completely new to flash and I'm building a website right now. I'm trying to get my buttons to function with my pages, but I keep getting this error, and nothing but a continuous loop of my pages content. "ReferenceError: Error #1069: Property num not found on flash.text.TextField and there is no default value. at streetlightfinal_fla::MainTimeline/onclk()" as3 error #1069 What am I doing wrong? Here's my code. Code: stop(); function makebutton(mc:MovieClip, num:int):void{ mc.addEventListener(MouseEvent.CLICK, onclk); mc.buttonMode=true; mc.num=num; } function onclk(e:MouseEvent):void{ pages.gotoAndStop(e.target.num); } makebutton(home_btn,1); makebutton(bio_btn,2); makebutton(gallery_btn,3); makebutton(music_btn,4); Reply With Quote April 19th, 2011,10:35 PM #2 Krilnon View Profile View Forum Posts Visit Homepage 10,065 posts ≈ ≠ = Try using e.currentTarget. Reply With Quote April 19th, 2011,10:39 PM #3 Varixable View Profile View Forum Posts 2 posts Registered User Originally Posted by Krilnon Try using e.currentTarget. IT WORKED! You sir are a gentleman and a scholar. Reply With Quote April 19th, 2011,10:52 PM #4 Krilnon View Profile View Forum Posts Visit Homepage 10,065 posts ≈ ≠ = The error you were seeing occurred because of the way the event system works. Presumably you have a TextField inside of your button that acts as a label or something. When you click on the button, it's also quite likely that you're also clicking on the TextField inside of it, which becomes the target of the event because it's more specifically what you clicked on. currentTarget is changed by the event dispatcher to be the relevant object before each handler is called. Reply With Quote