我想用flashDevelop嵌入movieClip,但顯然它不工作,因爲它不識別其中的movieclip。這裏是我的代碼用flashDevelop嵌入MovieClip
package com.objects{
import flash.display.MovieClip
import flash.text.TextField;
import flash.events.*;
import flash.text.TextFormat;
[Embed(source='../../../lib/fighter.swf', symbol='InfoBox')]
public class InfoBox extends gameObject {
protected var textf:TextField;
protected var s:String;
public var type:Boolean = false;
private var letter:Number = 0;
private var string:Array;
private var line:Number = 0;
private var portNum:Array;
public function InfoBox():void
{
portNum = new Array();
portrait.stop();
x = 400;
y = 550;
string = new Array();
var format = new TextFormat();
format.size = 18;
textf = new TextField();
textf.width = 550;
textf.height = 85;
textf.x = -220;
textf.y = -60;
textf.wordWrap = true;
textf.defaultTextFormat = format;
addChild(textf);
contButton.addEventListener(MouseEvent.MOUSE_DOWN, StoryNext);
}
private function StoryNext(e:MouseEvent):void
{
if(string.length > 1)
{
portNum.splice(0,1);
string.splice(0,1);
trace(string.length);
letter = 0;
}
else
{
contButton.removeEventListener(MouseEvent.MOUSE_DOWN, StoryNext);
dispatchEvent(new Event("StoryContinue"));
}
}
public function textInfo(msg:String,num:Number = 1):void
{
string.push(msg);
portNum.push(num);
}
override public function updateObject():void
{
TypeWords();
}// End UpdateObject
public function TypeWords():void
{
if(type)
{
portrait.gotoAndStop(portNum[0]);
var s:String = string[0];
if(letter <= s.length)
{
textf.text = s.substring(0,letter);
}
letter++
}
}
}
}
,我得到這個錯誤
C:\Users\numerical25\Documents\RealGames\FighterPilot\beta1FlashDev\src\com\objects\InfoBox.as(23): col: 4 Error: Access of undefined property portrait.
肖像是,我有信息框影片剪輯內的影片剪輯。它已經在舞臺上,我給它一個肖像的實例名稱。它在flash中工作,但現在它不在flashDevelop
好的,如果我不能從我的flash開發項目的符號中看到InfoBox。我一直試圖通宵達到一些符號顯示,他們不會 – numerical25 2010-02-07 14:48:18
我的Flash開發出了問題。我需要弄明白。我編譯我的應用程序,即使當我在主要 – numerical25 2010-02-07 15:15:11
中添加跟蹤時也沒有任何反應,但如果您沒有獲取跟蹤信息,則需要確保在調試時編譯(它是編譯按鈕旁邊的選擇框),並且您有一個調試閃存播放器,如果你這樣做,你應該在右鍵菜單中有一個調試器選項。 – grapefrukt 2010-02-07 22:28:42