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

Error 5007

Community Beginner ,
Dec 14, 2014 Dec 14, 2014

i did all of the instructions here (http://www.ehow.com/how_7355693_make-memory-game-flash.html)  but i keep getting 5007:An actionscript file must have at least one externally visible definition whenever i press ctrl+enter. i'm guessing it has something to do with the code...

TOPICS
ActionScript
518
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
LEGEND ,
Dec 15, 2014 Dec 15, 2014

It sounds like you have created a class file that only has "private" elements and you have not provided anything "public" that the outside world can use to work with the class.

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 Beginner ,
Dec 15, 2014 Dec 15, 2014

i would appreciate it very much if you could tell me how to make it public if you got any free time

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
LEGEND ,
Dec 16, 2014 Dec 16, 2014

You will help yourself if you show the code when you are asking for help with a code problem

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 Beginner ,
Dec 16, 2014 Dec 16, 2014
LATEST

it was provided in the link mentioned above but here is the code anyways:

package {

import flash.display.Sprite;

import flash.events.MouseEvent;

import flash.events.TimerEvent;

import flash.utils.Timer;

public class image_match extends Sprite {

private var first_tile:images;

private var second_tile:images;

private var pause_timer:Timer;

varimagedeck:Array = new Array(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8);

public function image_match() {

for (x=1; x<=4; x++) {

for (y=1; y<=4; y++) {

var random_card = Math.floor(Math.random()*imagedeck.length);

var tile:images = new images();

tile.col = imagedeck[random_card];

imagedeck.splice(random_card,1);

tile.gotoAndStop(9);

tile.x = (x-1)*82;

tile.y = (y-1)*82;

tile.addEventListener(MouseEvent.CLICK,tile_clicked);

addChild(tile);

}

}

}

public function tile_clicked(event:MouseEvent) {

var clicked:image = (event.currentTarget as image);

if (first_tile == null) {

first_tile = clicked;

first_tile.gotoAndStop(clicked.col);

}

else if (second_tile == null && first_tile != clicked) {

second_tile = clicked;

second_tile.gotoAndStop(clicked.col);

if (first_tile.col == second_tile.col) {

pause_timer = new Timer(1000,1);

pause_timer.addEventListener(TimerEvent.TIMER_COMPLETE,remove_tiles);

pause_timer.start();

}

else {

pause_timer = new Timer(1000,1);

pause_timer.addEventListener(TimerEvent.TIMER_COMPLETE,reset_tiles);

pause_timer.start();

}

}

}

public function reset_tiles(event:TimerEvent) {

first_tile.gotoAndStop(9);

second_tile.gotoAndStop(9);

first_tile = null;

second_tile = null;

pause_timer.removeEventListener(TimerEvent.TIMER_COMPLETE,reset_tiles);

}

public function remove_tiles(event:TimerEvent) {

removeChild(first_tile);

removeChild(second_tile);

first_tile = null;

second_tile = null;

pause_timer.removeEventListener(TimerEvent.TIMER_COMPLETE,remove_tiles);

}

 

}

}

Read more : http://www.ehow.com/how_7355693_make-memory-game-flash.html

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