I'm trying to make a basic loader that uses Splash.swf to then load myisogame.swf
I keep getting error #1009. It's a template we was given in class, originally the Splash.swf directed to Game.swf, but in the code below there is only one mention of where it directs to.
In the template Game.fla doesn't have any code in it.
Here is the Splash
package {
import flash.display.MovieClip;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFormat;
public class Splash extends MovieClip {
var myLoader:Loader;
var loadingAnim:LoadingAnimation;
var percentLoaded:TextField =new TextField();
public function Splash() {
// constructor code
myLoader = new Loader();
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
var blubox = new BluBox();
addChild(blubox);
blubox.x=200;
blubox.y=200;
loadingAnim = new LoadingAnimation();
addChild(loadingAnim);
loadingAnim.x=200;
loadingAnim.y=200;
loadingAnim.scaleX=0;
var format:TextFormat = new TextFormat();
format.font = "Verdana";
format.color = 0xFF0000;
format.size = 20;
format.underline = false;
percentLoaded.defaultTextFormat = format;
addChild(percentLoaded);
percentLoaded.x=200;
percentLoaded.y=230;
myLoader.load(new URLRequest("myisogame.swf"));
}
function onProgress(evt:ProgressEvent):void {
var nPercent:Number = Math.round((evt.bytesLoaded / evt.bytesTotal) * 100);
loadingAnim.scaleX = nPercent / 100;
percentLoaded.text = nPercent.toString() + "%";
trace("load%"+nPercent.toString());
}
function onComplete(evt:Event):void {
myLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);
myLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete);
loadingAnim.x=1000;
addChild(myLoader);
}
function onIOError(evt:IOErrorEvent):void {
trace("IOError loading SWF");
}
}
}
5
6
7
8
11
12
13
14
20
25
26
MyIsoGame code
package {
import flash.display.MovieClip;
import as3isolib.display.scene.IsoScene;
import as3isolib.display.IsoView;
import as3isolib.display.scene.IsoGrid;
import as3isolib.graphics.Stroke;
import as3isolib.display.primitive.IsoBox;
import as3isolib.display.IsoSprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import eDpLib.events.ProxyEvent;
import as3isolib.geom.Pt;
import as3isolib.geom.IsoMath;
import as3isolib.graphics.SolidColorFill;
// before class
public class MyIsoGame extends MovieClip {
public var scene:IsoScene;
public var view:IsoView ;
public var CELLSIZE:int = 30;//------This is very important to remember cell size. This will affect placement of objects
var zoomFactor:Number = 1;////Zoom Factor heerrrreee--------------------
var s1:IsoSprite = new IsoSprite();
var wr:IsoSprite = new IsoSprite();
var wre:IsoSprite = new IsoSprite();
var g1:IsoSprite = new IsoSprite();
var b1:IsoSprite = new IsoSprite();
var b2:IsoSprite = new IsoSprite();
var b3:IsoSprite = new IsoSprite();
public function MyIsoGame() {
// constructor code
trace("hello from constructor");
scene = new IsoScene();
view = new IsoView();
view.setSize((stage.stageWidth), stage.stageHeight);
view.clipContent = true;
view.showBorder = false;
view.addScene(scene);
view.addEventListener(MouseEvent.MOUSE_DOWN, onStartPan, false, 0, true);
view.addEventListener(MouseEvent.MOUSE_WHEEL, onZoom, false, 0, true);
addChild(view);
var g:IsoGrid = new IsoGrid();
g.addEventListener(MouseEvent.CLICK, gridClick);
g.cellSize=30;
g.setGridSize(6,6);
g.y=0;
g.x=0;
g.gridlines = new Stroke(2,0x666666);
g.showOrigin = false;
scene.addChild(g);
g.addEventListener(MouseEvent.CLICK, grid_mouseHandler);
var box:IsoBox = new IsoBox();
box.setSize(10, 10, 10);
box.moveTo(50,50,0);
scene.addChild(box);
wr.setSize(30, 30, 30);
wr.moveTo(60, 0, 0);
wr.sprites=[new Wrecked()];
scene.addChild(wr);
wre.setSize(30, 30, 30);
wre.moveTo(30, 0, 0);
wre.sprites=[new Wrecked()];
scene.addChild(wre);
g1.setSize(30, 30, 30);
g1.moveTo(150, 150, 0);
g1.sprites=[new Gold()];
scene.addChild(g1);
b1.setSize(30, 30, 30);
b1.moveTo(120, 120, 0);
b1.sprites=[new Blue()];
scene.addChild(b1);
b2.setSize(30, 30, 30);
b2.moveTo(120, 150, 0);
b2.sprites=[new Blue()];
scene.addChild(b2);
b3.setSize(30, 30, 30);
b3.moveTo(150, 120, 0);
b3.sprites=[new Blue()];
scene.addChild(b3);
scene.render();
stage.addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheel);///MOUSE WHEEL CONTROL
stage.addEventListener (KeyboardEvent.KEY_DOWN, keyboarddownlistener)
}
private function gridClick(event:ProxyEvent):void
{
var me:MouseEvent = MouseEvent(event.targetEvent);
var p:Pt = new Pt(me.localX, me.localY);
IsoMath.screenToIso(p);
y
}
private var panPt:Pt;
private function onStartPan(e:MouseEvent):void
{
panPt = new Pt(stage.mouseX, stage.mouseY);
view.removeEventListener(MouseEvent.MOUSE_DOWN, onStartPan);
view.addEventListener(MouseEvent.MOUSE_MOVE, onPan, false, 0, true);
view.addEventListener(MouseEvent.MOUSE_UP, onStopPan, false, 0, true);
}
private function onPan(e:MouseEvent):void
{
view.panBy(panPt.x - stage.mouseX, panPt.y - stage.mouseY);
panPt.x = stage.mouseX;
panPt.y = stage.mouseY;
}
private function boxClick(e:Event)
{
view.centerOnIso(e.target as IsoBox);
}
private function onStopPan(e:MouseEvent):void
{
view.removeEventListener(MouseEvent.MOUSE_MOVE, onPan);
view.removeEventListener(MouseEvent.MOUSE_UP, onStopPan);
view.addEventListener(MouseEvent.MOUSE_DOWN, onStartPan, false, 0, true);
}
private var zoomValue:Number = 1;
private function onZoom(e:MouseEvent):void
{
if(e.delta > 0)
zoomValue += 0.10;
if(e.delta < 0)
zoomValue -= 0.10;
view.currentZoom = zoomValue;
}
///----------------Grid Mouse Handler
public function grid_mouseHandler (evt:ProxyEvent):void
{
var mEvt:MouseEvent = MouseEvent(evt.targetEvent);
var pt:Pt = new Pt(mEvt.localX, mEvt.localY);
IsoMath.screenToIso(pt);
var roundedX:int = int(pt.x)/30;
var roundedY:int= int(pt.y)/30;
trace("transformed point = "+roundedX +","+roundedY);
///Code that allows things to be put down, located here.
var s:IsoSprite= new IsoSprite();
s.sprites=[new Base()];
s.setSize(30, 30, 30);//Varies via Cell size-
s.moveTo(roundedX*30, roundedY*30, 0);
scene.addChild(s);
scene.render();
}///------------------Grid Mouse Handler
public function mouseWheel (event:MouseEvent){
trace("The Delta value isss: " + event.delta);
//Get current view zoom
zoomFactor+=event.delta*0.04;
view.zoom(zoomFactor)
}
public function keyboarddownlistener(e:KeyboardEvent){
{//Screen-Movement Code
if (e.keyCode == 40)
{// The numbers represent the keyboard buttons
trace("Down Arrow")// I've left these trace commands so you can get a better idea of which one is what.-William 22/04/14
view.pan(0,5);
scene.render();
//Down arrow???
}
}
if (e.keyCode == 38)
{
trace("Up Arrow")
view.pan(0,-5);
scene.render();
//Up arrow???
}
if (e.keyCode == 37)
{
trace("Left Arrow")
view.pan(5,0);
scene.render();
//Left arrow???
}
if (e.keyCode == 39)
{
trace("Right Arrow")
view.pan(-5,0);
scene.render();
//Right arrow???
}
/////OBJECT MOVEMENT code- For moving the donut around
///-- I am going to be working on a version of this game where--
///- everything can be controlled via a Keyboard only -William 22/04/14
if (e.keyCode == 65)
{
trace("A Left <--")
//view.x+=15;//Alternate version
s1.moveBy(30,0,0)
scene.render();
//Left?
}
if (e.keyCode == 68)
{
trace("D Right -->")
//view.x-=15;//Alternate version
s1.moveBy(-30,0,0)
scene.render();
//Right?
}
if (e.keyCode == 83)
{
trace("S Down --v")
//view.x-=15;//Alternate version
s1.moveBy(0,30,0)
scene.render();
//Down?
}
if (e.keyCode == 87)
{
trace("W Up --^")
//view.x-=15;//Alternate version
s1.moveBy(0,-30,0)
scene.render();
//Up?
}
}
}
}
I tried the code you supplied (without the numbers at the bottom) and it worked just fine for me.
error #1009 is a runtime error when you use a variable that hasn't been defined yet. I would suggest debugging from Flash Pro (ctrl + shift +enter) and let it show you where it breaks.
In your FLA, you said there is no code, but in the properties panel you do see the class field with "Splash" in it right? that is what links the class to the FLA.
It is possible that the runtime error you are seeing is not in the Splash class but in either BluBox or LoadingAnimation. Do those have class files? If not, take a look in the Library and you'll have two movie clips that are exported for actionScript with those names. Check in them to see if there might be some framescript.
This line throws a Stack Error (FlashDevelop) not compile error. I have other errors but I would thought the others might be flowing from this.
Can anyone get a sense of why its having trouble with this basic part of code?
Which is 1009 when displayed in external error viewer.
lines
if (stage) {init();}
throw this error.
It won't attach the second sprite without error- though it does seem to set on stage- traces don't give any results even they did before (with 4.4.2) however I just updated to 4.4.3.
package
{
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.*;
import flash.ui.Keyboard;
//import board;
import flash.accessibility.AccessibilityImplementation;
import flash.display.Bitmap;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.Sprite;
import flash.utils.ByteArray;
import flash.events.MouseEvent;
import flash.text.AntiAliasType;
import flash.utils.describeType;
import boxsprite;
import flash.net.*;
import flash.display.Stage;
import board;
/**
* ...
* #author Michael
*/
public class Main extends Sprite
{
internal var kanaList:Vector.<String> = new <String>["あ/ア", "あ/ア", "え/え", "え/え", "い/イ", "い/イ", "お/オ", "お/オ", "う/ウ", "う/ウ", "う/ウ", "う/ウ", "か/カ", "か/カ", "け/ケ", "け/ケ", "き/キ", "き/キ", "く/ク", "く/ク", "こ/コ", "こ/コ", "さ/サ", "さ/サ", " し/シ", " し/シ", "す/ス", "す/ス", "そ/ソ", "そ/ソ", "す/ス", "す/ス", "た/タ", "た/タ", "て/テ", "て/テ", " ち/チ", " ち/チ", "と/ト", "と/ト", "つ/ツ", "つ/ツ", "ら/ラ", "ら/ラ", "れ/レ", "れ/レ", "り/リ", "り/リ", "ろ/ロ", "ろ/ロ", "る/ル", "る/ル", "だ/ダ", "で/デ", "じ/ジ", "ど/ド", "ず/ズ", "ざ/ザ", "ぜ/ゼ", "ぞ/ゾ", "な/ナ", "ね/ネ", "に/二", "の/ノ", "ぬ/ヌ", "じゃ/ジャ", "じゅ/ジュ", "じょ/ジョ", "ん/ン", "しゃ/シャ", "しゅ/シュ", "しょ/ショ", "や/ヤ", "ゆ/ユ", "よ/ヨ", "は/ハ", "ひ/ヒ", "ふ/フ", "へ/ヘ", "ほ/ホ", "ば/バ", "ば/バ", "ぶ/ブ", "ぶ/ブ", "び/ビ", "び/ビ", "ぼ/ボ", "ぼ/ボ", "べ/ベ", "べ/ベ", "ぱ/パ", "ぴ/ピ", "ぷ/プ", "ぺ/ペ", "ぽ/ポ", "ま/マ", "み/ミ", " む/ム", "め/メ", "も/モ", "を/ヲ", "みゃ/ミャ", "みゅ/ミャ", "みょ/ミョ", "きゃ/キャ", "きゅ/キュ", "きょ/キョ", "にゃ/ニャ", "にゅ/ニュ", "にょ/ニョ", "びゃ/びゃ", "びゅ/ビュ", "びょ/ビョ", " ひゃ/ヒャ", "ひゅ/ヒュ", "ひょ/ヒョ", "ぴゃ/ピャ", "ぴゅ/ピュ", "ぴょ/ピョ", "っ/ッ", "っ/ッ"];
internal var valueList:Vector.<uint>= new <uint>[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 10, 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 20, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 1];
// Lists of Kana that can be replaced in the replace mode and the substitute Kana and Values
internal var selectghostList:Vector.<String>=new<String>["ま/マ","む/ム","も/モ","か/カ","く/ク","こ/コ","な/ナ","ぬ/ヌ","の/ノ","ば/バ","ぶ/ブ","ぼ/ボ","は/ハ","ふ/フ","ほ/ホ","ぱ/パ","ぷ/プ","ぽ/ポ"];
internal var selectkanaList:Vector.<String>=new <String>["みゃ/ミャ", "みゅ/ミャ", "みょ/ミョ", "きゃ/キャ", "きゅ/キュ", "きょ/キョ", "にゃ/ニャ", "にゅ/ニュ", "にょ/ニョ", "びゃ/びゃ", "びゅ/ビュ", "びょ/ビョ", " ひゃ/ヒャ", "ひゅ/ヒュ", "ひょ/ヒョ", "ぴゃ/ピャ", "ぴゅ/ピュ", "ぴょ/ピョ"];
internal var selectghostvalueList:Vector.<uint>=new <uint>[2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2];
//Start list of playerHand contents as I don't know if Null is 0
internal var playernumber:uint;
internal var playerHand:Array = [[0], [0], [0], [0],[0], [0]];
[Embed(source = "C:/Windows/Fonts/Verdana.ttf", fontName = "Verdana", fontWeight = "bold", advancedAntiAliasing = "true", mimeType = "application/x-font")]
public static const VERD:Class;
/*[Embed(source="../lib/StartText.txt",mimeType="application/octet-stream")]
private var myFile:Class;
public var b:ByteArray = new myFile();
public var s:String = b.readUTFBytes(b.length)*/
public function Main():void
{
if (stage) {init();}
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
//var board1:Sprite = new board();
//stage.addChild(board1);
//
var boardonScreen:Sprite = new board();
boardonScreen.x = 0;
boardonScreen.y = 0;
addChild(boardonScreen);
var box1:Sprite = new boxsprite();
box1.x = 480;
box1.y = 0;
addChild(box1);
}
package
{
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.*;
import flash.ui.Keyboard;
//import board;
import flash.accessibility.AccessibilityImplementation;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.Sprite;
import flash.utils.ByteArray;
import flash.events.MouseEvent;
import flash.text.AntiAliasType;
import flash.utils.describeType;
import flash.net.*;
import Set;
import StatusBox;
import Statusx;
import flash.display.InteractiveObject;
import flash.text.TextFieldType;
import flash.events.FocusEvent;
import fl.managers.FocusManager;
import flash.display.*;
import flash.display.Stage;
import flash.events.KeyboardEvent;
public class boxsprite extends Sprite
{
[Embed(source="../lib/Box.jpg")]
private var boxspriteClass:Class
internal var mode:uint= 1;
internal var displaytext:String;
internal var setBox:Boolean = false;
internal var onBoard:Array = [0];
internal var playerRound:uint = 1;
internal var round:uint = 1;
public var playernumber:uint;
public function boxsprite():void
{
trace (mode);
init2();
addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown);
choosetext();
}
private function init2():void
{
var boxsprite2:Bitmap = new boxspriteClass() as Bitmap;
this.addChild(boxsprite2); }
Doesn't matter how I write that part whether init or init()
Errors translated from Japanese with names removed.
null: TypeError: 1009 Error #.
at boxsprite / frontpage () ...Test \ New Project \ src \ boxsprite.as: 168]
at boxsprite / choosetext () ... Games \ Test \ New Project \ src \ boxsprite.as: 132]
at boxsprite () ... Test \ New Project \ src \ boxsprite.as: 53]
at Main / init () ...Test \ New Project \ src \ Main.as: 75]
at Main ().... \ Test \ New Project \ src \ Main.as: 56]
all functions are ():void except for eventlistener associated functions
Look for yourself no uninitialized variables- everything is defined before its used.
It totally fails to create textfields so that's why stage.focus fails.
package
{
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.*;
import flash.ui.Keyboard;
//import board;
import flash.accessibility.AccessibilityImplementation;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.Sprite;
import flash.utils.ByteArray;
import flash.events.MouseEvent;
import flash.text.AntiAliasType;
import flash.utils.describeType;
import flash.net.*;
import Set;
import StatusBox;
import Statusx;
import flash.display.InteractiveObject;
import flash.text.TextFieldType;
import flash.events.FocusEvent;
import fl.managers.FocusManager;
import flash.display.*;
import flash.display.Stage;
import flash.events.KeyboardEvent;
public class boxsprite extends Sprite
{
[Embed(source = "C:/Windows/Fonts/Verdana.ttf", fontName = "Verdana", fontWeight = "bold", advancedAntiAliasing = "true", mimeType = "application/x-font")]
public static const VERD:Class;
[Embed(source="../lib/Box.jpg")]
private var boxspriteClass:Class
internal var mode:uint;
internal var displaytext:String;
internal var setBox:Boolean = false;
internal var onBoard:Array = [0];
internal var playerRound:uint = 1;
internal var round:uint = 1;
internal var playernumber:uint;
internal var myTextBox:TextField = new TextField();
public function boxsprite():void
{mode = 1;
trace (mode);
init2();
this.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown);
}
private function init2():void
{
var boxsprite2:Bitmap = new boxspriteClass() as Bitmap;
this.addChild(boxsprite2);
choosetext();
}
protected function myKeyDown(e2:KeyboardEvent):void
{if (e2.keyCode ==Keyboard.ENTER)
{
/*mode 2 is beginning mode- setting a tile prompts a Set event which return a StatusBox event which unsets the tile
* mode 3 is return mode- setting a tile prompts a Set event which triggers a change to mode 4
* mode 4 return finish- add more tiles to return and either press Enter to end game and remove tile ID from hand list or double click any tile which trigger Status Box event to unset tiles
* mode 5 exchange simpler- setting a tile prompts a Set event which adds to temp list triggers function replace which a create simpleTile- double click on either triggers StatusBox event which kills the other tile and removes the tile from player list
* mode 6 exchange Kanji- setting a tile prompts Set event which triggers function newKanji which creates a kanjiTile-
* mode 7 set more tiles add to temp remove list double click on any set tile or click on Kanji tile to write Kanji or double click to complete press H to hide other tile to check with other players
* mode 8 end turn- press Enter to end score or press R to return tiles to hand
* mode 9 score
*/
switch (mode)
{ case 1:{mode = 2;
choosetext();
}
case 8:
{ mode = 9;}
case 9:
{mode = 2;
turn1();
}
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
if (setBox == false){
if (onBoard.length>1)
{mode = 8;
choosetext();}}
if (onBoard.length == 1)
{mode = 2;
choosetext();
turn1();
}
else if (setBox == true)
//set SetBox to true only for
{mode += 1;
choosetext();
}
}
}
if (e2.keyCode ==Keyboard.H)
{
navigateToURL(new URLRequest("http://wp.me/P3FUQl-n"));
}
//else if (e.Keycode == Keyboard.Q)
}
internal function choosetext():void
{switch (mode)
{case 1: {myTextBox.text = "";
frontpage();
trace ("mode is one"); }
case 2: {myTextBox.text = "Below are your tiles. Move them onto the board- double click to place. 下記のタイルは場所にボードをダブルクリックにそれらを移動している。"; }
case 3: {myTextBox.text = "Remove from your hand- place tile on the box (double click)- Press Enter when done.ボックス(ダブルクリック)であなたの手の場所のタイルから削除 - 終了したら、Enterキーを押します。";}
case 4: {myTextBox.text = "Press Enter to remove tiles and end your turn or double click any placed tile to not remove.タイルを削除してターンを終了するには、Enterキーを押したり、ダブル削除しないように、任意のタイル配置をクリックします。";}
case 5: {myTextBox.text = "Place tile on box to get alternate kana tile- double click the one that you want あなたが望むものを得るために別の仮名タイルをダブルクリックを取得するためのボックスの上に置いてタイル" }
case 6: {myTextBox.text = "Place tile on box to get blank tile for writing kanji- click on it. 漢字を書くために空白のタイルを取得するためのボックスの上に置いてタイル. それをクリック";}
case 7: {myTextBox.text = "Place more tiles to form full reading. Press H to (un)hide other tiles so partner can check. Double click on the new or one old to select. 完全読書を形成するために多くのタイルを配置します。パートナーがチェックすることができるように他のタイルを隠すために、Hを押します。選択して新規または1歳をダブルクリックします。"; }
case 8: {myTextBox.text = "Press Enter if you or other players are OK with your word(s) or press R to return tiles. あなたや他のプレイヤーがあなたの言葉でOKであればEnterキーを押すか、タイルを返すためにRを押してください。"; }
case 9: {myTextBox.text = " Your score for this turn is below as calculated is below. Press S to reduce score and A to increase score. このターンのためにあなたのスコアは以下のように下にある計算されます。スコアAを押しますを高めるためにスコアSキーを押しを低減するために、"; }
}
}
protected function frontpage():void
{ //Introduction
trace ("draw");
var playerQ:TextField = new TextField();
playerQ.text = "Number of players 1-6?プレイヤーの数は(1)";
trace (playerQ.text);
playerQ.x = 0;
playerQ.y = 0;
playerQ.width = 64;
playerQ.height = 32;
playerQ.wordWrap = true;
this.addChild(playerQ);
var playernotext:TextField = new TextField();
playernotext.type = TextFieldType.INPUT;
playernotext.x = 0;
playernotext.y = 32;
playernotext.width = 32;
playernotext.height = 32;
playernotext.border = true;
addChild(playernotext);
stage.focus = playernotext;
playernotext.restrict = "1-6";
if (mode!=1){
if (playernotext.text != null)
{
playernumber = Number(playernotext.text); }
else
{playernumber = 1; }}
}
protected function turn1():void
{
if (playerRound > playernumber)
{playerRound = 1;
round += 1;
//create();
//display();
}
}
/*
deal();
}
internal function deal():void
{ var tileattrib:Array;
var kana:String;
var value:uint;
var newTileGroup:Array;
for (var i:uint = 1; i < 8; i += 1)
{
tileattrib = playerHand[playerRound[i]];
var newTile:Sprite = new tile(tileattrib[1],tileattrib[2]);
newTile.x = 15*32;
newTile.y = (15-i)*32;
newTileGroup.push(newTile);
addChild(newTile);}
}*/
protected function display():void
{
var format:TextFormat = new TextFormat("VERD", 20);
format.size = 20;
format.color = 0xFF0000;
format.font = "VERD";
myTextBox.defaultTextFormat = format;
myTextBox.setTextFormat(format);
myTextBox.antiAliasType = AntiAliasType.ADVANCED;
myTextBox.multiline = true;
myTextBox.textColor = 0xFF0000;
myTextBox.background = true;
myTextBox.border = true;
myTextBox.type = TextFieldType.DYNAMIC;
myTextBox.x=4;
myTextBox.y=4;
myTextBox.width = 32*4-4;
myTextBox.height = 32*6;
myTextBox.wordWrap = true;
stage.addChild(myTextBox);
myTextBox.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownScroll);
//
function mouseDownScroll(event:MouseEvent):void
{
myTextBox.scrollV+=1;
}
}
}
}
For some reason, if I reason it at least creates the instance and textfields though its still unresponsive to Enter key presses.
if I comment out the reference to Board() in Main()
package
{
import flash.display.Bitmap;
import flash.display.Sprite
import flash.text.TextField
import flash.text.TextFormat
import flash.events.MouseEvent
import flash.text.AntiAliasType
import flash.events.KeyboardEvent
import flash.ui.Keyboard
/**
* ...
* #author ...
*/
public class board extends Sprite
{
[Embed(source="../lib/Board.jpg")]
private var boardClass :Class;
public function board():void
{
start();
this.addEventListener(KeyboardEvent.KEY_DOWN, kill);
}
private var startBox:TextField = new TextField();
private function start():void
{var boardclass1:Bitmap = new boardClass() as Bitmap
this.addChild(boardclass1);
startBox.text = "Jabble. Click to Scroll Down. (下にスクロールする]をクリック) Instructions alternate between English and Japanese (translations). Press H for the help web page or put http://wp.me/P3FUQl-n in your web browser. Beneath is the Board and to the right is the Box. Press ENTER to go through the game stages- complete word, check and the score, deal next set of tiles. Press Spacebar to change the tile return modes- remove tiles from hand, exchange for alternate kana, exchange for a kanji. Click and Drag Tiles to move it and double click it set it on a square space on the Board or Box and click on the Box to change its mode. Jabble- 英語と日本語(訳)との間で交互に指示。を押して、ヘルプWebページのHまたはWebブラウザでhttp://wp.me/P3FUQl-nを置く。下には、取締役会であり、右に?などのさらなる命令ディスプレイボックスです.、ゲームを通してステージコンプリート単語、チェックとスコアを行くタイルの次のセットを扱うためにEnterキーを押します。モード·削除タイルの手札からタイル戻り、代替カナ引き換え、漢字と引き換えを変更するにはスペースバーを押します。クリックして、それを移動し、倍増するタイルをドラッグ 。クリックして、それを移動するにはタイルをドラッグし、ダブル会またはボックス上の正方形のスペースには、それを設定してクリックし、そのモードを変更するには、ボックスをクリックしてください " ;
var format:TextFormat = new TextFormat("VERD", 20);
format.size = 20;
format.color = 0xFF0000;
format.font = "VERD";
startBox.defaultTextFormat = format;
startBox.setTextFormat(format);
startBox.antiAliasType = AntiAliasType.ADVANCED;
startBox.multiline = true;
startBox.textColor = 0xFF0000;
startBox.background = true;
startBox.border = true;
startBox.x=32;
startBox.y=32;
startBox.width = 32*13;
startBox.height = 32*13;
startBox.wordWrap = true;
this.addChild(startBox);
startBox.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownScroll);
//
function mouseDownScroll(event:MouseEvent):void
{
startBox.scrollV+=1;
}
}
private function kill (e:KeyboardEvent):void
{ if (e.keyCode == Keyboard.ENTER)
{removeChild(startBox);
startBox = null;
this.removeEventListener(KeyboardEvent.KEY_DOWN, kill);
}
}
}
}