Skip navigation
com.actualwebmedia
Currently Being Moderated

Load external SWF media player into a Flex application

Apr 16, 2013 8:00 PM

Tags: #security #swf #actionscript #loader #allow_domain

Hi - I am new to Flex and wondering if this is possible:

In the markup of my Flex application, load a 3rd party .swf (in this case, a media player from another website), add it as a child and let it be run within the context of my app. Here's what I tried based off of Adobe's documentation. However, Security.allowDomain() throws an error: SecurityError: Error #3207: Application-sandbox content cannot access this feature. Maybe trying to do this is a total security violation? Does it expose my application data to said 3rd party SWF?

 

Thanks in advance for any advice. Here's my code:

 

<?xml version="1.0" encoding="utf-8"?>

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

                    xmlns:s="library://ns.adobe.com/flex/spark" title="SWFTest" initialize="init()">

 

          <fx:Script>

                    <![CDATA[

                              import mx.core.UIComponent;

 

                              private function init():void

                              {

                                                  Security.allowDomain("*");

 

                                        var container:UIComponent = new UIComponent();

                                        addElement( container );

 

  //Load a video from world star hip hop. I know, really classy...

                                        var request:URLRequest = new URLRequest("http://hw-static.worldstarhiphop.com/videos/wplayer/NAPP2j.swf");

                                        var loader:Loader = new Loader()

                                        loader.load(request);

                                        container.addChild(loader);

                              }

 

                    ]]>

          </fx:Script>

</s:View>

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points