I have a small actionscript problem. My final one until my game is complete.
I'm looking to get and receive variables from and to a movieclip.
I have given my movieclip and instance name of 'timeclip' and am trying to send to it that
var paused:Boolean = false() and trying to receive the variables
minutes and seconds from my movieclip.
Currently my code looks like this -
timeclip (movieclip)
Code:var startingTime:int = getTimer (); if (!paused){ addEventListener(Event.ENTER_FRAME, calculateDifference); function calculateDifference (event:Event){ var timePassed:int = getTimer() - startingTime; var seconds:int = Math.floor (timePassed / 1000); var minutes:int = Math.floor (seconds / 60); seconds -= minutes * 60; if (seconds < 10){ timeText.text = String ("You've been playing for: " + minutes +":0" + seconds); } else if (seconds >= 10){ timeText.text = String ("You've been playing for: " + minutes + ":" + seconds); } } }
Main stage
I am currently recieving the errorCode:stop() timedisplay.text = String ("You've been playing for: " + timer.minutes + ":" + timeclip.seconds); var paused:Boolean = false;
1120: Access of undefined property paused.




Reply With Quote