Jump to content
Search Community

minusone

Members
  • Posts

    3
  • Joined

  • Last visited

minusone's Achievements

0

Reputation

  1. Hey I was searching up some information and I came across some advice you gave. "Also, I would recommend NOT reusing the same loader. Instead, what I typically do is create a new SWFLoader each time I need to load a swf so that I can fade its content in over the top of the other one (they both need to coexist for that to happen) and then use an onComplete on my fade out tween on the old/stale one to call dispose(true) on it when the new one has taken the place of the old one (faded in). Technically you can use the same loader by simply setting its "url" property to a new value and calling load() again, but I just don't think it's typically the best option." Now I understand however I was curious if you can post a quick example on how to tie in a fade out tween to the old/stale loader/content reference in the paragraph above as this is exactly what I need. As I am loading content over,fading images above another however,id like to kill the content underneath it so when I tween out my section,you dont see all the images underneath it as it fades away ( stacked up). Anyone else who can chime in would be greatly appreciated! Thanks in advance.
  2. Hey Jack, Yes stupid me after revising the code and seeing the set up that was given to me, I figured it out. After taking a break from a long days worth of coding Great product,saves us loads of time,Thanks very much
  3. Hey all/Jack. Im having an issue here and im scratching my head, I did do some research and after messing around with the flush parameters it still did not do what I wanted to accomplish So I have to ask for some help on this one. Basically what I am doing is loading in an array of swfs so I can flow through them in a carousel style, with next and previous arrows,logically you click the next arrow,it fades out one swf,and loads in the following swf. However when I use loaderQueue.unload(); and once again load. it will fade out the current swf,but when it loads in the new one it has the new swf overlapping the second one,if i press next again,it has 3 swfs,and so on. So it seems it is not removing my initial content. Hopefully someobody can help me out here Inside of swfVisualView I have public function createListeners():void { BedrockDispatcher.addEventListener( SiteEvent.PREVIOUS_DONE, this.onUnloadSwf ); BedrockDispatcher.addEventListener( SiteEvent.NEXT_DONE, this.onUnloadSwfFinal ); BedrockDispatcher.addEventListener( SiteEvent.NEXT_READY, this.createLoader ); } public function createLoader($event:SiteEvent):void { this.createLoaderQueue(); } public function createLoaderQueue():void { trace("Creating Loader Queue"); var loaderQueue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:this.onProgressHandler, onComplete:this.onCompleteHandler, onError:this.onErrorHandler}); this.appendLoaders(this.data.swfSource); } // Append Several Loaders public function appendLoaders($url:String):void { var urlRequest:String = (BedrockEngine.config.getEnvironmentValue( BedrockData.SWF_PATH ) + this.data.swfSource ); loaderQueue.append( new SWFLoader(urlRequest, {name:"mainClip", estimatedBytes:3000, container:this, autoPlay:false}) ); loaderQueue.load(true); loaderQueue.autoDispose = true; } public function onUnloadSwf($event:SiteEvent):void { trace("I heard it was time to unload?"); loaderQueue.unload(); loaderQueue.dispose(true); loaderQueue = null; } public function onLoadSwf():void { loaderQueue.load(true); } /* Event Handlers */ public function onProgressHandler($event:LoaderEvent):void { trace("progress: " + $event.target.progress); } public function onCompleteHandler($event:LoaderEvent):void { trace($event.target + " is complete!"); //this.onLoadSwfFinal(); } public function onErrorHandler($event:LoaderEvent):void { trace("error occured with " + $event.target + ": " + $event.text); } Inside of the initial container,where I make my index switches to reload a new swf to load I have public function intro($data:Object=null):void { //BedrockDispatcher.dispatchEvent( new SiteEvent( SiteEvent.NEXT_READY, this) ); TweenLite.to(this.container, 3, {delay:0.5,alpha:1}); } public function outro($data:Object=null):void { TweenLite.to(this.container, 1, {alpha:0,onComplete:this.outroDone}); } public function outroDone():void { } public function clear():void { } /* Create Functions */ public function createListeners():void { ButtonUtil.addListeners( this.leftArrow, { down:this.onPrevious} ); ButtonUtil.addListeners( this.rightArrow, { down:this.onNext} ); } public function outroDoneNext():void { BedrockDispatcher.dispatchEvent( new SiteEvent( SiteEvent.NEXT_DONE, this) ); trace("new index number is " + this.indexNumber++); var currentObject:Object = ReachModel.getInstance().brushes.data[this.indexNumber]; var swfContainerClip:SwfVisualView = new EmptyContainer; this.container.removeChildAt(0); this.container.addChild(swfContainerClip); swfContainerClip.initialize(currentObject); this.intro(); } public function outroDonePrev():void { BedrockDispatcher.dispatchEvent( new SiteEvent( SiteEvent.PREVIOUS_DONE, this) ); var currentObject:Object = ReachModel.getInstance().brushes.data[this.indexNumber]; var swfContainerClip:SwfVisualView = new EmptyContainer; this.container.removeChildAt(0); swfContainerClip.initialize(currentObject); this.container.addChild(swfContainerClip); this.intro(); } /* Event Handlers */ public function onPrevious($event:MouseEvent):void { TweenLite.to(this.container, 1, {alpha:0,onComplete:this.outroDonePrev}); trace("new index number is " + this.indexNumber--); //BedrockDispatcher.dispatchEvent( new SiteEvent( SiteEvent.PREVIOUS_DONE, this) ); } public function onNext($event:MouseEvent):void { TweenLite.to(this.container, 1, {alpha:0,onComplete:this.outroDoneNext}); //BedrockDispatcher.dispatchEvent( new SiteEvent( SiteEvent.PREVIOUS_DONE, this) ); } So basically when I unload I just re initilize a new index so it can load in the next swf in my array. Which ultimately it does do,but it will have every previous swf loaded into it behind it. Thanks in advance
×
×
  • Create New...