A swf loader bug?
It looks like I may have found a bug in the swf loader. Before I submit this problem I want to make sure there is not something I'm missing in my code. I wrote this class to load a tutorial when the user first launches a sub application in a project I'm working on. This is a simplified version of the class that exemplifies the problem. The same methods I use to launch the swf from within an mxml work just fine, but when I externalize the process in this class, I can hear the tutorial, but I get no visual. Is this a bug or am I missing something?
Here is the tutorial launcher class:
package proj.fuego.utils
import flash.events.Event;
import mx.controls.SWFLoader;
import mx.flash.UIMovieClip;
public class TutPlayerSimple extends UIMovieClip
private var gutLoader:SWFLoader;
public function TutPlayerSimple(fullTutorialPath:String)
gutLoader = new SWFLoader();
gutLoader.addEventListener(Event.COMPLETE, addToStage);
gutLoader.load(fullTutorialPath + ".swf");
//addChild(gutLoader);
private function addToStage(evt:Event):void
addChild(evt.target.content);
This is my mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" applicationComplete="application1_applicationCompleteHandler(event)">
<mx:Script>
<![CDATA[
import mx.controls.SWFLoader;
import mx.events.FlexEvent;
import proj.fuego.utils.TutPlayerSimple;
private var fullTutorialPath:String = "ll_tut";
private var tutPlayer:TutPlayerSimple;
protected function application1_applicationCompleteHandler(event:FlexEvent):void
// TODO Auto-generated method stub
var context:LoaderContext = new LoaderContext();
tutPlayer = new TutPlayerSimple(fullTutorialPath);
//context.checkPolicyFile = true;
//gutLoader.loaderContext = context;
trace("Loading Tut:", fullTutorialPath + ".swf");
addChild(tutPlayer);
]]>
</mx:Script>
</mx:Application>
That didn't look right. You'll need to addChild SWFLoader. Not sure what will happen if you just try to add its content. There might also be issues putting Flex components inside a UIMovieCip.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui
Similar Messages
-
Flex 3 locale swf loading bug on firefox
Hi all
I REALLY need your help here
if anyone knows this bug or have any idea how to deal with it, it would really mean a lot to me
i've been tring everything
description:
i'm building an application using flex 3, where all texts are being localized via the locale loaded at runtime
i suspect that for some reason the locale swf i'm loading isn't updating elements of the page
as you can see in the image below, texts appear cut off.
this happens to me only in firefox, no matter which page of the app is being displayed
any ideas?
appreciate your time in answering
Yariv GiladHello and thank you for your quick answer
the text is indeed right, and what you say make sense to me
how can i proceed from here though?
how can i fix the "sizing and positioning problem" ?
the UI components are there and are being populated dynamically through the locale
is there a way to force them to update?
is this the right direction at all?
any other ideas?
just to note that if i hard-code the text into the components they are rendered perfectly
so i don't see a reason to change their position or size...
thank you for your time
Yariv Gilad -
Xcelcius Line Chart in SWF Loader - Bug ?
Sometimes SWF Generated by Xcelcius (SAP Business Object Dashboards) display result like picture below .. randomly.
My Version is the latest version 14.1.3.1334 SAP BO 4.1 Support Pack 3 Patch 2.
It is bug .. or something wrong in my xlf ?
I can't find any thing in the forums about this. ThanksTo me it works perfectly alright, as discussed earlier I would suggest you to raise a ticket on this to SAP.
-
Controlling SWF loaded through MovieClipLoader
Hello AS gurus,
I have a two-level site for a portfolio where users can view
still images and videos for different projects. The top level SWF
file can be considered as the "parent SWF" and within this file,
the user navigates by choosing which project he/she wants to
explore. After choosing, the "parent SWF" loads in a "child SWF"
via MovieClipLoader of the selected content. It is within this
"child SWF" that the user can view the various images and videos
(with sound) of the selected project. To go back out and choose a
different project, the parent SWF is used and the user navigates to
and chooses another project.
The problem is that I can't figure out how to communicate
from the child SWF to the parent SWF (and vice versa)...well not
really...this is difficult to explain...hmmm... It would be better
to explain it with an example...
If you go to:
http://www.culshaw.info/junk_drawer/xdin/swf/
(1) Choose the "Examples" square (when this box zooms up, you
are presented with a way to navigate to various projects -- this
SWF that loads as the zoom up happens is what I am calling the
"parent SWF").
(2) Choose the second project, labelled "Ford : Ti-VCT" by
clicking on it (after clicking on the Ford project, the "child SWF"
is loaded via a MCL from the "parent SWF").
(3) You can see that the Ford project has 8 images and one
video that the user can view. Choose the video and ensure that it
begins to play and hit the mute button so that you hear sound
(sound is default muted. It is within this "child SWF" that the
video is NetStream(ed) and the sound is controlled. (there is a bug
with my code here so you may need to hit play/pause to get the
video going).
(4) Now, as the video is playing and you hear sound, click on
the "Other Examples" button that is located below the video player.
This button is actually embedded in the the "parent SWF" that
allows the user to navigate back up to see other projects and not
in the "child SWF" which contains all of the content. Notice that
you continue to hear the sound and that the net connection is still
streaming the video within the "child SWF". I don't want this to
happen. I want the "parent SWF" to tell the "child SWF" to stop
streaming and stop all sounds when this "parent SWF" - embedded
"Other Examples" button is pushed.
I can't figure out how to do this. Any info that may help
would be appreciated...
-johnHi,
It looks to me that the example you are going by has a main
navigation in the parent swf that is controlling which child movie
is loaded in and each child swf has its own internal navigation. If
this is what you are trying to achieve and you are using
_root.MoveClipName to target things you need to use the lockroot
code so the flash player knows what root you are talking about.
Place on the first frame of each Child swf
this._lockroot = true;
Hope this helps -
Tab navigator and swf loader issue
I have written two flex applications. Each of the
applications contains a tab navigator control. The direct children
of this tab navigator are canvases, sized to max.
i.e.
<mx:Canvas label="WhateverLabel" width="100%"
height="100%">
<!--whatever additional children here-->
</mx:Canvas>
Everything works fine, the navigator, all its children and
grandchildren Application does exaclty as it should ... untill I
load it into another application using swf loader.
Our main application is a menu driven app that loads
individual swf files based on user selection. When either one of
these programs (using the tab navigator described above) is loaded,
I get a White Bar across the top of the screen, sized as the Tab
navigator width.
the white bar goes away as soon as the user interacts with
any control, but it still is there on application load. Here is a
picture of what I am speaking about.
http://members.cox.net/dragon.magik/whitebar.jpg
You can see the menu atop the screen as the base application.
You can then see the panel right beneath it, that is the main panel
of the application i am having problems with. The white bar, as you
see, is as wide as my tab navigator. The TN labels are positioned
correctly, but I don't know why I am getting the white bar. I am
having the exact same problem with tab navigators in two different
applications I load into this one control panel. Any help would be
greatly appreciated. Thanks in advance.There is an unsolved bug in adobe.
You have to solve it manually overriding the function:
package
import mx.containers.TabNavigator;
public class TabNavigatorFixed extends TabNavigator
public function TabNavigatorFixed()
super();
override protected function commitSelectedIndex(newIndex:int):void
super.commitSelectedIndex(newIndex);
if(tabBar.numChildren > 0){
// Select the corresponding Tab in the Tab Bar (this fixes a bug in Flex)
tabBar.selectedIndex = newIndex; -
Loading and Unloading of swf files in SWF Loader
Hi all,
I have a doubt reg. SWF Loader.
I have created two mxml files A & B.
A. local.mxml
B. SwfSample.mxml
i have two labels and a button in A file and i have set values to those labels and have a method to handle the click event of the button. In B file i have loaded this A file and accessed the labels and methods using SystemManager Component and changed the values of the A file's label and accessed data from A file to B file.
Here comes the problem,
I have two buttons named LoadAgain and Unload
When i click the Unload button, the SWF Loader unloads its content by the method i handled for the Unload button, after that i have clicked on the LoadAgain button to load the same content of A's mxml to the SWF Loader, it loads succesfully,but i was not able to access its Label or Method from the B mxml. Please help me to solve the issue.
local.mxml
<?xml version="1.0" encoding="utf-8"?><mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
<![CDATA[
Bindable]
public var varOne:String = "This is a public variable";
public function setVarOne(newText:String):void
varOne = newText;
]]>
</mx:Script>
<mx:Label id="lblOne" text="I am here" x="28" y="88"/>
<mx:Label text="{varOne}" x="166" y="88"/>
<mx:Button label="Nested Button" click="setVarOne('Nested Button Pressed');" x="28" y="114"/>
SwfSample.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.managers.SystemManager;
import mx.controls.Label;
Bindable]
public var loadedSM:SystemManager;
private function initNestedAppProps():void
loadedSM = SystemManager(myLoader.content);
public function updateLabel():void
lbl.text = loadedSM.application[
"lblOne"].text;
public function updateNestedLabels():void
loadedSM.application[
"lblOne"].text = "I was just updated" ;
loadedSM.application[
"varOne"] = "I was just updated";
public function updateNestedVarOne():void
local(loadedSM.application).setVarOne(
"Updated varOne");
public function unload():void
myLoader.content.loaderInfo.loader.unload();
public function loadAgain():void
myLoader.load(
"../bin-debug/local.swf");
]]>
</mx:Script>
<mx:Label id="lbl" x="72" y="47"/>
<mx:SWFLoader id="myLoader" width="438" source="../bin-debug/local.swf" creationComplete="initNestedAppProps();" y="73" height="238" x="72" alpha="1.0"/>
<mx:Button label="Update Label Control in Outer Application" click="updateLabel();" x="72" y="319"/>
<mx:Button label="Update Nested Controls" click="updateNestedLabels();" x="72" y="349"/>
<mx:Button label="Update Nested varOne" click="updateNestedVarOne();" x="72" y="379"/>
<mx:Button label="Unload" click="unload();" x="72" y="409"/>
<mx:Button label="Load Again" click="loadAgain();" x="72" y="439"/>
</mx:Application>
Thanks & regards,
Sathish.KcreationComplete only fires once when the SWFLoader is created. Therefore you never reset your variables to point to the new sub-app. On a slow network, creationComplete may fire before the sub-app loads. It is best to use the COMPLETE event.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
Change the SWF loading text for a single presentation
This question was posted in response to the following article: http://help.adobe.com/en_US/Presenter/7.0/WS8815BC0A-5D22-4f29-87B9-D9047B5B57E4.html
Hi,
I have Adobe Presenter 7.0.5, in which with recently updating to 7.0.7 version.
When I tried the fix of this "Change the SWF loading text for a single presentation" workaround fix, I passed to have the error:ReferenceError: Error #1069: Property ADOBE_PRESENTER not found on Pool_P75.Resource.UIText
But before this error comes, I see that the loading text is changes from the original 2Adobe Presenter" to the one defined by me on the UIText, as the fix said.
And what's happen is that the scrren with the loading text is not being changed by the learning first slide....
Is there any workaround to correct that error?
Many thanks in advance for any feedback from the adobe support team or from any other colleagues that are using Adobe Presenter (;-)). -
How to get the content in embed swf file in Swf Loader on run time
How to get the content in embed swf file in Swf Loader on run time
[Bindable]
[Embed(source="assets/index.swf")]
private var SWFSRC:Class;
<mx:SWFLoader id="_swfloader" source="{SWFSRC}" />Hi Flex harUI,
Throw the error.
Access of undefined property content -
Loading external SWF's into an SWF Loader as3 style?
Hi,
I've recently made the switch from as2 to as3 and am still struggling to get my head around one aspect in particular. I've managed to load one external swf into a blank file via the script
import LoadDisplayObject;
var loader:LoadDisplayObject = new LoadDisplayObject("button_01.swf", true);
loader.addEventListener("displayObjectLoaded", onComplete, false, 0, true);
addChild(loader);
function onComplete(evt:Event):void {
trace("loaded complete received");
loader.scaleX = loader.scaleY = .75;
.....however I'm struggling with the script to make a swfs load into a space when one of my 3 buttons is clicked....
My page currently has three buttons (button_01, button_02 and button_03) and in a local folder three separate swfs with the same names which I wish to load in, when the appropriate button is pressed.
I have managed to get them to load in using a tutorial...however they load over the top of each over...far from ideal. From research on the internet I've found a range of different script...but I just can’t find anywhere I can find script to make this work..hence why I have turned to here.
Any help much appreciated...thanks in advance.Hi,
Just throught I would let you know that I've manged to get this to work this morning. Changed the script slightly and used a different method of:
var home:MovieClip = this;
function butt1Click(evt:MouseEvent):void {
var ldr:Loader = new Loader();
ldr.load(new URLRequest("button_01.swf"));
ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
function butt2Click(evt:MouseEvent):void {
var ldr:Loader = new Loader();
ldr.load(new URLRequest("button_02.swf"));
ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
function butt3Click(evt:MouseEvent):void {
var ldr:Loader = new Loader();
ldr.load(new URLRequest("button_03.swf"));
ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
function loaded(evt: Event):void {
if(contentClip.numChildren > 0){
contentClip.removeChildAt(0);
contentClip.addChild(evt.target.content);
button_01.addEventListener(MouseEvent.MOUSE_UP, butt1Click);
button_02.addEventListener(MouseEvent.MOUSE_UP, butt2Click);
button_03.addEventListener(MouseEvent.MOUSE_UP, butt3Click);
seems to work well. Only small question is if I want one page to load automatically upon opening...how do I alter the script to do this??? Thanks -
Xcelsius Parent/Child SWF Loader with BICS Connections
We have several Xcelsius Dashboards that use BICS connections to retrieve data from BW queries that we'd like to combine into one Parent/Child tabbed dashboard. I can't seem to find solid information on if this is possible using a SWF Loader component due to the BICS requirement of being published through BW Portal and not InfoView. Does anyone have any ideas (short of combining them into one huge dashboard due to the volume of data)? Thanks!
Hi Chris,
I have been working with SWF loader on the SAP portal using the BICS connection type. It was not supported last time I asked about a year ago. However, it can work if you specify the URL in the SWF loader in this way:
http://sapwebdisp.vestas.net:8103/bicsremotebex?SWF=XXX&TIMESTMP=1318867468000
XXX is the name you publish your child dashboard under. Data can be exchanged between the parent and child dashboard by using the custom component "Data sharer" from Inovista which can be downloaded for free:
http://www.inovista.com
Besides the fact that this setup is unsupported there are some limitations so from my point of view it should only be applied under the following conditions:
1. It is not possible to build eveything into a single dashboard.
2. A solution having several independent dashboards does not make sense.
An alternative might be the setup described in note 1526291. The way I understand it, it binds the dashboards together in a similar way as on a BO server with flash variables.
Regards,
Michael -
Cross-domain SWF loading doesn't work
I've been trying to get cross-domain SWF loading to work for
a while now, but even though it works from the Flash IDE the loaded
SWF is blank when I upload it to a webserver somewhere. And yes,
both servers have a crossdomain.xml file in their root folder, and
I've also used System.security.allowDomain("*"). I've published
both using the 'using network' option in the publish dialog.
Could someone please help me with this, as I can't seem to
find why it isn't loading. I've also read the entire PDF about
Flash 9 security, but I couldn't find anything about external SWF
loading except for the crossdomain files.A little more color on this: If there are 2 or more messages in the active mailbox (and others in a different mailbox), the expand/collapse function works for the messages in the active mailbox. In the message column on the right, all the messages in the conversation are shown (both mailboxes). Only those messages in the active box are shown in the list column when the conversation is expanded. I can kind of see how this might be intentional, but it's strange to see lots of messages in the conversation in the right column, but only one or a few corresponding items in the messge list.
-
New to flash, swf loaded while changing size
i'm trying to create a button that will replace the current
swf with another and i want the size to change between the various
sizes of each page. i'm currently using the following code in the
action inspector:
on(release){loadMovieNum("myfilename.swf",0);
i know there has to be a simple way to do this! a very
grateful thanks to anyone who tries to help!
b3autiful_dizaster wrote:
> i'm trying to create a button that will replace the
current swf with another
> and i want the size to change between the various sizes
of each page. i'm
> currently using the following code in the action
inspector:
>
> on(release){loadMovieNum("myfilename.swf",0);
> }
>
> i know there has to be a simple way to do this! a very
grateful thanks to
> anyone who tries to help!
You can't change size dynamically as it is defined by the
object embed tags.
You could use WMODE transparency which could help you fake it
tho not always best
solution to go with WMODE. It's a very buggy parameter.
WMODE will remove the background color so the flash movie
appear over the html and you
can see the HTML content trough the movie.
You could define some solid shape for the background on
bottom layer to make it look
like SWF background, than change it with the other loaded
movie making it appear as it
changed size while the over all flash size stats the same. As
said above - faking it.
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>
b3autiful_dizaster wrote:
> i'm trying to create a button that will replace the
current swf with another
> and i want the size to change between the various sizes
of each page. i'm
> currently using the following code in the action
inspector:
>
> on(release){loadMovieNum("myfilename.swf",0);
> }
>
> i know there has to be a simple way to do this! a very
grateful thanks to
> anyone who tries to help!
You can't change size dynamically as it is defined by the
object embed tags.
You could use WMODE transparency which could help you fake it
tho not always best
solution to go with WMODE. It's a very buggy parameter.
WMODE will remove the background color so the flash movie
appear over the html and you
can see the HTML content trough the movie.
You could define some solid shape for the background on
bottom layer to make it look
like SWF background, than change it with the other loaded
movie making it appear as it
changed size while the over all flash size stats the same. As
said above - faking it.
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>
SWF loader need to load 100% width and height
Hi,
I have using dashboard in my application.In which the flex pages are loaded using SWF loader. the swf is not loading 100% when i minimize the browser. actually its loading 100% when the browser is full screen mode. suppose the browser is opened in 75% the swf also gets loaded based on the browser size. but after maxmizing the browser the SWF its not expaned to the actuall size of the browser. could you anybody help me plz..?
Thanks & Regards
Muthu
Hi,
I have used this code to load the swf in the main application:
<mx:Canvas id="dashCanvas" creationPolicy="all" cachePolicy="on" width="100%" backgroundColor="#FFFFFF" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
<mx:SWFLoader id="dashBoard" trustContent="true" width="100%" height="100%" scaleContent="true" autoLoad="true"
source="@Embed(source='../../../../assets/appl/dashboard/dashboard.swf')" />
</mx:Canvas>
And i have set width and height as 100% in <mx:Appilcation> .
Thanks and egards
Muthu
When i try to run the mxml individually, It run correctly. As soon as i include it in another mxml using SWFLoader , the components stop working properly. It reflects the data sometime while sometime it doesnt. If i press browser refresh button , the components starts working
again.
here is the code snippet for the mxml where i load another swf file using swf loader.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:views="com.views.*" viewSourceURL="srcview/index.html" styleName="AppBack" height="100%" width="100%" initialize="init()" layout="vertical">
<mx:Style source="assets/css/Main.css" />
<mx:TabNavigator id="tn" height="100%" width="100%" top="-1" right="0" left="0" paddingTop="0" >
<mx:Canvas label="Home" paddingTop="0" paddingLeft="0" paddingRight="0" paddingBottom="0">
<mx:SWFLoader id="loader0" source="AddDeleteAccess.swf" height="100%" width="100%" x="0" y="-15"/>
</mx:Canvas>
</mx:TabNavigator>
</mx:Application>
The Home.swf contains a conbo box and a datagrid.
The combo box stops working sometime and after the browser refresh is click it starts working.
if required i can also paste the code of the file which is being loaded.
scale your loader so it fits the way you want. ie, if your loaded swf is 800x600 (with nothing on the back-stage) and you're loading into a 350x375 swf, after loading is complete, use:
loader.width *= 350/800;
loader.height *= 375/600;
Could someone kindly explain to me how the swf loader component works? How can it be used?
Thanks in advance for any help!
Hi,
Goto following link, will help you
http://ryangoodman.net/blog/index.php/2008/02/14/adding_a_pre_loader_in_xcelsius_dashboar
http://help.sap.com/businessobject/product_guides/xcelsius2008SP3/en/Xcelsius2008_FP3.1_release_notes_en.pdf
http://saptechblogsxcelsius.blogspot.com/
-Obaid
Maybe you are looking for
-
Hi Gurus, We are facing with a typical scenario here. I want to have my Lotus Notes data in SAP BW system. Lotus notes uses NSF file system to store data. I am not clear how can we get this into SAP BW. I tried searching the same in different forums
-
I wanted to sign in and could not. I set up firefox with my old email address and can't remember my password. so I filled in the area for you to send me a reset password. That was hours ago. I am trying to fix this firefox it got really slow with lot
-
Is it possible, in Fontbook, to view last fonts installed?
Hi all. Just like my title states, I was wondering if there's a way to view the last fonts installed in Fontbook? Many times I forget the names of the fonts I recently installed and then I have to go looking for them manually. Very frustrating! b.
-
Hey, I just reinstalled ColdFusion (Developer Edition) and I had to reinstall the mysql-connector-java-3.1.12-bin.jar file into the WEB-INF\lib directory for added connectivity with MySQL 5. Problem is, I can't find that directory anymore... I am run
-
I bought a "monster" adaptor at the apple store made for the iphone so I could plug in a more comfortable pair of headphones. (My earbuds that came with the phone work perfectly fine) The problem is, when i listen to my iphone's ipod....the sound is