Flex3: SWFLoader Issues
Is this the right forum for Flex3, seems to be the closest
match?
Creating Flex3 app for dynamically loading SWF's and other
content (jpgs, pngs) inside an mx:Panel at runtime. The SWF's fire
dynamically in AS3 great, but the SWF's act strange and don't
conform to their containers. It shows objects off the stage in some
instances, and
doesn't stay inside the panel or the arbitrary canvas I defined
for the SWFLoader. I'd like to be able to load any SWF and pop
it into a panel to run, much as it would perfectly on a web page.
I've tried just about every combination of width and height
parameters, but it never works as intended. I've reverted to
absolute sizing, it might be easier to get working than relative,
even though that's the desireable endstate.
Any suggestions? I can include screenshots if necessary.
Thanks!
Relevent Code (let's hope it doesn't mangle it!):
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical"
initialize="initApp()"
height="100%" width="100%"
paddingTop="10" paddingBottom="10" paddingLeft="10"
paddingRight="10"
creationCompleteEffect="{ creationCompleteEffect }" >
<mx:HDividedBox width="100%" height="100%">
....snip, the left nav panel here...
<mx:Panel
id="contentPanel"
title="Currently Viewing: {selectedNode.@label}"
width="100%"
height="650"
paddingTop="0" paddingRight="0" paddingLeft="0"
paddingBottom="0"
shadowDirection="right"
visible="false"
showEffect="{fadeIn}" >
<mx:Canvas borderThickness="1" borderStyle="solid"
width="600" height="400">
<mx:Image
id="content_loader"
source=""
scaleContent="true"
maintainAspectRatio="true"
showBusyCursor="true"
width="600"
height="400"
includeInLayout="true"
complete="trace(content_loader.content.loaderInfo.width,
content_loader.contentWidth,
content_loader.content.loaderInfo.height,
content_loader.contentHeight)"
ioError="missingSourceFile();" />
</mx:Canvas>
<mx:ControlBar>
<mx:Label text="Go to:"/>
<mx:NumericStepper/>
<!-- Use Spacer to push Button control to the right.
-->
<mx:Spacer width="100%"/>
<mx:Button label="Prev" />
<mx:Button label="Play"/>
<mx:Button label="Stop"/>
<mx:Button label="Next"/>
<mx:HSlider id="volume" minimum="0" maximum="100"
value="80"
dataTipPlacement="top"
tickColor="black"
snapInterval="1" tickInterval="10"
labels="['1','Volume','100']"
allowTrackClick="true"
liveDragging="true"
change="changeVolume();"/>
</mx:ControlBar>
</mx:Panel>
</mx:HDividedBox>
I have the same problem.
I think this is the answer:
When loading a SWF file from an nontrusted source (such as a
domain other than that of the Loader object's root SWF file), you
may want to define a mask for the Loader object, to prevent the
loaded content (which is a child of the Loader object) from drawing
to portions of the Stage outside of that mask, as in the following
code:
import flash.display.*;
import flash.net.URLRequest;
var rect:Shape = new Shape();
rect.graphics.beginFill(0xFFFFFF);
rect.graphics.drawRect(0, 0, 100, 100);
addChild(rect);
var ldr:Loader = new Loader();
ldr.mask = rect;
var url:String = "
http://www.unknown.example.com/content.swf";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);
Similar Messages
-
Loading a remote SWF via SWFLoader Issue
I have a simple flex app which loads an external XML into an
arrayCollection using HTTPService send method. This works fine as
both a stand-alone, or when loaded into it's parent as a LOCAL file
via the SWFLoader tag. However, when I place this child file onto a
remote server and try to load it into the parent which resides on
my desktop, the ArrayCollection default resultFormat of the send
method triggers the following runtime error (listed below). I don't
think it's a sandbox issue because when I change result format to
e4x, it works fine remotely. I've been hitting a wall on this for
days now... Any insight would be greatly appreciated and thanks to
all in advance!!!
PARENT SWF (resides on local desktop)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical" initialize="initData()">
<mx:Script>
<![CDATA[
public var baseURL:String;
public function initSWF(swfURL:String):void {
remote_swf.load(swfURL);
public function initData():void
baseURL = "
http://blahblahblah";
Security.allowDomain(baseURL);
]]>
</mx:Script>
<!-- WORKS when loading child swf LOCALLY -->
<mx:Button label="Load LOCAL SWF APP"
click="initSWF('remoteSWF.swf')"/>
<!-- DOES NOT WORK when loading child swf REMOTELY -->
<mx:Button label="Load REMOTE SWF APP" click="initSWF('
http://blahblahblah/remoteSWF.swf')"/>
<!-- LOADER -->
<mx:SWFLoader height="100%" width="100%" id="remote_swf"
autoLoad="false" visible="true" scaleContent="false"/>
</mx:Application>
CHILD SWF (resides on remote server)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="getXMLData()">
<mx:HTTPService id="myTeams" url="
http://blahblahblah/xml/myXML.xml"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
public function getXMLData():void
Alert.show(Security.sandboxType);
myTeams.send();
]]>
</mx:Script>
<mx:Label text="THIS IS THE LOADED SWF WHICH HAS JUST
PERFORMED A SEND ON HTTP SERVICE TO CREATE ARRAY
COLLECTION"></mx:Label>
</mx:Application>
------------ RUNTIME ERROR ---------------------------------
ArgumentError: Error #1063: Argument count mismatch on
Object/
http://adobe.com/AS3/2006/builtin::hasOwnProperty().
Expected 0, got 2.
at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
at mx.rpc.http::HTTPService/
http://www.adobe.com/2006/flex/mx/internal:rocessResult()
at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at :irectHTTPMessageResponder/completeHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
n()
at flash.events::EventDispatcher/dispatchEvent()
at
flash.net::URLLoader/flash.net:URLLoader:nComplete()After further investigations, it appears that the problem might be, due the fact that in the remote (loaded) swf, the following is null:
var sm:ISystemManager = ISystemManager(SystemManagerGlobals.topLevelSystemManagers[0]);
sm.swfBridgeGroup <----- equals null
I tried creating the swfBridgeGroup in the local (loading) swf, but the loaded one still thinks it is null.
Any ideas? -
SWFLoader issue... IMPORTANT & URGENT
I m developing an AIR application to run different SWF Clips using SWFLoader. I have given a list of clips in tree-view. The problem is that when i play first clip (any clip from the list) that runs fine with audio and video but when i play anyother after first one, there is no sound for that clip. Means only first clip has voice but none other afterward.
I googled this issue and have tried every possible solution but no way. Plz help me to resolve this issue, it is very important for me.
Thanks
Asad IjazHi, thanks for your reply.
Sure, the URL refers to an external swf file and the parameters sent to it, an example of which would be:
http://<IP address and file structure omitted>/awv.swf
The parameters passed to it look like this:
?awvByteHandlerPath=<IP address omitted>
&awvImagePath=<Image path omitted>
&awvWidth=1133&awvHeight=687
&awvX=-0.34302108671969433
&awvY=-0.39048279531074837
&awvZoom=23%
&awvToolbar=1
&awvMenubar=0
&awvNavWindow=0
&awvNavWidth=150
&awvNavHeight=100
&awvSlider=1
These are all comined together to make the url string. The paths are omitted for security.
It's basically passing a very large image (~80000 x 60000 px) to the swf with specific parameters. The swf itself is a proprietary application and behaves much like zoomify.
Not too clear on how to send the URIs unencoded. How would I do that?
Thanks again,
Alex. -
SWF LOAD UNLOADING SWFLOADER ISSUES
Hello Everyone,
I wonder if anyone ran into this issue. I have a view stack
with 3 visual screens. One of the screen has SWFLoader placed in
with "id = contentLoader";
I have two buttons on this screen on the top: "LOAD MOVIE 1"
and "LOAD MOVIE 2".
So pretty much, user can load the movie into the SWF LOADER
via this two button navigation. Well, I am able to load the first
movie with "AUTOLOAD". But when I click for the "LOAD MOVIE 2", the
second movie does load in but then the application crashes and
closes itself.
My Questions:
How can I unload the currently loaded SWF Movie before
Loading the next one. I have searched for days for this on google
and nothing has come through.
ContentLoader.unloadandStop() doesn't work and application
still crashes.
ContentLoader.source = ""; doesn't work, app still crashes
ContentLoader.source = null; doesn't work, app still crashes
Any help would highly be appreciated on this, please.Hello Everyone,
I wonder if anyone ran into this issue. I have a view stack
with 3 visual screens. One of the screen has SWFLoader placed in
with "id = contentLoader";
I have two buttons on this screen on the top: "LOAD MOVIE 1"
and "LOAD MOVIE 2".
So pretty much, user can load the movie into the SWF LOADER
via this two button navigation. Well, I am able to load the first
movie with "AUTOLOAD". But when I click for the "LOAD MOVIE 2", the
second movie does load in but then the application crashes and
closes itself.
My Questions:
How can I unload the currently loaded SWF Movie before
Loading the next one. I have searched for days for this on google
and nothing has come through.
ContentLoader.unloadandStop() doesn't work and application
still crashes.
ContentLoader.source = ""; doesn't work, app still crashes
ContentLoader.source = null; doesn't work, app still crashes
Any help would highly be appreciated on this, please. -
Hi,
When loading and external .swf file, I get the following error:
URIError: Error #1052: Invalid URI passed to decodeURI function.
at global/decodeURI()
at mx.controls::SWFLoader/OSToPlayerURI()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\ controls\SWFLoader.as:1938]
...etc....
First and foremost - what does this mean exactly?
Secondly, why would I be seeing this error in Flex 4 now, when the code used to work with Flex 3.5?
Thanks,
Alex.Hi, thanks for your reply.
Sure, the URL refers to an external swf file and the parameters sent to it, an example of which would be:
http://<IP address and file structure omitted>/awv.swf
The parameters passed to it look like this:
?awvByteHandlerPath=<IP address omitted>
&awvImagePath=<Image path omitted>
&awvWidth=1133&awvHeight=687
&awvX=-0.34302108671969433
&awvY=-0.39048279531074837
&awvZoom=23%
&awvToolbar=1
&awvMenubar=0
&awvNavWindow=0
&awvNavWidth=150
&awvNavHeight=100
&awvSlider=1
These are all comined together to make the url string. The paths are omitted for security.
It's basically passing a very large image (~80000 x 60000 px) to the swf with specific parameters. The swf itself is a proprietary application and behaves much like zoomify.
Not too clear on how to send the URIs unencoded. How would I do that?
Thanks again,
Alex. -
Issues with Flex3 and CF8 on Windows Vista
Sorry for the whine, however I feel it necessary to get a few
issues I've found with Flex3 on a Vista Laptop working with CF8
that I've not seen documented elsewhere.
Environment:
Sony Laptop with Intel Core 2 Duo processor and 3 GB Ram.
Running CF 8 Standard Edition, along with mySQL 5.x and
access to a SQL Server instance on another machine on the same
local network.
What I am trying to do:
A) learn flex, my background is CF with over 8 years of
experience along with Flash AS2 along the way.
B) put together a hello world app.
C) use the flex/cf application wizard to build a simple
master/detail set of selection/edit screens for one table of a
database that I used recently on a CF8 project. To see how much
better the UI really is on Flex and whether I could use it to retro
fit that old application to have a better UI using flex3.
Issues.
My mini-application is set up initially in the folder
c:/inetpub/wwwroot/mydirectory, but it does not work.
Reason is that when run, it cannot access the flex2gateway on
the url that the wizard puts into the app. which is
http://localhost/mydirectory/flex2gateway...
Details:
flex2gateway does not work on a subdirectory URL on the
default web site.
If I access
http://localhost/flex2gateway/
I get a blank screen (as expected) meaning that the flex2gatweway
is working.
If I access
http://localhost/mysubdirectory/flex2gateway/
I get a 404.0 error (not found)
Now, I beleive this is supposed to work, something must be
wrong with one of the xml file setups. But I cannot find any
documentation for it.
Initially the flex2gateway did not work at all. I did the web
connector thing with CF batch file and that got it working, but
only on the base directory, not the subdirectory.
So, to get around this issue, Luckily Vista with IE7 allows
more than one website.. I create a whole new website that is
accessed using
http://192.168.1.73:81/
I set this website up in the folder c:/localhost/mydirectory.
The flex project is called mydirectory
So we come to issue 2.
Given the above Issue number 1, I have further frustration
because when the Flex/Cold Fusion Application wizard builds the
various mxml files it insists on prefixing all of the remote object
calls with 'mydirectory.'
e.g "mydirectory.components.cfgenerated.mycfc"
Now, given that the web root is also the base of the project,
this will not work.
What actually works is: "components.cfgenerated.mycfc"
There seems to be no way I can configure the project when
building it to get around this issue. The only way |I can fix this
is to manually edit all the mxml files after the wizard is
finished. I also have to doctor the project setup for similar
reasons. It wants all of the urls to be:
http://192.168.1.73:81/mydirectory/bin/main.html
instead of
http://192.168.1.73:81/bin/main.html
So obviously the wizard is not set up to handle applications
that are based right at the web root, even though this is the only
place that the flex2gateway can work. <snafu I guess>
Issue 3:
I find that the flex/Cf application wizard is set up to build
pages based upon a certain narrowly defined way of constructing the
source database tables. In particular it wants every table to have
its own unique numeric id for each row, and can't handle a string
for the primary key and have the primary key editable as well.
Seems inflexible if you ask me. The main problem is that the
preconditions on the table structure that the wizard can work with
are poorly defined and documented. You obviously had to go to the
same school of database design and the same class as the Adobe
developers to think in the same way.
Given that this tool is supposed to be a help to new users of
Flex and AS3 and it is supposed to be a productivity aid, perhaps I
should not be surprised to have had to spend over a week getting to
grips with the wizard and learning its tricks just to get it to
build a mind numbingly simple mini app of my own that works when
run. Sorry Adobe, but you get a F minus on your report card for
this one, particularly on the really bad documentation. Just as bad
for the coding complexity of the solution to seemingly simple
application concept.
Cheers,
Bryn ParrottHi,
Which version of RDP client you are using for your client?
Does more user login at same period of time?
As you have commented that after sticking the user can’t able to login in RDCB server, here I can suggest you to check the setting of connection broker. Also you can check that you have place the proper location path of UPD while configuring in collection configuration
wizard. You can take a look at below article foe virtual desktop configuration.
Deploying Virtual Desktops with Windows Server 2012
Are you trying to use same UPD for different collection then also it might happens to occur your issue. The fact of UPD is User profile disks are for a single collection only. A user connecting to two different collections will have two separate profiles. If
you want to synchronize settings, refer to Microsoft User Experience Virtualization. Go through this article for more understanding related to UPD.
Working with User Profile Disks on Session-Based Desktop Deployments
Hope it helps!
Thanks. -
Issue with Parent child dashboards using SWFLoader component
Hello Gurus,
I am using Parent-child dashboards approach in our project.
I have multiple child files embedded in Parent dashboard using the SWFLoader (directly passing the URL as SWFLoader value) to load child dashboards. All the child, parent swf's are saved in the same intranet folders.
When I open the parent SWF, everything loads fine in the intranet.
But for some users, when they open from the intranet, the child dashboard doesnt load up properly or size of the dashboard gets reduced to a small version. (Iam sure that it has nothing to do with the access/privileges)
Any thoughts/ideas what could be causing an issue with child dashboard/resizing of the child dashboard.
Please help!
regards,
S RCheck whether the machine has compatible flash version in error specific machine and your machine.
-
SWFLoader loded swf and relative path issue
Hi,
Before explaining the problem, let me describe the usecase.
I have dashboard flex application hosted on Host1.
I have another flex application which acts as plugin to dashboard and is hosted on Host2.
I am using proxy to load plugin into dashboard using SWFLoader. With proxy SWFLoader in dashboard thinks that the plugin is coming from same host.
For plugin to load I specify SWFLoader source something like - source="Proxy/Host2WebappDir/plugin.swf.
Everything is fine upto this point. plugin.swf get loads successfully without any issue.
Now the problem -
If plugin.swf made some request - the url path of that requrest is expected to be relative - i.e. if it make request say getIndianStates.xml, I am expecting the request should look for resource at "Proxy/Host2WebappDir/getIndianStates.xml". Instead it tries to look for getIndianStates.xml into dashboard hosting directory on Host1.
Can this issue be resolved without making any modification in source of plugin.swf.
Thanks in advance,
Prithveesingh Zankat.I don’t know if any way to fix this without changing the URL the plugin wants to load. Now if the plugin stores that URL in a publicly accessible variable, you might be able to access it from the main SWF and change it. But it would be better to have the plugin detect relative paths and make sure they are relative to the SWF. The SWFLoader component uses a LoaderUtil class to do that for SWFs it loads, but loads that don’t use SWFLoader need similar fix ups.
-
When I use the SWFLoader to load an swf from a URL it is not
using the
sizes specified in the SWFLoader component that is loading
it, the swf
seems to initially load at whatever size the actual swf is,
but after
the swf has been downloaded fully then the SWFLoader jumps to
the
width/height I specified, so basically all swfs I load start
out huge
then after sever seconds shrink to the size I want them to
be. has
anyone else seen this or know how to remedy this issue?
(also the element in the swf that animate say from outside
the
original swf stage width/height show out way outside the
bounds of the
size specified)
//set the source(within a function)
swfplayer.source="
http://www.somedomain.com/myswf.swf";
<mx:Canvas id="swfplaycontainer" width="452" height="252"
horizontalCenter="0" verticalCenter="0">
<mx:SWFLoader id="swfplayer" width="100%"
height="100%"/>
</mx:Canvas>
Also tried with no Canvas...
<mx:SWFLoader id="swfplayer" width="452" height="252"
width="100%"
height="100%"/>
Thanks, Tim
specified size does not take effect until fully loaded swfhmm, well I tried explicitly setting the widht/height of the
SWFLoader to no avail, I just tried the scaleContent, it also did
not work ;-( I cannot hide the SWFLoader until complete event
because these are long swf animations(they are tutorial videos in
swf format) some seem to take 30-60 seconds to fully load(depending
on network traffic). They do start playing quite well immediately
but the size is messed up until complete, but I would think and
explicit size on the SWFLoader should be the definitive answer.
Adobe? -
Revision: 2913
Author: [email protected]
Date: 2008-08-19 21:55:11 -0700 (Tue, 19 Aug 2008)
Log Message:
Fix SWFLoader sizing issue (SDK-16497) Refactor some classes to try to fix ASDoc build.
Review: DJL
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-16497
Modified Paths:
flex/sdk/branches/3.0.x/frameworks/projects/airframework/src/mx/managers/WindowedSystemMa nager.as
flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/SWFLoader.as
flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/ISystemManager.as
flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/SystemManager.asThanks for sharing.
-
Hi everyone,
i'm trying to embed a media player (soudcloud) on my flex app.
the HTML code is :
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fnicola-ricca%2Fp odcast-lmh-sunshine-one&show_comments=true&auto_play=false&color=ca35e9"></param>
<param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fnicola-ricca%2Fp odcast-lmh-sunshine-one&show_comments=true&auto_play=false&color=ca35e9" type="application/x-shockwave-flash" width="100%">
</embed>
</object>
So in flex i created a SWFloader :
<mx:SWFLoader id="mySWF" width="100%" source="http://player.soundcloud.com/player.swf?url=http://soundcloud.com/nicola-ricca/podcast-lmh -sunshine-one&show_comments=true&auto_play=false&color=ca35e9" />
The problem is taht the embed swf is larger than my app, it realy dont fit with the size of my app.
If i set the scaleContent to false the swf is in a sort of way scaled ...but actually it is truncated !!!
Can someone help me with the issue please ?
Thank you.Hi Tracy
No I was not aware of that, but I see this as another
problem. Right now the problem is the load operations that never
completes (nor fails). I think it may have to do with some browser
connection limits... Do you know of any events being fired when an
"open connection" event fails because of connection limits ?
Another problem related to what you mentioned is when you
tell a movie clip to "gotoAndStop" at som frame. Then it takes a
little while before the instances of the frame is initialized. I
could not find any "complete" events to handle this, so righ now I
use a solution where I wait a bit and then check if all childred
are non-nul, and if not I wait again before checking again. This is
a hack, but it works and I could not find any better solution - do
you know a better way to ensure a frame is completely initialized
after a gotoAndStop call ? -
Issue with the swfloader.
We specified the scaleContent="true", given width, height,
maxWidth,maxHeight for a swfloader and tested locally by
excuting a you-tube .swf (src =
http://www.youtube.com/v/uk4V12zHtjc)
file. That works fine. When we deployed the application in
webserver(Tomcat), the swf file is getting loaded with its max
width and height; but it doesn't ensure the scalecontent, maxWidth
and maxHeight provided in the swf loader. Kindly helpHi Tracy
No I was not aware of that, but I see this as another
problem. Right now the problem is the load operations that never
completes (nor fails). I think it may have to do with some browser
connection limits... Do you know of any events being fired when an
"open connection" event fails because of connection limits ?
Another problem related to what you mentioned is when you
tell a movie clip to "gotoAndStop" at som frame. Then it takes a
little while before the instances of the frame is initialized. I
could not find any "complete" events to handle this, so righ now I
use a solution where I wait a bit and then check if all childred
are non-nul, and if not I wait again before checking again. This is
a hack, but it works and I could not find any better solution - do
you know a better way to ensure a frame is completely initialized
after a gotoAndStop call ? -
Date Chooser date enabling issue (Flex3)
Howdy,
I need to make an application using Flex 3 using a calendar (DateChooser component), this calendar must have only the dates wich have our trainings enabled. These dates would be taken from our database using php and mounting a XML, this XML is parsed into Builder.
I've tried using a simple array and an array colection, setting the array items into the selectableRanges attribute, but I didn't work in Flex 3. Also, I've tried setting the selectableRanges more than one time through the <mx:Script> tag, but it had only the last item enabled.
I almost stopped using Flex because I need to deliver the job soon, and it is the onlly thing remaining, but the client asked to have this visual.
Below is the XML mounted with PHP with data from my db:
<content>
<training year="2009" month="11" day="23">
<title>Coulogne - Creation, Fashion and Marketing</title>
</training>
<training year="2009" month="11" day="24">
<title>Ilumination - Architecture and Design</title>
</training>
<training year="2009" month="11" day="25">
<title>Image Treatment on Fashion Marketing</title>
</training>
</content>
Thank you all in advance!Hi Slowly_sa,
You can't enable disjoint dates by using selectableRange (because "range" here is singular). Instead, you can easily achieve it by disable all the other days, using disabledRanges array. For example, to enable 2 days 2009/11/23 and 2009/11/25, use these lines of code:
dateChooser.disabledRanges = [];
dateChooser.disabledRanges.push( { rangeEnd: new Date( 2009, 10, 22 ) } );
dateChooser.disabledRanges.push( { rangeStart: new Date( 2009, 10, 24 ), rangeEnd: new Date( 2009, 10, 24) } );
dateChooser.disabledRanges.push( { rangeStart: new Date( 2009, 10, 26 ) } ); -
Problems loading Flex3 swf into AIR app
This is a challenging problem that I have reduced down to the
bare minimum and it is still reproduceable. I have built a minimal
AIR application and added a SWFLoader to it which loads a SWF file
named "Junk.swf" using an absolute path.
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" title="Hello World">
<mx:Style>
WindowedApplication {
background-color:"0x999999";
background-alpha:"0.5";
</mx:Style>
<mx:SWFLoader
source="C:/myProjectFolder/renderers/Junk.swf" width="100%"
height="100%" />
</mx:WindowedApplication>
This works fine if I run the application from within Flex3,
however when I build an installer, install the application to my
windows vista system and execute it from the desktop the Junk.swf
will not display. If I replace the Junk.swf with another SWF of the
same name created in Flash CS3 then it will display properly when
my test app is executed from either Flex or the desktop.
The contents of the loaded SWF don't appear to be an issue
since even the simplest of Flex3 SWFs fail to display.
Interestingly when I add listeners to the SWFLoader to
determine if any errors are happening no error events are sent, but
I do receive both the INIT and COMPLETE events which tells me that
the Junk.swf is found and loaded, just not displayed.
Any assistance or even ideas that I could try would be
appreciated.that's why i added those comments about the swf's domain. for locally loaded swfs, use:
SFMltd wrote:
Hi Kglad, Thanks for the Example.
if i run my class with securityDomain = SecurityDomain.currentDomain; then it throws this error: SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
The swf file im trying to load is stored locally so i guess this error makes sense. However if i comment out that line i get the same "cannot access Stage owned by app" error?
See below for class:
package {
import flash.display.MovieClip;
import flash.filesystem.File;
import flash.events.Event;
import flash.net.FileReference;
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.system.LoaderContext;
import flash.system.ApplicationDomain;
import flash.system.SecurityDomain;
public class assetPreview extends MovieClip {
private var loader:Loader;
private var mainSWF:MovieClip = new MovieClip();
public function assetPreview() {
addEventListener(Event.ADDED_TO_STAGE, initialise);
public function initialise(e:Event):void
removeEventListener(Event.ADDED_TO_STAGE, initialise);
var allowSWF:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
// allowSWF.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.load( new URLRequest(settingsXML.pathToSWF),allowSWF);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, viewPreview);
public function viewPreview(e:Event):void
addChild(mainSWF);
mainSWF.addChild(loader); -
SWFLoader in Air can't access Camera/Mic?
I have a Flex swf file I'm loading into an Air 1.5 app that does a video chat. Flex app standalone in a browser works fine, but when loaded into the Air app by SWFLoader, it can not stream cam/mic. logging shows it successfully connecting streams and running localVideo.publish(name).
Is this a security issue or something that is going make me cringe?
Really need an answer, any help appreciated,
GregWhen loading SWFs inside a Flex/AIR app, you can see restrictions depending on how each SWF was compiled, and what resources it is trying to access.
See these Flex Builder help sys pages, or LiveDocs for more info:
Loading local assets
SWFLoader control
Using multiple SWF files
Maybe you are looking for
-
Hello, This is very frustrating!....... HP Pavillion DV6 Notebook Windows 7 Home Premium PC was hacked Tried to restore from recovery partition by pressing F11 and then following instructions for factory reset. It went through a lot of processes and
-
Trying to set up an IDoc->XI->RFC Scenario. Am able to receive the IDoc into XI but are having issues getting this to the other system via RFC. Status in Monitor for Processed XML Messages (SXMB_MONI) is "Recorded for Outbound Processing". When I "
-
Still use JRE 1.5 even though JRE 1.4.2 is checked in IE
Hi all, I have JRE 1.4.2 and 1.5 on my Windows XP SP 2. I want to force Internet explorer to use JRE 1.4.2 (how to: http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/jcp.html). JRE 1.4.2 is checked in Internet Explorer. It sounds
-
Signal c00 received by operating system
Hi Experts, In the sytem error log, SM21 we got an error "Signal c00 received by operating system" with the following documentation. "Due to special circumstances (for example, memory overwritten), the current process has received a signal from the o
-
how to upload ios 8.0.2 on 16 GB iphone 5? There is no enough storage