Redirect [SWF] and [Unload SWF] trace?
Hi all!
I was wondering if there is a way to redirect or disable
[SWF] and [Unload SWF] based messages when working with external
SWFS.
Ideally I would like to redirect trace statements, but I
doubt that's possible.
Thanks!
I would like to add a question to this topic, but instead of describing it, I would like to refer to this forum, where it was described very good: http://www.gotoandlearnforum.com/viewtopic.php?f=33&t=28730
In short:
When the loader object is only referenced by a local variable within a method and there's no other reference to the loader, other than the EventListener, the loaded SWF file is being sporadically unloaded (by the GC perhaps) before I am able to access the loader.content! That's kind of a bug, I guess and not acceptable!
So any help would be much appreciated!
Regards,
Matthias
Similar Messages
-
[SWF] and [Unload SWF] in Debug mode
I am debugging my application and I am noticing some strange output in my console window.
I will get the same line duplicated, it looks like this:
[SWF] C:\Users\Me\Desktop\Development\flash\bin-debug\main.swf
[SWF] C:\Users\Me\Desktop\Development\flash\bin-debug\main.swf
[SWF] C:\Users\Me\Desktop\Development\flash\bin-debug\main.swf
Then at a later state in the application I see this:
[Unload SWF] C:\Users\ Me\Desktop\Development\flash\bin-debug\main.swf
[Unload SWF] C:\Users\ Me\Desktop\Development\flash\bin-debug\main.swf
[Unload SWF] C:\Users\ Me\Desktop\Development\flash\bin-debug\main.swf
Can someone exaplain to me what this means, and why I see duplicates of the exact same lines?I would like to add a question to this topic, but instead of describing it, I would like to refer to this forum, where it was described very good: http://www.gotoandlearnforum.com/viewtopic.php?f=33&t=28730
In short:
When the loader object is only referenced by a local variable within a method and there's no other reference to the loader, other than the EventListener, the loaded SWF file is being sporadically unloaded (by the GC perhaps) before I am able to access the loader.content! That's kind of a bug, I guess and not acceptable!
So any help would be much appreciated!
Regards,
Matthias -
I am making a site and I want each button to load an swf,
which would be the content of each page. When I click on each
button the swf will load, however, the old swf will not go away.
how does one do this. Thanks.It looks like you are adding the newly loaded swf, but not
removing the old one. So, maybe this change would help:
function about_CLICK(myevent:MouseEvent):void{
var loadMain:Loader = new Loader();
loadMain.load(new URLRequest("clip0.swf"));
// if there is a child on the display list remove it
if (getChildAt(0) !=null) removeChildAt(0);
stage.addChild(loadMain);
I should mention, however, that there is a bug in Flash 9
related to unloading swfs:
http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html
However, I don't think this is affecting your visible
behavior. -
Help with load and unload swf file.
hello, just now i try, to load my file using the code snippet 'load and unload' i manage to load the next file succesfully but why my recent file still appear in the background? how do i make it gone?
When you load another SWF you're loading it 'inside' the current SWF but it appears that you want to replace the current SWF entirely with the new SWF, is that correct?
If so you should make what's usually known as a 'stub' or a loader. Make an empty project that merely acts as a loader. It should load your first SWF and when you press a button on that first SWF to load a second SWF, it should signal the 'stub' it's loaded inside to unload the first SWF and then load the second.
e.g. a stub.swf (just coding out of memory, not error checked, just to give a general idea):
// make a new loader to do all the loading of SWFs
var loader:Loader = new Loader();
// and display
addChild(loader);
// a function to load a SWF into the loader (replacing any existing SWF)
function loadSWF(path:String):void
// assure path is defined or do nothing
if (!path) return;
// load requested SWF
loader.load(new URLRequest(path));
// load initial SWF
loadSWF('/path/to/1.swf');
For your 1.swf to use the function, you're currently inside the .content property of a Loader so I believe you can just run a command like: Object(this.parent.parent).loadSWF('/path/to/2.swf');
This example obviously lacks any error checking or transitions but you can add those and season to taste. -
Need to load and unload swf from single htm file
I need to load or unload swf file or we can say that i need load 3 project one by one in current window
mit,
So are you saying you need to have one swf file call a second file to play, then call a third to play...
Which Captivate version are you using?
Are the swf files all captivate published swf's?
Do you have access to Flash Professional and if so what version?
how are you running your file, is it scorm packaged or just html based?
I may be able to help with your issue, but need these details. -
Display/load and Unload SWF in flex
hi friends
i wnat to disply external SWF file into flex but without using SWFLOader(it's make lot's of problem) nad i also Embed that SWF
this is code
[Embed(source="1.swf")]
private var loadswf:Class;
private function load():void{
var symb:MovieClip = new loadswf() as MovieClip;
this.addChild(symb);
it's give me error....
TypeError: Error #1034: Type Coercion failed: cannot convert demos_loadswf@39ab3c1 to mx.core.IUIComponent.
please help to resolve this error or give me suggestion to simple Disply/Load and Unload Embed SWF file in flexthnx Flex harUI
i added UI componentes now my full code is like..
import mx.controls.Image;
import mx.controls.Alert;
[Embed(source = "1.swf")]
public var SWF:Class;
[Embed(source = "2.swf")]
public var SWF2:Class;
private var mc:MovieClip;
private var img:Image;
protected function checkBtn_clickHandler(event:MouseEvent):void
clear();
img = new Image();
img.width=Number("700");
img.height=Number("700");
mc = new MovieClip();
mc = MovieClip(new SWF());
img.source = mc;
vBox0.addChild(img);
protected function critcalBtn_clickHandler(event:MouseEvent):void
clear();
img = new Image();
img.width=Number("700");
img.height=Number("700");
mc = new MovieClip();
mc = MovieClip(new SWF2());
img.source = mc;
vBox0.addChild(img);
protected function clear():void
try{
if(mc!=null){
flash.media.SoundMixer.stopAll();
img.source="";
img.source=null;
mc=null;
vBox0.removeChild(DisplayObject(img));
vBox0.removeAllElements();
vBox0.removeAllChildren();
}catch(e:Error){
Alert.show(e + " ----::---- ");
<mx:Canvas id="vBox0" width="700" height="700" ></mx:Canvas>
<mx:HBox >
<mx:Button id="checkBtn" label="first" click="checkBtn_clickHandler(event)"/>
<mx:Button id="critcalBtn" label="second" click="critcalBtn_clickHandler(event)"/>
</mx:HBox>
now my error gone!!! but one problem is there when i unload my first SWF and load second SWF(on button click), my first SWF sound are still play in Background, i cn't unstand Y this will happen coz i already remove all object and child from my Canvas.
any help on this.... -
I am currently using AS2.
I create a button instance named "myBtn" and i want it to load external swf file call "test2.swf" while unload current swf file named "test1.swf" when pressed/release.
what done is i put following code under mybtn :
on(press)
unloadMovie("test1.swf");
loadMovie("test2.swf" , 1);
the outcome was that , the "test2.swf" was loaded successfully but the "test1.swf" fail to unload.
Any help is welcomeAS2.. Scope is your issue. When you are inside the function for onPress you are telling the button you pressed to unload test1.swf from inside that button (which it's not located in).
You're probably using the root timeline so I'll take a wager this will work:
on (press)
_root.loadMovie("test2.swf");
If you want to monitor progress in loading between them, that's a little more complex. -
Button to navigate and unload swf
I have the following code to load an external swf by clicking a button. It works fine.
btn_01_01.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);
function fl_ClickToLoadUnloadSWF(event:MouseEvent):void
var url:String = event.currentTarget.name+".swf";
fl_Loader.load(new URLRequest("loads/TEST_VID_AS3.swf"));
I also have a button that takes me to another place on the timeline.
this.btn_back_main.addEventListener(MouseEvent.CLICK,fback_main);
function fback_main(evt:MouseEvent)
MovieClip(this.root).gotoAndPlay("main");
But the loaded swf is still visible.
I would like that button to also unload the loaded swf.
Can anyone tell me if it's possible and suggest code?
Thank you in advance.this should do it (assuming the btn to remove it is called "btn_remover"):
var ld:Loader = new Loader();
btn_01_02.addEventListener(MouseEvent.CLICK, v);
function v(e:MouseEvent):void {
ld.load(new URLRequest("loads/TEST_VID_AS3.swf"))
addChild(ld)
btn_remover.addEventListener(MouseEvent.CLICK, removeSwf);
function removeSwf(e:MouseEvent):void {
ld.unloadAndStop();
firstly, i moved the Loader definition outside of the function (otherwise it gets removed at the end of the function and cant be accessed later)
then i added event listener to remove button to call removeSwf function - which calls unloadAndStop() on the loader object
fyi, i suggest you use more descriptive names for your buttons and functions otherwise you'll find it harder to work out whats going on if you come back to it after a break. -
Loading an external swf and unloading the parent one
Hi there i have made a navigation in flash and 3 buttons that load some external swf's. Problem is that when they load the parent swf keeps playing in the background. How can i make them play separately and make the navigation stage dissapear completely when they load?
I have attempted to use the same Loader but it doesnt replace it i dont know why.
var myLoader:Loader = new Loader();
var myLoaderMain:URLRequest = new URLRequest("main1.swf");
var myLoaderQuiz:URLRequest = new URLRequest("quiz.swf");
var myLoaderAnimation:URLRequest = new URLRequest("athens_animation.swf");
var myLoaderVideo:URLRequest = new URLRequest("videogallery.swf");
videogallerybtn.addEventListener(MouseEvent.CLICK, videoFunc);
function videoFunc(curEvt:MouseEvent) {
myLoader.load(myLoaderVideo);
addChild(myLoader);
Quizbtn.addEventListener(MouseEvent.CLICK, quizFunc);
function quizFunc(curEvt:MouseEvent) {
myLoader.load(myLoaderQuiz);
addChild(myLoader);
Animationbtn.addEventListener(MouseEvent.CLICK, AnimationFunc);
function AnimationFunc(curEvt:MouseEvent) {
myLoader.load(myLoaderAnimation);
addChild(myLoader); -
Working with badge.swf and air.swf (browser api)
I basically want to install and run my app through the
browser so ive been testing but can't manage to figure out how the
air.swf api works. i am stuck at loading air.swf. the page below
has a tutorial but a downloadable sample code would be perfect, not
sure where the little snippets of code from the "Loading the
air.swf file", "Checking from a web page if an AIR application is
installed", "installing an AIR application from the browser", and
"Launching an installed AIR application from the browser" go in my
own codebase. Also im a bit unclear on where i get appid or
developer id. if someone has an example app or more in-depth
explantion of incorporating the given code , i would much
appreciate it.
http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.htmlquote:
Originally posted by:
cjm771
can't manage to figure out how the air.swf api works
The main thing you must understand about air.swf
is that its most important functionality can only be called from
within a UI event handler, such as for a button click. It's very
picky about this. You can't, for example, use the button click
event handler to begin the loading of air.swf, then in the "loaded"
callback do the air.swf API call. air.swf has to be loaded and
ready at the time the event handler is called. So, load it on app
startup. I even go to the extent of disabling the buttons that call
into air.swf until it's loaded.
quote:
im a bit unclear on where i get appid or developer id
The appid is your application's unique ID, which
you gave in setting up your project. Adobe recommends using
something based on your web site's domain name, in reverse order as
is done in Java and Objective C. If you're at foo.com, and call
your program Qux, then com.foo.qux is a good appid. The use of
domain-like names helps ensure that programs from different
companies don't collide with each others' namespaces.
By default, the pubid is a random number assigned by the IDE.
I forgot how you find out what number it used, just that there's a
way. Or, you can assign it yourself, in the project settings for
the AIR app. Right-click the project, go to the Run/Debug Settings
section, edit the launch configuration for your AIR app. You'll
find a Publisher ID field there. The documentation for ADL may be
helpful for picking your own pubid.
quote:
if someone has an example app or more in-depth explantion of
incorporating the given code , i would much appreciate it.
See my code in this thread:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=75&catid=697&threadid =1352505&highlight_key=y&keyword1=air%2Eswf -
Different performance in Adobe Scout CC between FlashBuilder debug swf and release swf
Hi all,
In my project, I want to render bitmapData every frame using Graphics.drawTriangles()Hi all,
In my project, I want to render BitmapData every frame using Graphics.drawTriangles().
The main work of project is to render a fullscreen image.
I use two ways to run the project.
1. Debug in FlashBuilder;
2. Use the release swf in Web browsers;
But when I check the performance in Scout CC, I found they are different;
1. Debug in FlashBuilder:
Render the Bitmap each frame
2. Use the release swf in Web browser
Only Render the Bitmap each of there(more or less) frames
Then, what's the reason that the release swf will render bitmap each of there frame instead of each frame? Performance optimization in release swf? -
Facing problem while unloading the SWF file in SWF Loader
Facing problem with SWF Loader.
Background:
I've 4 SWF files (demo1.swf, demo1_skin.swf, demo2.swf and demo2_skin.swf).
These swf files are created throgh Adobe Captivate.
Playing demo1_skin, will play the demo1.swf with the controls at the button such as "Play", "Pause", "Stop", "Forward", "Backward" and Seekbar.
Playing demo2_skin, will play the demo2.swf with the controls at the button such as "Play", "Pause", "Stop", "Forward", "Backward" and Seekbar.
Scenario:
1. Clicked on the video1 leaf of the tree. Video1.swf is getting played.
I am able to click on the seek bar to take the video pointer to the desired position. I can drag the seek bar forward and backward also.
2. Clicked on the video2 leaf of the tree. Video2.swf is getting played.
I am not able to click on the seek bar to take the video pointer to the desired position. Also, I am not able to drag the pointer on the seek bar either forward or backward also.
Play, Pause, Stop, Forward, Backward buttons on the skin works properly.
3. If I again, click on the video1 leaf, point 1 observation is found.
4. clicking agian, on video2 leaf, point 2 observation found.
Please suggest.
I tried with Loader also. But, nothing fruitful. Same result, as I am getting from SWF Loader.
Please find the below used code.
dp.xml
<?xml version="1.0" encoding="utf-8"?>
<root>
<gallery label="All">
<file label="video1" src="demo1_skin.swf" />
<file label="video2" src="demo2_skin.swf" />
</gallery>
</root>
Sample1.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
private function tree_itemClick(event:ListEvent):void {
var t:Tree = event.currentTarget as Tree;
var dataObj:Object = event.itemRenderer.data;
swfLoader.load(null);
if (dataObj.hasOwnProperty("@src")) {
swfLoader.load(dataObj.@src);
]]>
</mx:Script>
<mx:XML id="dp" source="dp.xml" />
<mx:HDividedBox width="100%" height="100%">
<mx:Panel width="200" height="100%">
<mx:Tree id="tree" dataProvider="{dp}" labelField="@label"
showRoot="false" width="100%" height="100%" itemClick="tree_itemClick(event);" />
</mx:Panel>
<mx:Panel id="panel" width="100%" height="100%" backgroundColor="white">
<mx:SWFLoader id="swfLoader" width="100%" height="100%" />
</mx:Panel>
</mx:HDividedBox>
</mx:Application>
log in the console
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\Sample3.swf - 951,034 bytes after decompression
Clicked on the video1 leaf of the tree
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf - 31,309 bytes after decompression
this.getSWFVersion() = 7
contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf - 323,414 bytes after decompression
incrementWait = 1
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
decrementWait = 0
Clicked on the video2 leaf of the tree
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf - 31,311 bytes after decompression
[Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
this.getSWFVersion() = 7
contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf - 477,273 bytes after decompression
incrementWait = 1
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
decrementWait = 0
Clicked on the video1 leaf of the tree (Again)
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf - 31,309 bytes after decompression
[Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf
this.getSWFVersion() = 7
contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf - 323,414 bytes after decompression
[Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf
incrementWait = 1
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
decrementWait = 0
Clicked on the video2 leaf of the tree (Again)
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf - 31,311 bytes after decompression
[Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
this.getSWFVersion() = 7
contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf
[SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf - 477,273 bytes after decompression
incrementWait = 1
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
onLoad m_movie = null
decrementWait = 0
[Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swfTry calling unloadAndStop() before loading a new swf.
http://livedocs.adobe.com/flex/3/langref/mx/controls/SWFLoader.html#unloadAndStop()
http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html#unloadAndStop()
Note that unLoadAndStop()is FP10 only. -
Loading External Swf with Other Swf Dependencies
I'm trying to load an old project into a new project via swf. My old project had local external swf dependencies.In other words A.swf is the old project swf and it loads in B.swf and C.swf. I want to load A.swf into my new project. All the .swf file are local and will be loaded locally. Using the url and loader to load the old project's swf into the new project, I get an error that says that the stage must not be null. I have put A.swf, B.swf, and C.swf all within the same folder together in the new project. Is the correct approach? I'd like to know if this is even possible and if so how should I do it? Thanks in advance!
Hmm I don't believe I have targeted the stage. Here's my code below.
package ExergameShell.screens
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;
import feathers.controls.Screen;
import starling.core.Starling;
import starling.events.Event;
public class Leaderboard extends Screen
private var url1:URLRequest;
private var loader1:Loader;
public function Leaderboard()
addEventListener(starling.events.Event.ADDED_TO_STAGE, init); // necessary for all screens
private function init():void
url1 = new URLRequest("A.swf");
trace(JSON.stringify(url1));
loader1 = new Loader();
loader1.load(url1);
//Starling.current.nativeStage.addChild(loader1);
//loader1.contentLoaderInfo.addEventListener(starling.events.Event.COMPLETE, resetFPS);
private function resetFPS(event:flash.events.Event):void
Starling.current.nativeStage.frameRate = 60; -
Please Can someone point me to some god examplkes on loading and unloading swfs in AS3. I manage to load but unloading is a headache.
Thanks
Att.,
Edwinthere's nothing to study if you're using fp 10:
var yourloader:Loader=new Loader();
yourloader.load(new URLRequest("whatever.swf"));
function unloadF(){
yourloader.unloadAndStop(); -
How to pass a "Button" reference in one swf to anthor swf file?
Dear all:
Please let me describe my problem first.
In my application, there are two swf files:"sender.swf" and
"receiver.swf"
A button named "re_Button" is in "receive.swf", and now i
wanna operate the "re_Button" through the "sender.swf".
How to do this?
Can I access the "re_Button" reference through another swf
application??
And I've tried the "locaconnection" class, but it doesn't
help.
AnyOne helps me?
Thanks in advance -_-I tried the localconnection class:
1).Sender.as:
private var send_tf:TextField;
private function sendMessage(event:MouseEvent):void {
conn.send("myConnection", "lcHandler",send_tf); // to send
the "send_tf" reference to the "Receiver"
2). Receiver.as
public function lcHandler(tf:Object):void {
tf as TextField ==null // here, i find that the "send_tf" is
not a "TextField" any more!!!!!!!!!!!!!!!!
I wanna operate one instance reference in one swf from
another swf.
Is it possiable??
Thanks in advance.
Maybe you are looking for
-
Hey, over the past couple of days my iPhone 4 (GMS, Model A1332, EMC 380B - running on iOS 7.1.2) has begun inexplicably intermittently not recognizing being plugged in to charge or being connected to my laptop. As of today, it has complete stopped r
-
HT4914 Will I pay for storage quantity of songs stored in ICloud in addition to the
Will I pay for the storage quantity of the songs in addition to the $24.99/year for the Imatch?
-
Error in the language of the taxes description (form)
Hi Could anyone guide if for teh below aspect. If there is an issue with respect to "Error in the language of the taxes description (form)" where do you think the possible error would be . Please kindly guide be. Thanks & Regards Sujatha
-
Help with sdk 3.0 firmware for iphone 3g
I recently signed up and paid like 10 dollars for a dev team user to sign me up legally to use the iphone new sdk 3.0. Unfortunately I cannot afford the 99 dollars to apply to the real dev team, but I have so many good ideas and support issues, can s
-
AirPort Extreme Network Setup Help
Currently I am using my AirPort Extreme to create a wireless network for two houses. The problem I have is the devices in the other house have problems with the base station being in 802.11N so I had to force it into 802.11G only. What I would love t