Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

New to Adobe Flash, need help with simple coding

Guest
Aug 21, 2013 Aug 21, 2013

I'm new to using Adobe Flash and need some help. What does static type class mean?

TOPICS
ActionScript
794
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 21, 2013 Aug 21, 2013

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.

Translate
Community Expert ,
Aug 21, 2013 Aug 21, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 21, 2013 Aug 21, 2013

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 {

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 21, 2013 Aug 21, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 22, 2013 Aug 22, 2013

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!!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2013 Aug 22, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines