English 中文(简体)
以框架标签嵌入Swf, 并用Flex 控制它
原标题:Embedding swf with frame labels and controlling it in Flex

我试图将 Swf 文件嵌入我的Flex 应用程序, 并附上一些框架标签, 并在时间轴中定义这些标签 :

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1000" height="563" creationComplete="doSomething()">

    <mx:Script>
        <![CDATA[

            private var movieClip:MovieClip;

            private function doSomething():void {
                movieClip = swfFile.content as MovieClip;
                movieClip.gotoAndPlay( playIntro );
                movieClip.addEventListener("swfFinished", doSomethingElse);
            }

            private function doSomethingElse():void {
                //
            }

        ]]>
    </mx:Script>

    <mx:SWFLoader id="swfFile" width="1000" height="563" source="@Embed(source= test.swf )" /> 

</mx:Application>

但是,我无法以这种方式控制swf时间线...

谢谢!

最佳回答

有些搜索似乎显示,这是当 swf 嵌入时发生的。 如果您可以逃脱而不嵌入 swf, 请这样做 。

Here s a solution I found that allows the embed to work: http://iamjosh.wordpress.com/2008/04/09/embedding-flash-in-flex/

认为 问题可能是闪电玩家的安全模式, 只是一种预感。 它可能不允许与嵌入的 swf... 进行这种类型的沟通, 但是您也许可以做一些类似 Security.allowDomain ("*") (危险快捷键) 的事情 。

但首先,请查看"的文档,http://help.adobe.com/en_US/FlashPlatform/ reference/actionshit/3/flash/system/Security.html#allowDomain%28%29" rel=“nofollow”>allowDomain ,因为医生们建议你也许能够做到这一点:

Security.allowDomain(loader.contentLoaderInfo.url); //  loader  is a SwfLoader

但我猜想,在嵌入案中,url 可能无效:)

问题回答

暂无回答




相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签