Jump to content


  • Posts

  • Joined

  • Last visited


0 Newbie

Profile Information

  • Location
    Behind the Pine Curtain of Texas
  • Interests
    Fishing (especially bass)
    Guitar & music in general
    Boats (especially fast outboards)
  1. I'd have to guess that you have SWFLoader declared somewhere in your AS code. I think that if you only reference the loader type in your XML that you have to activate it in the AS code to fire the particular loader class. I could be wrong, I'm getting things backwards all the time
  2. Thanks for the tip Carl, it was so obvious once you showed me! Now when I trace in that thumbClick function trace("The current target is= " + event.currentTarget.name); I get The current target is= loader1 The current target is= loader2 The current target is= loader3 The current target is= loader4 or without .name is The current target is= [object ContentDisplay] The current target is= [object ContentDisplay] The current target is= [object ContentDisplay] The current target is= [object ContentDisplay] Now I need to research how to swap the object CDs around per corrosponding thumbnail. Thanks again, you're a great help Karl
  3. Thanks for the response Carl, yeah, I was jamming everything in the mainLoader. Jack had suggested loading it all at once and manipulating after. I know I missed something in the translation to my uneducated eye. LoaderMax creates it's own "array" of sorts doesn't it? And called through the content method? I'll try your suggestion when I get in from outdoor work. Thanks much K
  4. Hi All- If I have an array containing thumbnail and fill size assets, but when targeting either I'm getting null reference errors. I'm loading my assets & putting them into an array in the order I want in my xmlCompleteHandler and cleaning up preloader children and tweening in my displays in the mainCompleteHandler. Up through that point it's doing exactly what I want. Much of how to get to this point was answered in this thread http://forums.greensock.com/viewtopic.php?f=6&t=6240 Now I'm at a loss as to how to properly access the thumb swfs to make them clickable and target the corrosponding main swfs in the node. I'd like to use the swapChildren method but I haven't been able to successfully get to properly triggering from the thumbs... I've used for (var i:int = 0; i < pntLoaders.length-4; i++) in my setupListeners function which will get rid of the null errors but in the end result of this project the nodes may range from 2 to 6 depending on the product. I've read many threads & tutorials but haven't found anything yet that helps me in this situation. The XML: <?xml version="1.0" encoding="iso-8859-1"?> The AS: import com.greensock.events.LoaderEvent; import com.greensock.loading.display.ContentDisplay; import com.greensock.loading.LoaderMax; import com.greensock.loading.data.LoaderMaxVars; import com.greensock.loading.SWFLoader; import com.greensock.loading.data.SWFLoaderVars; import com.greensock.loading.XMLLoader; import com.greensock.TweenMax; import flash.display.MovieClip; import flash.events.MouseEvent; import flash.text.TextField; var mainHolder:MovieClip; var xml:XML; var xmlList:XMLList; var pntLoaders:Array = []; //Preloader stuff var txtProgress:TextField = new TextField(); txtProgress.autoSize = TextFieldAutoSize.CENTER; txtProgress.x = 187.5; txtProgress.y = 190; txtProgress.selectable = false; var txtProgressFormat:TextFormat = new TextFormat(); txtProgressFormat.color = 0x888888; txtProgressFormat.size = 18; plWheel.visible = true; function progressHandler(event:LoaderEvent):void { plWheel.visible = true; txtProgress.visible = true; this.addChild(plWheel); this.addChild(txtProgress); var perc:Number = event.target.progress; txtProgress.text = Math.floor(perc*100).toString() + "%"; txtProgress.setTextFormat(txtProgressFormat); } //End preloader stuff var xmlLoader:XMLLoader = new XMLLoader("assets/data.xml", {name:"assetList", onComplete:xmlCompleteHandler}); xmlLoader.load(); function xmlCompleteHandler(event:LoaderEvent):void{ trace("XML loaded"); var xml = xmlLoader.content; var xmlList = new XMLList(xml.swf); //Setup the mainLoader with all swfs var mainLoader = new LoaderMax(new LoaderMaxVars() .maxConnections(4) .onProgress(progressHandler) .onComplete(mainCompleteHandler) ); for (var p:int = 0; p < xmlList.length(); p++){ //Setup the large swfs into mainLoader var productLoader:SWFLoader = new SWFLoader("assets/products/" + xmlList[p].@url, new SWFLoaderVars() .name(xmlList[p].@name) .x(0) .y(0) .scaleX(.25) .scaleY(.25) ); mainLoader.append(productLoader); } for (var t:int = 0; t < xmlList.length(); t++){ //Setup the thumbnail swfs into mainLoader var tWidth = 80; var tSpace = 18; var tCols = 4; var thumbnailLoader:SWFLoader = new SWFLoader("assets/thumbnails/" + xmlList[t].@url, new SWFLoaderVars() .name(xmlList[t].@thumbName) .x((t % tCols) * (tWidth + tSpace)) .y(415) ); mainLoader.append(thumbnailLoader); } mainLoader.load(); //Build an array of product and thumbnail swfs in the proper order pntLoaders = mainLoader.getChildren(); var i = pntLoaders.length; while (--i > -1) { mainHolder.addChild(pntLoaders[i].content); } TweenMax.to(mainHolder, 0, {alpha:0}); } function mainCompleteHandler(event:LoaderEvent):void{ trace("mainLoader loaded, mainCompleteHandler triggered"); //Tween out the preloader stuff & remove the children TweenMax.to(plWheel, 0.5, {alpha:0}); TweenMax.to(txtProgress, 0.5, {alpha:0}); this.removeChild(plWheel); this.removeChild(txtProgress); trace("The number of children in the mainHolder is " + mainHolder.numChildren); TweenMax.to(mainHolder, 1, {alpha:1}); setupListeners(); } function setupListeners(){ for (var i:int = 0; i < pntLoaders.length; i++){ var thumbArr = LoaderMax.getContent("assets/thumbnails/product" + (i + 1) + ".swf"); var thumbButton:ContentDisplay = thumbArr; thumbButton.addEventListener(MouseEvent.CLICK, thumbClick); thumbButton.buttonMode = true; } } function thumbClick(event:MouseEvent):void{ trace("The thumbnail was clicked"); trace("The current target is= " + event.target.loader); trace("The mainHolder how has " + mainHolder.numChildren + " children"); // } Have I painted myself into a corner again? Any ideas appreciated! Thanks Karl
  5. Hi Rob- I think you can use the scaleMode method in the SWFLoaderVars for that. Like: new SWFLoaderVars() .scaleMode("proportionalInside") or in your case scaleMode="proportionalInside" in your xml. If that's going to skew your SWF you can probably use crop="true" too... HTH Karl
  6. Makes sense Jack, I'm going to work with your examples tomorrow. I'm also re-watching Rich's videos, I seem to learn more every time I watch them. All this AS stuff is making a little more sense all the time. Thanks Karl
  7. First, thanks for all the advice I've gotten here, y'all are great! I had to take some time off from this project to work on other things, thus the delay. I've got everything loading at once now and have an array which is all looking great. I've just one movieclip and all the objects are located during the load making things simple there. Now I'm uncertain how to address manipulating specific items with the array. I've searched all over but nothing seems to address my specific circumstance. If I setup a for statement in my complete handler to trace what I've got in the array for (var i:int = 0; i < pntLoaders.length; i++){ var pntLoadersContent:String = pntLoaders[i].valueOf(); trace("The pntLoaders array content is= " + pntLoadersContent); } I see (with the .name var commented out in my loaders) The pntLoaders array content is= SWFLoader 'loader1' (assets/products/product1.swf) The pntLoaders array content is= SWFLoader 'loader2' (assets/products/product2.swf) The pntLoaders array content is= SWFLoader 'loader3' (assets/products/product3.swf) The pntLoaders array content is= SWFLoader 'loader4' (assets/products/product4.swf) The pntLoaders array content is= SWFLoader 'loader5' (assets/thumbnails/th_product1.swf) The pntLoaders array content is= SWFLoader 'loader6' (assets/thumbnails/th_product2.swf) The pntLoaders array content is= SWFLoader 'loader7' (assets/thumbnails/th_product3.swf) The pntLoaders array content is= SWFLoader 'loader8' (assets/thumbnails/th_product4.swf) I'm at a loss as to access either the loader# or the url so I can assign mouse events & such. I was looking for something like matching "assets/thumbnails/th_product" + (i + 1) + ".swf" after parsing the array but I was getting no where... Maybe taking a break from the project wasn't good for my brain... Any help is appreciated Thanks K
  8. Have you tried setting maxConnections:1 to see if it steps through nicer? Also, check your xml for any errant typos or anything in that last node. What does your xml look like? Can't think of anything more with what you've provided so far... Karl
  9. NP, I think I may be learning a little also while trying to help K
  10. I finally got 5.5 installed here, no errors. Here's what I saw preloader_cs5.fla Output 0.8 0.9899994375386693 hello menu nothing to remove home subMenu 1 loaded Medallion_cs5.fla Fonts missing HelveticaNeue-Medium HelveticaNeue-UltraLigCond Output hello menu nothing to remove home subMenu No errors here either. Is there something on your local box that may be whacky? Karl
  11. You can just zip or rar up the fla & assets then use the Upload attachment of the post, next to Options. Like Carl said, your XMLLoader may be causing you grief. Have you tried running it outside your Preloader function? I've only seen XMLLoader running first, then followed by an xml complete handler. That way you can trace it in the beginning of the complete handler & see if it really did what it was supposed to do. I'm quite a newb so I have seen variations like a lot of these guys... I also see onProgress:progressHandler in both the LoaderMax and SWFLoader's. Maybe that's crimping your style? Dunno. Also, if you wanted you could make use of the progress LM has built in, like var perc:Number = event.target.progress; //Saves some math headache progressBar.prog_txt.text = Math.floor(perc*100).toString() + "%"; See if you can get your stuff uploaded, I'm sure someone here can help Karl
  12. Hi ice- Hard to tell exactly without seeing what part of you code is throwing that error. I like to put traces everywhere I can because I'm a noob. That being said, I'd have to guess that whatever property you are asking for isn't fully loaded at time of asking. Maybe use a different listener like onChildComplete? Dunno... But I had just googled (with quotes) "Error #2099: The loading object is not sufficiently loaded to provide this information" and got 5,280 hits, maybe there's something out there to give a hint?.
  13. Hi Ben, thought I'd chime in here if I could. The error looks pretty strait forward "Loading error on ImageLoader 'reload' (1/images/reload_1.png): Error #2035: URL Not Found". Based on "E|/Adobe%20developer/Flash%20Tutorials/Stacey%20Reiman/Test/Chaohoi%5FV0001/1/images/reload_1.png" I'm guessing your fla is in "E|/Adobe developer/Flash Tutorials/Stacey Reiman/Test/Chaohoi_V0001/" ? If not, maybe that's the issue. I've run into messes like that in the past, I've found that keeping my project directory paths as simple as possible really helps narrowing down like problems, (e.g.: "C:\FlashProjects\loaderMaxTest4\"). Long paths with spaces can make it confusing. HTH A different Karl
  14. Hi Jack, thanks for the patients & insight. I had read in posts & the ASDocs about ContentDisplay objects but I guess it wasn't really sinking in that they Are actually Sprites. I guess with my limited (but growing) knowledge of tracing and troubleshooting, if I didn't see the words "object Sprite" returned I assumed it was something else. I guess with so many years in hardware & networking I have some blinders on regarding coding Thanks for the loop suggestion, I'll be putting that to use today over coffee & Mt Dew sessions. I've had the maxConnections set from 1 to 4 throughout testing, not long before canning that sample it was 2. There again, I've been tweaking things every which way to see what happens during my learning & development. Making better use of the bandwidth is definitely something I can get behind and the main reason I got so interested in GS in the first place. I'm certainly glad that the buddy that I'm doing the site for has patients. I told him we could set him up like the big manufacturers so he could increase his sales, then found out how they do it wasn't cheap & easy, LOL. But then again I'm doing it pro bono so I'm learning on my dime. The separation thing has been bugging be. I figured I needed to create an array of sorts to reference but haven't gotten that far. I'm curious about implementing listeners. When I've been building "Lego style" like I have I sometimes feel I need multiple "onComplete" listeners to point to different functions. Is this just my lack of consolidation (e.g.: experience) or are their times this is viable? Thanks again for the in depth response and I'll be digging in hard today. Kind regards Karl