我想用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