Jump to content
Search Community

bonassus

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by bonassus

  1. Carl, You Rock! I will try that. Your Video tutorials on TimelinelMax are Awesome. thank you.
  2. I'm trying to use two keyboard keys to stop and start a timelineMax. one key is to stop and start the timeline in the forward direction. the other is to stop and start the timeline in reverse. The problem im having is, that when the timeline is stopped at a label with my stopTimeLine function which calls tl.pause() and then the key for the opposite direction is pressed, it takes two presses to get the timeline moving in the opposite direction and there is what looks like a one frame jog forward or reverse. when the timeline pauses it remains in the forward or reversed state that is was previously in, right? so if it is moving in reverse and is paused then tl.play(); should immediately start it moving forward right? I'm not sure what i am doing wrong and would appreciate some help. I hope i explained that well enough. Thanks! var tl = new TimelineMax({paused:true}); tl.insert( TweenLite.to(beastie, time, {x:250,ease:Linear.easeNone}) ); tl.insert( TweenLite.to(front, time, {x:-(front.width - SWidth),onStart: tlStart,ease:Linear.easeNone}) ); tl.insert( TweenLite.to(hanging, time, {x:-(hanging.width - SWidth) ,ease:Linear.easeNone}) ); tl.insert( TweenLite.to(rugs, time, {x:-(rugs.width - SWidth) ,ease:Linear.easeNone}) ); tl.insert( TweenLite.to(room, time, {x:-(room.width - SWidth ) ,ease:Linear.easeNone}) ); tl.insert( TweenLite.to(trees, time, {x:-(trees.width - SWidth) ,ease:Linear.easeNone}) ); tl.addLabel("label1", 25); tl.addLabel("label2", 50); function tlStart(){ tl.addCallback(onLabelTwo, "label2") tl.addCallback(onLabelThree, "label3") } function stopTimeLine(){ tl.pause(); } function onLabelTwo(){stopTimeLine();} function onLabelThree(){stopTimeLine();} function playHandler():void{ if(tl.paused == true){ tl.play(); } else{ tl.pause(); } } function reverseHandler():void{ if(tl.paused == true){ tl.reverse(); } else{ tl.pause(); } } function myKeyDown(e:KeyboardEvent):void{ if (e.keyCode == 32){ playHandler() ; } if (e.keyCode == 16){ reverseHandler(); } }
  3. I'm trying to load a bitmap with LoaderMax and then use it as a bitmapfill but i'm having trouble accessing the bitmap data or even the loaders rawContent which I assume is where i get the bitmapdata. Would someone please steer me in the right direction? the image is loaded here thumbQueue = new LoaderMax({maxConnections:1}); thumbQueue.append(new ImageLoader("body-bg.gif", {name:"bg"})); and then I can't access the bitmap data what am i doing wrong? var bgTile = loader.thumbQueue.getLoader("bg"); trace(bgTile); // ImageLoader 'bg' (assets/body-bg.gif) trace(bgTile.content); //[object ContentDisplay] trace(bgTile.rawContent); //null trace(bgTile.rawContent.BitmapData); error... how do i assign body-bg.gif to bmd? var bmd:BitmapData = ?????(0,0); // var content = new Sprite(); addChild(content); content.graphics.beginBitmapFill(bmd); content.graphics.drawRect(0, 0, 1500, 500); content.graphics.endFill(); Thanks for any help
  4. I'm loading Mp3 files with MP3Loaders and then using push(event.target.content) to store them in the array, notesArray. When I trace(notesArray); I get : [object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound],[object Sound] so event.target.content is a sound object that contains the mp3? But when i trace(notesArray[0]); I get: undefined Why? how can i access each sound object/ mp3 as an index of the array? what am i doing wrong? here is the code: package { import com.greensock.loading.*; import com.greensock.events.LoaderEvent; public class NoteLoader { private var queue:LoaderMax; public var notesArray:Array = []; public var note2_A; public var note2_A_S; public var note2_B; public var note2_C; public var note2_C_S; public var note2_D; public var note2_D_S; public var note2_E; public var note2_F; public var note2_F_S; public var note2_G; public var note2_G_S; public function NoteLoader() { queue = new LoaderMax({name:"mainQueue", onComplete:completeHandler}); queue.append(note2_A = new MP3Loader("2_A.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_A_S = new MP3Loader("2_A#.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_B = new MP3Loader("2_B.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_C = new MP3Loader("2_C.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_C_S = new MP3Loader("2_C#.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_D = new MP3Loader("2_D.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_D_S = new MP3Loader("2_D#.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_E = new MP3Loader("2_E.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_F = new MP3Loader("2_F.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_F_S = new MP3Loader("2_F#.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_G = new MP3Loader("2_G.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.append(note2_G_S = new MP3Loader("2_G#.mp3", {autoPlay:false,estimatedBytes:25000 }) ); queue.prependURLs("Notes/"); queue.load(); } function completeHandler(event:LoaderEvent):void { notesArray.push(event.target.content); // trace(notesArray[0]); undefined???????? } } } Thanks for any help!
  5. I'm having trouble getting this to work. I'm using the attached font_loader file that loads the font.swf that has Arial embedded in it. I'm trying to use the embedded font with a textField and a textFormat object. but it's not working what am i doing wrong? import com.greensock.loading.*; import com.greensock.events.*; import flash.text.TextField; import flash.text.TextFormat; var fontLoader:SWFLoader = new SWFLoader("font.swf", {onComplete:completeHandler}); fontLoader.load(); function completeHandler(event:LoaderEvent):void { var fontClass:Class = fontLoader.getClass("TestFont"); Font.registerFont(fontClass); trace("loaded successfully"); var tfm:TextFormat = new TextFormat(); tfm.font = "Arial"; var textfield:TextField = new TextField; textfield.setTextFormat(tfm); textfield.text = "this is arial"; addChild(textfield); } It's not working
  6. Yeah, I ended up using PLAY_PROGRESS for the event and then removed the event listener on the the function called by the custom event. Thanks for your response. IntroMp3.playSound(); IntroMp3.addEventListener(MP3Loader.PLAY_PROGRESS,myFunction); } function myFunction(event:Event) { addEventListener( CustomEvents.IntroSound, firstMenuOpen, false, 0, true ); if(IntroMp3.soundTime >= 15 && IntroMp3.soundTime < 15.1) { dispatchEvent( new CustomEvents( CustomEvents.IntroSound ) ); } } function firstMenuOpen(e:CustomEvents){ IntroMp3.removeEventListener(MP3Loader.PLAY_PROGRESS,myFunction); }
  7. Ok I got it to work with an enterframe and an if statment that checks if IntroMp3.soundTime is between 3 and 3.1 so that the loop doesn't run forever. Is there a better way to do this? Thanks. IntroMp3.playSound(); addEventListener(Event.ENTER_FRAME,myFunction); function myFunction(event:Event) { addEventListener( CustomEvents.IntroSound, firstMenuOpen, false, 0, true ); if(IntroMp3.soundTime >= 3 && IntroMp3.soundTime < 3.1) { dispatchEvent( new CustomEvents( CustomEvents.IntroSound ) ); } }
  8. I want to check the MP3Loader.soundTime property and have it trigger an event at 3 seconds but I'm not sure how to do it. Help appreciated thanks. IntroMp3.playSound(); if (IntroMp3.soundTime == 3){ //customEvent here... }
  9. Thanks for helping me with the syntax problems. Much appreciated! Your right about the scaleX and scaleY in the code it was supposed to scale from 0 to the value of var scale (which might change from object to object). my mistake while making the code generic to post it. sorry for the confusion. Thanks for the suggestion of allFromTo that would work well for tweening multiple objects fromTo the same values. The reason i wanted to put the tween in a function was so I could input different values for the tweened parameters thanks again for sorting that out for me!
  10. I wish I could do this: function scaleIn(mc,posX,posY,scale) { var mc; var posX; var PosY; var scale; TweenMax.fromTo(mc, .5, {visible:true, scaleX:scale, scaleY:scale, x:posX, y:posY}, {scaleX:scale ,scaleY:scale, x:posX , y:posX, ease:Back.easeOut}); } function myFunction() { var timeline:TimelineLite = new TimelineLite(); timeline.insertMultiple([ scaleIn(ball1,100,100,1); scaleIn(ball2,100,100,1); scaleIn(ball3,100,100,1); scaleIn(ball4,100,100,1); ], 0, TweenAlign.START, 0.3); } I get these errors: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock::TimelineLite/insert()[com\greensock\TimelineLite.as:332] at com.greensock::TimelineLite/insertMultiple()[com\greensock\TimelineLite.as:382] Any ideas as to how to make this work? or not possible?
  11. Yes that helps. It doesn't tell me why my other code isn't working but i think i made it too complicated anyway. so for this method that I would have to make a estimatedBytes array that corresponds to the image paths array as each file is a little different size. also i have swf files loading along with with image files and they all have the same onProgress for a preloader animation. I know you can do this with different loaders as in the total progress for all loaders. but i'm not sure how that works. I will watch the videos. thanks for your help!
  12. Thanks for your response. Sorry if some of the code was unexplained. thumbPosXArray; and thumbPosYArray; arrange the graphicDesign objects into a grid. thumbScaleOut is a variable that holds the scale amount for the out state for a ROLL_OUT listener of .15. There is a thumbScaleOver variable that holds the value of .2 I was offsetting the x/y of the content inside the Sprite by -400/-300 to center the registration point on the content which is a .jpg 800px by 600px. I wrapped the rawContent with the sprite just to center the registration point so I could scale from the center. I didn't know that I could use the centerRegistration property. It's funny because I got the idea to do that from some one on the forum as an alternative to the transformAroundCenter plugin, oh well now I am familure with another way to center objects. So this will get rid of the need for the graphicDesignArray1Content sprite wrapper. which is great! But its still not working for me. When I try the code below it says Error #1009: Cannot access a property or method of a null object reference, at the, graphicDesignArray = new Sprite; line. I don't understand because this code is called from within a function that is called by the onCompete function of the loader, and the graphicDesignArray is declared at the class level. I don't think there is a problem with scope. private var graphicDesign1:Sprite; private var graphicDesign2:Sprite; private var graphicDesign3:Sprite; private var graphicDesign4:Sprite; private var graphicDesign5:Sprite; private var graphicDesign6:Sprite; private var graphicDesign7:Sprite; private var graphicDesign8:Sprite private var graphicDesignArray:Array; the loaders look like this 1-8: var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new ImageLoader("bin/images/graphicdesign1.jpg", {name:"graphicDesign1", estimatedBytes:1149410, width:800, height:600, scaleMode:"proportionalInside",centerRegistration:true}) ); and then called from within a function that is called from the onComplete of the loaderMax: graphicDesignArray = new Array(graphicDesign1,graphicDesign2,graphicDesign3,graphicDesign4,graphicDesign5,graphicDesign6,graphicDesign7,graphicDesign8); for(var i = 0; i < 8; i++){ graphicDesignArray[i] = new Sprite; graphicDesignArray[i].x = thumbPosXArray[i]; graphicDesignArray[i].y = thumbPosYArray[i]; graphicDesignArray[i].scaleX = thumbScaleOut; graphicDesignArray[i].scaleY = thumbScaleOut; graphicDesignArray[i] = LoaderMax.getContent(graphicDesignArray[i].toString); graphicDesignArray[i].buttonMode = true; graphicDesignArray[i].visible = false; addChild(graphicDesignArray[i]); } The other question I have is about the graphicDesignArray LoaderMax.getContent(graphicDesignArray.toString); line. I don't know if this is correct but the name value passed to the getContent should be a String value as in "graphicDesign1"
  13. I have code that sets up and adds to the stage 8 images loaded with loaderMax. I declare the vars like this: var graphicDesign1:Sprite; var graphicDesign2:Sprite; var graphicDesign3:Sprite; var graphicDesign4:Sprite; var graphicDesign5:Sprite; var graphicDesign6:Sprite; var graphicDesign7:Sprite; var graphicDesign8:Sprite; Then the code below is repeated 8 times for graphicDesign1 through graphicDesign8. graphicDesign1 = new Sprite; graphicDesign1.x = thumbPosX1; graphicDesign1.y = thumbPosY1; graphicDesign1.scaleX = thumbScaleOut; graphicDesign1.scaleY = thumbScaleOut; addChild(graphicDesign1); graphicDesign1Content = LoaderMax.getContent("graphicDesign1"); graphicDesign1Content.x = -400; graphicDesign1Content.y = -300; graphicDesign1.buttonMode = true; graphicDesign1.visible = false; graphicDesign1.addChild(graphicDesign1Content); I would like to do this all at once with a for loop but i don't know the correct syntax and am unsure how to go about it. this is what i have but it doesn't work.i don't know how to handle the concatenation for graphicDesign1Content do i need to treat it like a string? And how can i loop through the array to put a string value in the LoaderMax.getContent("?"); var graphicDesign1:Sprite; var graphicDesign2:Sprite; var graphicDesign3:Sprite; var graphicDesign4:Sprite; var graphicDesign5:Sprite; var graphicDesign6:Sprite; var graphicDesign7:Sprite; var graphicDesign8:Sprite; var graphicDesignArray:Array = new graphicDesignArray(graphicDesign1,graphicDesign2,graphicDesign3,graphicDesign4,graphicDesign5,graphicDesign6,graphicDesign7,graphicDesign8); for(var i = 0; i < 8; i++){ graphicDesignArray[i] = new Sprite; graphicDesignArray[i].x = thumbPosXArray[i]; graphicDesignArray[i].y = thumbPosYArray[i]; graphicDesignArray[i].scaleX = thumbScaleOut; graphicDesignArray[i].scaleY = thumbScaleOut; addChild(graphicDesignArray[i]); graphicDesignArray[i]+Content = LoaderMax.getContent(graphicDesignArray[i]); graphicDesignArray[i]+Content.x = -400; graphicDesignArray[i]+Conten".y = -300; graphicDesignArray[i].buttonMode = true; graphicDesignArray[i].visible = false; graphicDesignArray[i].addChild(graphicDesignArray[i]); } I would also love to know how to use the for loop to populate the graphicDesignArray with graphicDesign1 -8. And maybe even using the loop to declare var graphicDesign1 -8. if someone wants to help by correcting the above for loop it would be much appreciated Thanks!
  14. Thanks Carl. I appreciate your help. I am new at programing. My example was confusing because i over simplified it. the two objects I was controlling in the example are actually arrays of objects themselves. The scale property is a plugin. it's working now and your you help made me realize that I don't need that var number. I thought I had to capture that value in a var. Thanks for the advice about declaring the timelines with the for loop I guess I can just do it all in one place? thanks again.
  15. Im trying to create 8 TimelineLite objects with a for loop calling myFunction which creates them. I'm getting this Error : 1078: Label must be a simple identifier. on this line: timelineArray[number]:TimelineLite = new TimelineLite(); Is the syntax wrong? var timeline1:TimelineLite; var timeline2:TimelineLite; var timeline3:TimelineLite; var timeline4:TimelineLite; var timeline5:TimelineLite; var timeline6:TimelineLite; var timeline7:TimelineLite; var timeline8:TimelineLite; var timelineArray:Array; timelineArray = new Array(timeline1,timeline2,timeline3,timeline4,timeline5,timeline6,timeline7,timeline8); for(var i = 0; i < 8; i++){ myFunction(i); } function myFunction(number){ var number; timelineArray[number]:TimelineLite = new TimelineLite(); timelineArray[number].insertMultiple([ TweenMax.to(object1,1{scale:1,ease:Back.easeOut}), TweenMax.to(object2,1,{scale:1,ease:Back.easeOut}), ], 0, TweenAlign.START, 0.3); }
  16. I found another way. TweenMax.fromTo(mc,1,{scale:0,x:posX ,y:posY}, {scale:1,x:posX - mc.width/2 ,y:posY - mc.height/2}); does the same thing as: mc.ScaleX = 0; mc.ScaleY = 0; TweenLite.to(mc, 1, {transformAroundCenter:{scaleX:1, scaleY:1}});
  17. Oh, that plugin does make it easy. as far as wrapping it in another Sprite and then offsetting its x/y so that the container's registration point is in the center, could you give me an example of what that looks like. Thanks,
  18. I want to use TweenMax's scale property to scale a displayObject from 0 to 1, which works fine. But I also want the object to scale from its center. the displayObject's registration point is located on it's upper left corner so its currently scaling from there. Is there a way to make it scale from the visual center of the displayObject's center with out moving it's registration point? TweenMax.fromTo(displayObject,1,{visible:true,scale:0},{scale:1,ease:Back.easeOut})
  19. With TimelineMax what is the difference between using insertMultiple and appendMultiple. And what is the difference between using TweenAlign.START, TweenAlign.SEQUENCE and SEQUENCE.NORMAL? I looked in the API Documentation but didn't find my answers. Thanks,
  20. Yes that helps. Thank you. Can you direct me to any information about writing a TweenPlugin? Thanks again.
  21. Objects 1-3 visible property's are set to false on instantiation (code not shown). I set the objects visible property to true just before the Timeline starts. Then i'm using the visiblePlugin to set an objects visibility to false in the TweenLite so that it doesn't appear on screen before the tween starts. otherwise object3 is visible for for a second(or so) at scale .1. object1.visible = true; object2.visible = true; object3.visible = true; var Timeline:TimelineLite = new TimelineLite(); Timeline.appendMultiple([ TweenLite.from(object1, .5,{visible:false, scale:.1}), TweenLite.from(object2, .5,{visible:false, scale:.1}), TweenLite.from(object3, .5,{visible:false, scale:.1}), ], 0.2, TweenAlign.START, 0.2); Is there a way that I could do this with out having to set the visible property's to true beforehand. Like this: //objects visibility are set to false. var Timeline:TimelineLite = new TimelineLite(); Timeline.appendMultiple([ TweenLite.from(object1, .5,{visible:true, scale:.1}), TweenLite.from(object2, .5,{visible:true, scale:.1}), TweenLite.from(object3, .5,{visible:true, scale:.1}), ], 0.2, TweenAlign.START, 0.2); this doesn't work because the VisiblePlugin Toggles the visibility at the end of a tween. I want it to Toggle the visibility at the beginning. any suggestions? Thanks
  22. I want to load a few files with a loaderMax object and with a onProgress parameter that controls a perloader bar. when it is finished loading I want another loaderMax object to start loading more files with its own preloader. Should i just put the loader.load(); for the second loaderMax in the onComplete handler for the first? Is there a better way to have a second preloader for files loaded after the onComplete has been called for the first loader? I hope that makes sense. Thanks.
  23. Thanks for your response. I It was the estimated bytes values. They were off by a decimal point. oops. I put in exact values for estimated bytes and the problem stopped. If you are estimating the total bytes of a file for estimatedBytes is it better to estimate higher then the actual value rather then lower? If you are going to put it the exact value of the files for the estimatedBytes property then is it a good idea to set auditSize to false? or do you not need to do that? You mentioned that the nested functions were not a good idea. As I said before I am a bit new to this so please bare with me. Putting the other functions in the constructor function is a bad idea, Right? But when I take them out it stops working. Would you please arrange in the correct way for me. it would be most helpful. Or explain the better way to set it up? Thank you. queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding1.jpg", {name:"branding1", estimatedBytes:42682, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding2.jpg", {name:"branding2", estimatedBytes:148599, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding3.jpg", {name:"branding3", estimatedBytes:689248, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding4.jpg", {name:"branding4", estimatedBytes:101231, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding5.jpg", {name:"branding5", estimatedBytes:121765, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding6.jpg", {name:"branding6", estimatedBytes:81347, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding7.jpg", {name:"branding7", estimatedBytes:59899, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("http://www.bluecubecreative.com/bin/images/branding8.jpg", {name:"branding8", estimatedBytes:88554, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); not allowed to attach the .fla file. It can be found here. The http://www.bluecubecreative.com/bin/swf/test/ any help would be much appreciated. Thank you.
  24. Thank you for your response. It was helpful.
  25. I am new to this so forgive if my question sounds obvious or my code looks simple. I set up a loaderMax with an onProgress. 8 imageLoaders are appended to the LoaderMax Object. When the onProgress handler runs for loaderMax, the progress goes from 0 to 1 multiple times. Is it showing progress for each loader? progress: 0% progress: 31% progress: 26% progress: 70% progress: 77% progress: 21% progress: 28% progress: 25% progress: 32% progress: 38% progress: 48% progress: 54% progress: 61% progress: 67% progress: 73% progress: 80% progress: 86% progress: 93% progress: 96% progress: 87% progress: 92% progress: 97% progress: 91% progress: 97% progress: 94% progress: 99% progress: 93% progress: 98% progress: 47% progress: 49% progress: 51% progress: 53% progress: 55% progress: 58% progress: 60% progress: 62% progress: 64% progress: 66% progress: 69% progress: 71% progress: 73% progress: 75% progress: 77% progress: 79% progress: 82% progress: 84% progress: 86% progress: 88% progress: 90% progress: 93% progress: 95% progress: 97% progress: 99% progress: 100% I tried using the XMLLoader with the parse function but it did the same thing. I also tried taking out the container parameter that adds the ContentDisplay object but that didn't help. I want it to load Image files and swf's together a ImageLoaders and SWFloaders appendedand to the LoaderMax object and monitor the progress from 0 to 1. What am i doing wrong? below is the code that is causing my problems. any help would be much appreciated. package { import flash.display.MovieClip; import com.greensock.*; import com.greensock.easing.*; import com.greensock.loading.LoaderMax; import com.greensock.loading.XMLLoader; import com.greensock.loading.ImageLoader; import com.greensock.events.LoaderEvent; import flash.events.MouseEvent; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; import com.greensock.loading.display.ContentDisplay; public class test extends MovieClip { private var branding1:ContentDisplay; private var branding2:ContentDisplay; private var branding3:ContentDisplay; private var branding4:ContentDisplay; private var branding5:ContentDisplay; private var branding6:ContentDisplay; private var branding7:ContentDisplay; private var branding8:ContentDisplay; public function test() { var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new ImageLoader("images/branding1.jpg", {name:"branding1", estimatedBytes:4200,container:this,alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding2.jpg", {name:"branding2", estimatedBytes:14600,container:this,alpha:0, width:800,height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding3.jpg", {name:"branding3", estimatedBytes:6700, container:this, alpha:0, width:800,height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding4.jpg", {name:"branding4", estimatedBytes:9900, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding5.jpg", {name:"branding5", estimatedBytes:11900, container:this, alpha:0, width:800,height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding6.jpg", {name:"branding6", estimatedBytes:8000, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding7.jpg", {name:"branding7", estimatedBytes:5900, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.append( new ImageLoader("images/branding8.jpg", {name:"branding8", estimatedBytes:8700, container:this, alpha:0, width:800, height:600, scaleMode:"proportionalInside"}) ); queue.load(); function progressHandler(event:LoaderEvent):void { preloader_txt.text = Math.round(event.target.progress * 100) + "%"; trace("progress: " + Math.round(event.target.progress * 100) + "%"); } function completeHandler(event:LoaderEvent):void { branding1 = LoaderMax.getContent("branding1"); branding2 = LoaderMax.getContent("branding2"); branding3 = LoaderMax.getContent("branding3"); branding4 = LoaderMax.getContent("branding4"); branding5 = LoaderMax.getContent("branding5"); branding6 = LoaderMax.getContent("branding6"); branding7 = LoaderMax.getContent("branding7"); branding8 = LoaderMax.getContent("branding8"); trace(event.target + " is complete!"); } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } } } }
×
×
  • Create New...