Jump to content
Search Community

Default

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

1,123 profile views

Default's Achievements

0

Reputation

  1. I got it! I managed to instead of put the loaded content into a ContentDisplay, i placed the rawContent into a movieclip, then accessed it the same way as i did before! Here's is some sample code of how i solved the issue. var swfONE_mc:MovieClip; var queue:LoaderMax = new LoaderMax({name:"loaderQueue",onChildComplete:slideLoadingQueueComplete, onComplete:loadingSlidesComplete, maxConnections:1}); queue.append( new SWFLoader("Slides/swfONE.swf", {name:"swfONE", estimatedBytes:85000, load:true}) ); function slideLoadingQueueComplete(event:LoaderEvent):void { swfONE_mc= LoaderMax.getContent("swfONE").rawContent; addChild(swfONE_mc); swfONE_mc.myfunctiongoeshere(); ) Simple enough!
  2. Thank you, that does help in some, but i'm still a little boggled with using that the way i need. I have attatched some code below that shows what i'm trying to do without loaderMax. var mySWFLoader:Loader = new Loader(); mySWFLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); mySWFLoader.load(new URLRequest("swfONE.swf")); function onCompleteHandler(evt:Event):void { var embededSWF:MovieClip = MovieClip(evt.target.content); addChild(embededSWF); embededSWF.function_inside_swfONE(); } How would something like this be done with the ContentDisplay from LoaderMax?
  3. I'm very new to LoaderMax, what i'm trying to do is to call a list of swf's and have them cycle through in a slideshow of sorts. I'm adding the loaded SWF's to stage using something similar to the below code. var swfONE:ContentDisplay; var swfTWO:ContentDisplay; var swfTHREE:ContentDisplay; LoaderMax.activate([sWFLoader, ImageLoader]); var queue:LoaderMax = new LoaderMax({name:"loaderQueue",onChildComplete:myChildLoadCompleteFunction, maxConnections:1}); queue.append( new SWFLoader("Slides/swfONE.swf", {name:"swfONE", estimatedBytes:85000, load:true}) ); queue.append( new SWFLoader("Slides/swfTWO.swf", {name:"swfTWO", estimatedBytes:109000, load:true}) ); queue.append( new SWFLoader("Slides/swfTHREE.swf", {name:"swfTHREE", estimatedBytes:195000, load:true}) ); function myChildLoadCompleteFunction (event:LoaderEvent):void { swfONE = LoaderMax.getContent("swfONE"); swfTWO = LoaderMax.getContent("swfTWO"); swfTHREE = LoaderMax.getContent("swfTHREE"); slideContainer.addChild(swfONE); } From there i have code that cycles through each of the swf's and does a bunch of other stuff. However when that same swf appears again i want to "restart" the swf, so i'm trying to call a function inside the loaded swf that will remove all the necessary items and apply new instances. I'm just confusing myself with how i will communicate to the loaded SWF using the "ContentDisplay" class. I feel like i'm making it much harder than it has to be. Any help or simple example would be much appreciated.
  4. Carl, I have sent you a message that contains the link to a zip with a truncated version of my application. Please let me know if you have any questions
  5. Thank you for taking a look. The only code outside of these functions that relates to the loaders a global variable for each loader so i can access it in other functions. I also haven't attached any external listeners (one of the great things i love about your code) You did give me an idea. I haven't tried using older versions of flashplayer. I'll do a little more tinkering and if i'm having further issues i will upload some simplified files for you. Thanks for the quick reply!
  6. Hello, I'm new to Greensock and it's products loving the ease of use and many of the futures the native classes just do not provide, or complicate, but i'm running into an issue... I'm developing an application that continuously loads and unloads swf's. The internal swf's aren't much other than each one seperately loads a different xml file full of content and presents it on the stage. I've been running into issues of memory leaks, and my application running slow and ultimately coming to a complete stop after running for a long period of time. That is why i decided to go to loaderMax. Well here's my issue, i have it running fine, but the memory is still climbing even with the new additions of loaderMax. Actually it seems to be climbing at a higher rate than it did prior to using Loader Max. I'm wondering if i'm doing something incorrect, or if there's something that i've just missed. Here is a snippet of the code that loads the swf's function zoomIn():void { TweenLite.killTweensOf(slideArray[randomSqareNum]); randomSqareNum = Math.floor(Math.random() * 100 / 2); setChildIndex(slideArray[randomSqareNum], numChildren - 1); setChildIndex(curWeather_mc, numChildren - 1); setChildIndex(bottomContent.content, numChildren - 1); setChildIndex(weatherVid, numChildren - 1); sqrOriginalX = slideArray[randomSqareNum].x; sqrOriginalY = slideArray[randomSqareNum].y; TweenLite.to(slideArray[randomSqareNum], .75, {y:720 / 2-60, x:1152 / 2, scaleX:12.5, scaleY:5.2, ease:Circ.easeInOut, delay:.5,onComplete:loadSlideData, autoDispose:true}); } function loadSlideData():void { TweenLite.killTweensOf(slideArray[randomSqareNum]); curSlide = new SWFLoader("Slides/"+ slideXML.image[slideInt].@file, {x:(1150-1000)/2, y:(700-460)/2 - 30, onComplete:DisplaySlide}); curSlide.load(true); addChild(curSlide.content); } function DisplaySlide(event:Event):void { TweenLite.killTweensOf(slideArray[randomSqareNum]); slideLength.delay = slideXML.image[slideInt].timeDelay.@seconds*1000; slideLength.start(); setChildIndex(curWeather_mc, numChildren - 1); setChildIndex(bottomContent.content, numChildren - 1); setChildIndex(weatherVid, numChildren - 1); slideLength.addEventListener(TimerEvent.TIMER, zoomOut,false,0,true); } function zoomOut(event:TimerEvent):void { slideLength.removeEventListener(TimerEvent.TIMER, zoomOut); if(slideInt == slideXML.image.length()-1) { slideInt=0; }else{ slideInt++; } slideLength.stop(); TweenLite.to(slideArray[randomSqareNum], .75, {y:sqrOriginalY, x:sqrOriginalX, scaleX:1, scaleY:1, ease:Circ.easeInOut,onComplete:zoomIn}); removeChild(curSlide.content); curSlide.unload(); curSlide.dispose(true); } I tried doing some tracing on the loader that is being unloaded, and it states "SWFLoader 'loader1' (Myslide)", then "SWFLoader 'loader2' (Myslide)". I'm wondering if each time it's loading if it's creating a new loader every time and not fully unloading the previous. Any help will be greatly appreciated. Also let me know if you have any questions.
×
×
  • Create New...