Jump to content

Search the Community

Showing results for tags 'swf'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 / JS
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 18 results

  1. Hi all... Is there anyone here??? I've found a simple but useful code developed a few years ago... it loads 2 swf files in sequence ... But I have just one question... How can I Loop them? How can you change the code to load swf1 after swf2 is finished? I've tried almost the whole day but no result yet... Please help... thank you a lot... import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import flash.events.Event; //create SWFLoaders var swf1:SWFLoader = new SWFLoader("child1.swf",{container:this,y:100,onProgress:progressHandler,onComplete:completeHandler,autoPlay:false}); var swf2:SWFLoader = new SWFLoader("child2.swf",{container:this,y:100,onProgress:progressHandler,onComplete:completeHandler,autoPlay:false}); var currentSWFLoader:SWFLoader = swf1; //adjust the progress bar; function progressHandler(e:LoaderEvent):void { bar.scaleX = e.target.progress; trace(e.target.progress); } //tell the loaded swf to play and start tracking frames function completeHandler(e:LoaderEvent):void { //the target of the LoaderEvent is the SWFLoader that fired the event //the rawContent is the loaded swf e.target.rawContent.play(); addEventListener(Event.ENTER_FRAME, checkFrame); } function checkFrame(e:Event):void { //check to see if loaded swf is done playing if (currentSWFLoader.rawContent.currentFrame == currentSWFLoader.rawContent.totalFrames) { trace("swf done playing"); removeEventListener(Event.ENTER_FRAME, checkFrame); //if the first swf is done playing load the second swf if (currentSWFLoader == swf1) { currentSWFLoader.dispose(true) // dispose and unload content currentSWFLoader = swf2; currentSWFLoader.load(); } } } bar.scaleX = 0; currentSWFLoader.load();
  2. Hello, I'm on a project created in Flash Builder 4.7 and Flash Professional CS6, nice. I need the project load's a SWF in the "preloaded SWF", the first SWF, loads a second SWF, and this second would be the "Home" of the project. At this point, work's perfectly. but when the home try to load secondaries SWF sends me The code of the first SWF: package { import flash.display.DisplayObject; import flash.display.Loader; import flash.display.MovieClip; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.ProgressEvent; import flash.net.URLRequest; public class InitialSWF extends MovieClip { private var _loader_:Loader; private var _applicationContent_:DisplayObject; private var _loaderContent_:MovieClip; private var _loaderIcon_:MovieClip; public function InitialSWF() { super(); _loader_ = new Loader(); _loader_.contentLoaderInfo.addEventListener(Event.COMPLETE,_onComplete_,false,0,true); _loader_.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,_onIoError_,false,0,true); _loader_.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,_onProgress_,false,0,true); _loader_.load(new URLRequest("Home.swf")); } private function _onComplete_(param1:Event) : void { _applicationContent_ = _loader_.content; _applicationContent_.visible = true; stage.addChild(_applicationContent_); _applicationContent_.addEventListener("onApplicationComplete",_onApplicationComplete_,false,0,true); _loader_.contentLoaderInfo.removeEventListener(Event.COMPLETE,_onComplete_); _loader_.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,_onIoError_); _loader_.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,_onProgress_); _loader_.unload(); _loader_ = null; } private function _onApplicationComplete_(tmpEvt:Event) : void { _applicationContent_.removeEventListener("onApplicationComplete",_onApplicationComplete_); _loaderContent_.addEventListener("loaderOut",_onLoaderOut_,false,0,true); // do something } private function _onLoaderOut_(param1:Event) : void { _loaderContent_.removeEventListener("loaderOut",_onLoaderOut_); _applicationContent_.visible = true; stage.removeChild(this); } private function _onIoError_(tmpError:IOErrorEvent) : void { trace(tmpError); } private function _onProgress_(param1:ProgressEvent) : void { var _progress_:Number = Math.round(param1.bytesLoaded / param1.bytesTotal * 100); //Do animation loading } } } And the HomeSWF: package { import flash.display.DisplayObject; import flash.display.Loader; import flash.display.MovieClip; import flash.display.Sprite; import flash.events.DataEvent; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.ProgressEvent; import flash.events.HTTPStatusEvent; import flash.net.URLRequest; public class SecondarySWF extends Sprite { private var _loader_:Loader; private var _loaderContent_:MovieClip; private var _loaderIcon_:MovieClip; private var _applicationContent_:DisplayObject; public function SecondarySWF() { this.addEventListener(Event.ADDED_TO_STAGE,this._GoLogin_,false,0,true); } public function _GoLogin_(tmpEvent:Event) { _loader_ = new Loader(); _loader_.contentLoaderInfo.addEventListener(Event.COMPLETE,_onComplete_,false,0,true); _loader_.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,_onIoError_,false,0,true); _loader_.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,_onProgress_,false,0,true); _loader_.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler); _loader_.load(new URLRequest("SecondarySWF.swf")); } private function httpStatusHandler(event:HTTPStatusEvent):void { trace(event); } private function _onComplete_(param1:Event) : * { _applicationContent_ = _loader_.content; _applicationContent_.visible = true; stage.addChild(_applicationContent_); _applicationContent_.addEventListener("onApplicationComplete",_onApplicationComplete_,false,0,true); _loader_.contentLoaderInfo.removeEventListener(Event.COMPLETE,_onComplete_); _loader_.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,_onIoError_); _loader_.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,_onProgress_); _loader_.unload(); _loader_ = null; this.removeEventListener(Event.ADDED_TO_STAGE,this._GoLogin_); } private function _onApplicationComplete_(param1:Event) : void { _applicationContent_.removeEventListener("onApplicationComplete",_onApplicationComplete_); _loaderContent_.addEventListener("loaderOut",_onLoaderOut_,false,0,true); // .. } private function _onLoaderOut_(param1:Event) : void { _loaderContent_.removeEventListener("loaderOut",_onLoaderOut_); //_applicationContent_.visible = true; //stage.removeChild(this); } private function _onIoError_(tmpError:IOErrorEvent) : void { trace(tmpError); } private function _onProgress_(param1:ProgressEvent) : void { var _progress_:Number = Math.round(param1.bytesLoaded / param1.bytesTotal * 100); // .. } } } This is an image of the Google console.log, and catch this: -start InitialSWF -Load HomeSWF -Complete loaded of HomeSWF -Start HomeSWF -The link of the Secondary SWF, I deleted the link in the image because contains data of me... -Load SecondarySWF - ERROR I don't know why the SecondarySWF is 100% loaded but return an error... Regards!
  3. Hey !! I am new at Actinscript, I'm working with Adobe Animate CC and I have a project based on AIR for Android. I want a code that can run and play an AS3 external SWF flash game in full screen with auto-resize to support different android screen sizes. Can you help me with the code please.
  4. So I have a swf file with an embedded font I made in Flash Pro. What I'm trying to do is dynamically load this swf into my project using LoaderMax and SWFLoader, then register that font so it can be used later. The swf is downloaded and stored locally beforehand. It seems to be loading the swf fine, the problem is when I try to register the font, it throws an error saying the class from the swf is invalid. Code to load the SWF: FontLoader = new LoaderMax( { onComplete: fontsLoaded, skipFailed: true } ); for(var i:int=0; i < mainXML.Fonts.Font.length(); i++) { name = mainXML.Fonts.Font[i].FontFamily.text(); fileName = File.applicationStorageDirectory.resolvePath("UpsellAssets/" + name + ".swf").nativePath; FontLoader.append( new SWFLoader( fileName, { name: name } ) ); } FontLoader.load(true); onComplete function: private function fontsLoaded(e:LoaderEvent):void { var loader:SWFLoader = FontLoader.getLoader("Myriad"); _fontClass = loader.getClass("Myriad") Font.registerFont(_fontClass);//throws error here...The value specified for argument font is invalid. } _fontClass seems to load properly, but I cant seem to access the font. Any insight on what might be wrong would be greatly appreciated. Thanks ^.^
  5. I have a game that subloads a SWF, plays for a while, then pops off that SWF and loads up another, repeating this behavior. We have been trying to track down a memory leak with this process which is preventing the subloaded SWF from being garbage collected. I discovered your site and tried implementing LoaderMax thinking it may be the savior to my memory leak problems, but after implementing it, it would seem the subloaded SWF is still not being cleaned up (even with calling the unload method on your LoaderMax object). Was I wrong in assuming LoaderMax could somehow clean up a subloaded SWF even if there may be lingering references to the stage, or some type of cyclic reference that is preventing the garbage collector from cleaning up the SWF? What should I be on the lookout for so that I can get the subloaded SWF's memory freed up?
  6. Hello, I'm working on cleaning up some legacy code so it can be unloaded from the parent SWF and ran into an issue that when any TweenMax function is called within a child SWF (eg. TweenMax.killAll(), just that, nothing else is called), it blocks the child SWF from being unloaded. The same issue cannot be repeated when instead of TweenMax I use TweenLite or TweenNano. Using advanced telemetry Adobe Scout just shows that TweenLite initializers are not garbage collected. As a note, the parent SWF also uses TweenLite. The child SWFs are loaded into the parent in the same application domain and security domain using LoaderMax. I am using * VERSION: 12.0.0 * DATE: 2013-01-21 of TweenNano and * VERSION: 12.1.5, * DATE: 2014-07-19 of TweenMax (the latest package) Any ideas as to what might cause this are appreciated. I would upload the scout session files but those are ~14mb each, instead I can offer dropbox links: https://dl.dropboxusercontent.com/u/15108424/EvoWrapper/EvoWrapper-collected.flm https://dl.dropboxusercontent.com/u/15108424/EvoWrapper/EvoWrapper-notCollected.flm
  7. Hi, I am working on a project, in which I am trying to move 12 SWF files simontaneously with the help of (TweenMax.allTo). but when I try this in browser, many frames are skipping during movement. size of each SWF is 2500X2400 px and I'm using 4 MB jpg image in SWF as backfround. Code : TweenMax.allTo([CONTAINER_1, CONTAINER_2], groundFriction, { x:xPos, y:yPos} ); Both the containers are containing 6 SWF files. xPos and yPos is calculating dynamically on keyboard key down event, and I am using ENTER_FRAME to move the canvas. If someone knows how to deal with it, please help me. Thanks in advance.
  8. Hello all, Was wondering if any one can see what the problem with this class is. What I'm trying to achieve is to load content into an empty container (_main.container in LoadSWF.as) that is instantiated from my main class (Main.as) where I can keep its position fluid. I'm just transitioning to Greensock but have a tight deadline to get this working so I'm kind of hoping someone can help spot what I'm doing wrong. After I get this resolved I should be smooth sailing. Main Class - I want to load my external .swfs into a library object that is dynamically added here (var container) DockMenu Class - Where my navigation takes places, I want to call LoadSWF from here. LoadSWF Class - Reusable Loading class for swfs, my debugger is pointing to line 40 Any other areas that catch any of your eyes that could be improved or are incorrectly done let me know, the only way I can learn this stuff is by being shown I've found recently. Thanks in advance everyone, btw I don't think I'll ever use AS3 and Flash without Greensock again!
  9. Trying to tween a swf loader var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,oncomplete:completeHandler,onError:errorHandler,maxConnections:5}); queue.append( new SWFLoader("shoeHorn.swf", {name:"start", estimatedBytes:1363148.8, container:this, autoPlay:true,visible:false,onComplete:completeHandler}) ); queue.append( new SWFLoader("yourvids.swf", {name:"yv", estimatedBytes:1080, container:this, autoPlay:false,visible:false}) ); queue.append( new SWFLoader("book_Luanch.swf", {name:"bookl", estimatedBytes:10670, container:this, autoPlay:false,visible:false,x:0,y:0,width:1000,height:600}) ); LoaderMax.prioritize("shoeHorn.swf"); queue.load(); function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } function completeHandler(event:LoaderEvent):void { TweenLite.from(event.target.content, 0, {x:0,y:0,autoAlpha:1}) setChildIndex(Object(root).spauseBtn,numChildren - 1); TweenLite.to(splayBtn, 1, {autoAlpha:1 }); TweenLite.to(Object(root).fullScreenBtn, 2, {autoAlpha:1}) trace("it worked!"); } function bookon():void { TweenLite.to(bookl.content, 1, {autoAlpha:1}); }
  10. Hi people! Help me please! I have this package code for a section menù. I have on the stage 4 menù item (name:swf1,swf2,swf3,swf4) and have one progress bar (name:progress_mc). I have in the folder "swf" 4 swf (name:swf1,swf2,swf3,swf4). I start with load swf and then when I click on one of the buttons load the swf corresponding (by the istance name). I would like to implement this code whit LoaderMax for load/unload this external swf and mark the progress bar. But I can not do! someone can help me? Tnx! package { import flash.events.MouseEvent; import flash.net.URLRequest; import flash.display.*; import flash.events.Event; public class caricaredatiesterni extends MovieClip { var defaultSWF:URLRequest = new URLRequest("swf/swf1.swf"); var loader:Loader = new Loader(); public function caricaredatiesterni() { var swf=new Array(swf1,swf2,swf3,swf4) for(var i:int=0; i<swf.length; i++) { swf.addEventListener(MouseEvent.CLICK, openSwf); } loader.load(defaultSWF); addChild(loader); } public function openSwf(e:MouseEvent) { removeChild(loader); var newSWFRequest:URLRequest = new URLRequest("swf/" + e.target.name + ".swf"); loader.load(newSWFRequest); addChild(loader); } } }
  11. Hi, I'm having trouble with the initial loading of my swf file. - it is visible and audible before it's fully loaded so it shows on stage as though it's paused but the sound is playing. The progress bar is visible on top of the loading swf. How do I make it visible and audible only once it's fully loaded? If I put the following code: event.target.content.visible = false; SoundMixer.soundTransform = new SoundTransform(0); in the progressHandler event the sound and image is hidden but I'm not sure where to restart it once progress equals 1. If I restart it in completeHandler it does exactly what I've mentioned above. Here is my code: Thanks. public class main extends MovieClip { private var currentSWFLoader:SWFLoader; private var swf1:SWFLoader = new SWFLoader("movie1.swf",{container:this,autoPlay:false, width:480,height:480,x:300,scaleMode:"proportionalInside", onComplete:completeHandler,onProgress:progressHandler, onChildComplete:childCompleteHandler}); public function CyberWalkColourSound() { progress_mc.scaleX = 0; } //LOAD MOVIE ONE; private function loadmovie1(event:MouseEvent):void { currentSWFLoader = swf1; currentSWFLoader.load(true); } function progressHandler(event:LoaderEvent):void { progress_mc.scaleX = event.target.progress; trace("progress: " + event.target.progress); progress_mc.visible = true; setChildIndex(progress_mc, numChildren - 1); } function childCompleteHandler(e:LoaderEvent):void { trace(e.target + " loaded"); } function completeHandler(e:LoaderEvent):void { progress_mc.visible = false; currentSWFLoader.rawContent.play(); trace(currentSWFLoader.rawContent + "playing"); }
  12. Hi, Any chance someone might know why I can't see my loaded swf files. I can hear the audio and the trace statements says they are loaded, but they are not visible. I'm guessing it has something to do with the container. I'm hoping you can see something obvious in my code. Thanks. public class Main extends MovieClip { private var currentSWFLoader:SWFLoader; private var swf1:SWFLoader = new SWFLoader("movie1.swf", {container:movieTwo_mc, autoPlay:false, width:480, height:480, x:300,scaleMode:"proportionalInside",onComplete:completeHandler}); private var swf2:SWFLoader = new SWFLoader("movie2", {container:movieTwo_mc, autoPlay:false, width:480, height:480, x:300, scaleMode:"proportionalInside",onComplete:completeHandler}); public function Main() { homePage_mc.movieOne_btn.addEventListener(MouseEvent.CLICK, loadOne); homePage_mc.movieTwo.addEventListener(MouseEvent.CLICK, loadTwo); } //LOAD MOVIE ONE; private function loadOne(event:MouseEvent):void { trace("one"); currentSWFLoader = swf1; currentSWFLoader.load(true); homePage_mc.movieOne_btn.removeEventListener(MouseEvent.CLICK, loadOne); } private function loadRed(event:MouseEvent):void { trace("two"); currentSWFLoader = swf2; currentSWFLoader.load(true); homePage_mc.movieTwo_btn.removeEventListener(MouseEvent.CLICK, loadTwo); } function completeHandler(e:LoaderEvent):void { trace(e.target + " loaded"); e.target.rawContent.play(); homePage_mc.visible = false; btnListener(); } private function btnListener():void { home_btn.addEventListener(MouseEvent.CLICK,resetScreens); } //RESET SCREENS; public function resetScreens(event:MouseEvent):void { currentSWFLoader.unload(); home_btn.removeEventListener(MouseEvent.CLICK,resetScreens); homePage_mc.visible = true; trace("reset screens"); } } }
  13. Hello, do someone know how to edit code below to LoaderMax? All help will be very appreciated. Thanks so much in advance. var menubarLoader:Loader = new Loader(); var menubarReq:URLRequest = new URLRequest("../swf/menubar.swf"); var menuMc:MovieClip; menubarLoader.load(menubarReq); menubarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); function completeHandler(e:Event):void { menuMc = MovieClip(menubarLoader.content); menuMc.contacts_btn.name_txt.text = "Contacts"; }
  14. Hi, I am having big time losses in creating a project: I have multiple games that use a common AssetsLoader class to load a toolbar manager (agent), that loads a toolbar through another assetsloader. The structure is as follows: a single configurable toolbar, 3 agents (toolbar managers) for 3 kinds of games, 80 games. Now, when I modify the toolbar code I can recompile it, it takes a few seconds, and the same is for the 3 agents, but recompiling 80 games is terrible! Why should I recompile all games? I noticed that if I modify the toolbar or an agent I have to recompile the parent cascaded swfs, otherwise I wouldn't see the agent or toolbar modifications in game as if recompiling the game I included agent and toolbar inside it. If I modify a game I need to recompile it, and it is ok; if I modify an agent I have to recompile it and all the games that load it; if I recompile the toolbar I have to recomile it, all agents, and consequently all games, and this is absolutely no good! I tried to cast the agent to * instead of the corresponding interface, but nothing changed. I tried to mess around with the application domains (trying to use a different sandbox for the agent and the toolbar), but I think I don't know very well how this works. I use LoaderMax for assets, and interfaces to access an agent from games and the toolbar from agents: game -> interface(agent) -> interface(toolbar). Can you help me please?
  15. Hello, I have strange problem loading swf file, in the preloading event most of the time the preloading progress value isvery small and then after 2/3 of loading progres speed up. On the server when I multiply the number with 100 and rount the walue I got 0% all the time and then it jumps to the 100%. private function onLoadingProgress(event:LoaderEvent) { percent_num = Math.round((event.target.bytesLoaded/event.target.bytesTotal) * 100); parent_class.mainPreload.progressData(percent_num); }
  16. Hi, Quick question as I'm a bit of a noob to LoaderMax. I'm creating SWF files with custom content and loading them using LoaderMax. It's all working great. However, my external swf's are like "windows" with their own close buttons. In the past I've used: Movieclip(this.parent).unLoadContent(); This, however, does not work using LoaderMax. Is it possible to call unload from the loaded SWF (child)? Any help would be greatly appreciated. Many thanks, J.
  17. Hi all, I am completely new to this stuff, and have a problem that I don't seem to find the answer for anywhere. I have made an animation in Flash CS5, where I have created a main animation and a loader with GreenSock SWFLoader, as the main animation is quite big (appx. 8 Mb). I have used the sample code on the LoaderMax information page, and created a .fla file with the following AS code in the first frame: import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new SWFLoader("IntroAnim.swf", {name:"IntroClip", estimatedBytes:8000000, container:this, x:0, y:0, width:500, height:250, autoPlay:true}) ); LoaderMax.prioritize("IntroClip"); //same as LoaderMax.getLoader("photo1").prioritize(); queue.load(); function progressHandler(event:LoaderEvent):void { } function completeHandler(event:LoaderEvent):void { var image:ContentDisplay = LoaderMax.getContent("IntroClip"); TweenLite.to(image, 1, {alpha:1, y:0}); } function errorHandler(event:LoaderEvent):void { } As everyone can see, I have used the sample code from the LoaderMax page, just omitted everything except from the SWF part, as I don't need any images or anything else than the SWF animation to show up. I have also omitted the tracing functionality, as when I tested it in Flash, everything loaded nicely and the animation played as intended. All tracing information indicated success - therefore the tracing statements have been removed now. Even when I try to open the IntroLoader.swf file directly from my Windows Explorer, it plays as a charm. Now, I am creating a website in DreamWeaver CS5, where I have embedded the IntroLoader.swf loader in one of the pages. However, when I look at the page in Live View, or try to load it in any browser (have tried IE9, FirefFox 10, Opera 10, Google Chrome 17, etc) - all I see is the background color. No animation at all. A little comment: When I try to run the main animation alone - without the loader - it plays just fine in all browsers, as well as in Live View in DreamWeaver. I've tried practically everything, but am completely stuck. Hope that anyone here can help. Thanks in advance. Best regards.
  18. Hello, I have a question about accessing loaded swf files by SWFLoader class. I am loading swf file and want to play/stop its content on certain event managed by certain function, not autoplay. I have managed to access child clip of loaded swf (see sample code below). But is there a way to "play" directly the loaded swf file, so I do not have to put all my animations into child clips of loaded swf? Thanks up front for any suggestions kuba import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; import com.greensock.loading.data.*; import flash.display.MovieClip; var clip_var:MovieClip; var myLoader:SWFLoader = new SWFLoader("data/swf/test2.swf", {name:"nameSwf", container:container_mc, autoPlay:false, onComplete:completeHandler} ); //start loading myLoader.load(); function progressHandler(event:LoaderEvent):void { //trace("progress: " + event.target.progress); } function completeHandler(event:LoaderEvent):void { trace(event.target + " is complete!"); clip_var = myLoader.getSWFChild("clip_test") as MovieClip;//GET CHILD CLIP OF LOADED SWF (NAMED "clip_test") } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } function swfPlay(e:MouseEvent):void { clip_var.play(); } stage.addEventListener(MouseEvent.CLICK, swfPlay);