Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 从其他swf文件加载时,AS3组件滑块不工作_Actionscript 3 - Fatal编程技术网

Actionscript 3 从其他swf文件加载时,AS3组件滑块不工作

Actionscript 3 从其他swf文件加载时,AS3组件滑块不工作,actionscript-3,Actionscript 3,我有一个简单的Flash应用程序,它使用组件滑块来增加或减少TextArea(ta)中文本的大小。它本身工作得非常好,但是,当我尝试从另一个应用程序加载相同的swf文件时,我得到以下错误 ReferenceError: Error #1069: Property fl.managers:IFocusManager::form not found on fl.managers.FocusManager and there is no default value. at fl.controls

我有一个简单的Flash应用程序,它使用组件滑块来增加或减少TextArea(ta)中文本的大小。它本身工作得非常好,但是,当我尝试从另一个应用程序加载相同的swf文件时,我得到以下错误

ReferenceError: Error #1069: Property fl.managers:IFocusManager::form not found 
on fl.managers.FocusManager and there is no default value. 

at fl.controls::Slider/thumbPressHandler()
AS3代码

import fl.events.*;
import flash.text.TextFormat;

ta.text = "Lorem ipsum dolor sit amet";

var tf:TextFormat = new TextFormat();
tf.color = 0xCCCCCC;
tf.font = "Trebuchet MS";
tf.size = 12;

slider.addEventListener(SliderEvent.THUMB_DRAG, sliderChange);

style();

function style():void
{
    ta.setStyle("textFormat", tf);
}

function sliderChange(e:SliderEvent):void
{
    tf.size = slider.value;
    ta.setStyle("textFormat", tf);
}

我正在加载滑块swf文件的包含swf文件是否会影响滑块应用程序?我不太明白为什么它能自己工作,但从另一个应用程序加载时却不能工作。

好的,所以我发现了问题。我需要将组件滑块添加到从中加载滑块swf的应用程序库。

如果从另一个应用程序加载该应用程序,则它在启动时无法访问stage。它会引起各种各样的问题。显然,
FocusManager
希望stage在初始化时可用。这可能无法避免,我还没有找到检索FlashCS默认创建的
FocusManager
实例的方法。