Copy link to clipboard
Copied
I'm new to using Adobe Flash and need some help. What does static type class mean?
static text is text that's entered into the authoring environment. it is text that will not change (hence, static) during runtime.
contrast that with dynamic text which is text that is assigned using actionscript and can change any time actionscript executes.
Copy link to clipboard
Copied
static text is text that's entered into the authoring environment. it is text that will not change (hence, static) during runtime.
contrast that with dynamic text which is text that is assigned using actionscript and can change any time actionscript executes.
Copy link to clipboard
Copied
so if i get an error to do with a reference to a static type class with the following code, what do I need to change?
import flash.events.Event;
var boookSpeed:int = 15;
var myBoook:Boook = new Boook();
addChild(myBoook);
myBoook.x = -50;
myBoook.y = 355;
myBoook.addEventListener(Event.ENTER_FRAME, moveBoook);
function moveBoook(e:Event):void {
if(myBoook.x > 1050) {
boookSpeed = -boookSpeed;
myBoook.scaleX = -1;
}
if(myBoook.x < -50) {
boookSpeed = -boookSpeed;
myBoook.scaleX = 1;
}
myBoook.x += boookSpeed;
}
start_mc.start_btn.addEventListener(MouseEvent.CLICK, startGame);
function startGame():void {
start_mc.visible = false;
addBoook();
}
function stopGame():void {
}
function resetGame():void {
}
Copy link to clipboard
Copied
to debug almost all errors in flash, start by clicking file>publish settings>swf and tick "permit debugging". restest.
the problematic line number will be in the error message allowing you to pinpoint the line of code that needs to be corrected.
if you need more help than that, copy and paste the exact error message and indicate the line of code causing the error.
Copy link to clipboard
Copied
Okay, so I've erased the previous error but now have another. The following code gives me these errors;
Scene 1, Layer 'Actions', Frame 1, Line 33, Column 2 1120: Access of undefined property start_btn.
Scene 1, Layer 'Actions', Frame 1, Line 28, Column 1 1120: Access of undefined property start_btn.
________
import flash.events.Event;
import flash.events.MouseEvent;
instructions_mc.visible = false;
var boookSpeed:int = 15;
var myBoook:Boook = new Boook();
//addChild(myBoook);
myBoook.x = -50;
myBoook.y = 355;
myBoook.addEventListener(Event.ENTER_FRAME, moveBoook);
function moveBoook(e:Event):void {
if(myBoook.x > 1050) {
boookSpeed = -boookSpeed;
myBoook.scaleX = -1;
}
if(myBoook.x < -50) {
boookSpeed = -boookSpeed;
myBoook.scaleX = 1;
}
myBoook.x += boookSpeed;
}
start_btn.addEventListener(MouseEvent.CLICK, startGame);
function startGame(e:MouseEvent):void {
start_btn.visible = false;
stage.addEventListener(Event.ENTER_FRAME, moveBoook)
}
How do I fix these? I'm trying to get the Start Button to work on a game I'm creating. The start button is attached to the Instructions (a movie clip) and I'm trying to create a code that will make the instructions disappear and the game begin after the start button has been pressed.
Any help will be appreciated!!!! ![]()
Copy link to clipboard
Copied
you need an object on stage with instance name start_btn. if you have a movieclip on stage (eg, mc) that contains a an object named start_btn, you should use:
mc.start_btn
to reference your start button.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more