更新时间:AS3:类型强制失败:无法转换flash.display使用::影片剪辑
现在我recieving此错误:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip
从这节课:
package com.George.MegaAmazingApp.Components
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.MouseEvent;
public class Wheel extends MovieClip
{
public function Wheel(area:MovieClip, diagram:MovieClip)
{
area.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(event:MouseEvent):void
{
trace("wheel clicked");
trace("this is diagram");
}
}
}
这script:
import com.George.MegaAmazingApp.Components.*;
var wheel:Wheel = new Wheel(this.wheel,this.car);
De错误得出:
Attempting to launch and connect to Player using URL C:/Documents and Settings/reithg/My Documents/Classes/com/GeorgesMegaAmazingApp-app.xml
[SWF] GeorgesMegaAmazingApp.swf - 51681 bytes after decompression
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::[email protected] to com.George.MegaAmazingApp.Components.Wheel.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at GeorgesMegaAmazingApp_fla::MainTimeline()
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at ADLAppEntry/run()
at global/runtime::ADLEntry()
GeorgesMegaAmazingApp-app.xml的并不在该目录中存在,但我不知道为什么它反正看那里,它不是在FLA所在。
你想对我说'进口com.George.MegaAmazingApp.Components.Wheel',而不是'com.George.MegaAmazingApp.Components *'? – Eugeny89
@ Eugeny89问题在于大写的第一个字母,因为我已经将文件保存为全部小写...但是现在我有一个新的错误,更新第一篇文章。 –
什么行会引发错误? – Eugeny89