需要一些帮助,它让我疯狂!我从我的.as文件中调用了一个函数,并对它进行了相当多的研究,看起来好像我做得很好,但显然我不是。
我正在尝试调用startFoxtel();从我的.as到我的.fla的功能,但它不断回来
1061:通过静态类型NGVTVAir的引用调用可能未定义的方法startFoxtel。 (符号'FoxtelContainer',图层'动作',第1帧,第29行)NGVTVAir.fla
这是关于.fla(请记住我已经删除了所有其他不相关的功能,它纯粹是它不喜欢的startFoxtel调用)
import flash.events.MouseEvent;
import flash.display.MovieClip;
import fl.transitions.easing.*;
import fl.transitions.Tween;
var NGVTV:NGVTVAir = new NGVTVAir();
function FoxDown(event:MouseEvent):void
{
NGVTV.startFoxtel();
var twAlpha:Tween = new Tween(MovieClip(root).bg1,"alpha",Strong.easeOut,1,0,3,true);
var tw1Alpha:Tween = new Tween(MovieClip(root).buttons,"alpha",Strong.easeOut,1,0,3,true);
var tw2Alpha:Tween = new Tween(MovieClip(root).logo,"alpha",Strong.easeOut,1,0,3,true);
var tw3Alpha:Tween = new Tween(MovieClip(root).cityscape,"alpha",Strong.easeOut,1,0,3,true);
twAlpha.start();
tw1Alpha.start();
tw2Alpha.start();
tw3Alpha.start();
}
这是在.as
package
{
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
import flash.display.Sprite;
import flash.events.*;
import flash.events.IOErrorEvent;
import flash.events.NativeProcessExitEvent;
import flash.events.ProgressEvent;
import flash.filesystem.File;
public class NGVTVAir
{
public var process:NativeProcess;
public var dispatch:EventDispatcher = new EventDispatcher();
public function StartFoxtel():void
{
if(NativeProcess.isSupported)
{
setupAndLaunchFoxtel();
}
else
{
trace("NativeProcess not supported.");
}
}
答案 0 :(得分:1)
AS3区分大小写:
您需要替换
NGVTV.startFoxtel();
匹配您的功能名称
public function StartFoxtel():void
所以它会是
NGVTV.StartFoxtel();