Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by icekomo

  1. Hello, I am building a prototype app for work, and have the app set up using loaderMax to load in an xml file with all my data. That all works great, but what I am not able to do is to use an image more then once. here is my AS: I'm not even sure that the way I am doing this is the best way. I load my images, and then place them into an array (brewerImages). private var brewerImages:Array; brewerImages = [LoaderMax.getContent("brewer1"),LoaderMax.getContent("brewer2"),LoaderMax.getContent("brewer3"),LoaderMax.getContent("brewer4")]; I then pass this array to the class that I am using it in. The class I am using this in need to use and index of the array (an image) more then once, which is where I run into problem. I was doing some research and I think that I will need to use the bitmap data for this, but I wasn't able to figure it out. Any help would be wonderful! Thanks!!
  2. Why does this code work in 10.1 but not in 10.2? package classes.main { import flash.display.*; import flash.events.*; import flash.display.MovieClip; import flash.text.TextField; import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; //import com.greensock.loading.display.*; public class Preloader extends MovieClip { public var loader:LoaderMax = new LoaderMax({name:"mainQueue",onComplete:completeHandler,onFail:errorHandler}); public var progressBar:MovieClip = new progBar_mc(); public function Preloader():void { addChild(progressBar); //starts the load for the swf file, and adds it to this container loader.append( new SWFLoader("teset.swf", {onProgress:progressHandler,container:this}) ); //loads the data loader.load(); } public function progressHandler(event:LoaderEvent):void { var perc:Number = event.target.bytesLoaded / event.target.bytesTotal; progressBar.prog_txt.text = Math.ceil(perc * 100) + "%".toString(); progressBar.loadBar_mc.width = perc * 240; trace(perc); } public function completeHandler(event:LoaderEvent):void { trace(event.target + " is complete!"); removeChild(progressBar); } public function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } } }
  3. hmm..very odd.. the only thing that I know is different is that I am using cs5.5. Would that make a difference?
  4. Yeah I saw the xml problem before, fixed it and also took it out until this loader gets fixed. Good eye though! Here are the files. Thanks again!
  5. Carl, I never posted files before, how do I go about doing that, do I just sent them to you directly? I checked and yes my swf is an as3 file. The site will work, but what it wont do is fire the onComplete function of the preloader, so the loader graphic never gets removed, and it seems to get stuck on 99% loaded. Thanks for your help!
  6. Here is the code that I am using....the problem I am having is the complete Event, is not being fired, but it's still loading in my swf file... package classes.main { import flash.display.*; import flash.events.*; import flash.display.MovieClip; import flash.text.TextField; import flash.events.Event; import com.greensock.easing.*; import com.greensock.*; import com.greensock.plugins.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.ContentDisplay; public class Preloader extends MovieClip { private var progressBar:MovieClip = new progBar_mc(); public var loader:LoaderMax; private var imagesArray:Array; public var medallionXml:XML; public function Preloader():void { loader = new LoaderMax({name:"myLoaderMax", onError: errorHandler, onFail:errorHandler, maxConnections:1, onProgress:progressHandler, onComplete:dataLoaded}); loader.append( new SWFLoader("medallion.swf", {name:"medallionSWF",onProgress:progressHandler,estimatedBytes:81920,container:this})); loader.append( new XMLLoader("xml/medallion.xml", {name:"medallionXML",estimatedBytes:81,920}) ); XML.ignoreWhitespace = true; loader.load(); addChild(progressBar); } public function progressHandler(event:LoaderEvent):void { var perc:Number = event.target.bytesLoaded / event.target.bytesTotal; progressBar.prog_txt.text = Math.ceil(perc * 100) + "%".toString(); progressBar.loadBar_mc.width = perc * 240; } public function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } public function imgCompleteHandler(event:LoaderEvent):void { var imageLoaded:ContentDisplay = event.target.content as ContentDisplay; } public function dataLoaded(event:LoaderEvent):void { trace("loaded"); //addChild(event.target.content as ContentDisplay); //trace(event.target + " is complete!"); TweenLite.to(progressBar,1,{alpha:0,onComplete:removeProgress}); } private function removeProgress():void { removeChild(progressBar); } } }
  7. Can anyone tell me what this means.. i have tried to google it with no luck as to what it means Error #2099: The loading object is not sufficiently loaded to provide this information. at flash.display::LoaderInfo/get width() at com.greensock.loading.display::ContentDisplay/_update() at com.greensock.loading.display::ContentDisplay/set rawContent() at com.greensock.loading.core::DisplayObjectLoader/_initHandler() at com.greensock.loading::SWFLoader/_init() at com.greensock.loading::SWFLoader/_rslAddedHandler() at flash.display::DisplayObjectContainer/addChild()
  8. I have a question / looking for the best method. I have a preloader class that is using loader max. It loads the swf and then adds it by using the "container:this" . Now I also have some xml that I want to use. Is it best method to load that in the preloader as well, and if so how do I pass that xml into the main class to use. Or is it best to load the xml from the main class, once the swf has been added? Thanks for your help!
  9. Carl, Thank allot for that link... it really cleared up some questions I had about laoderMax. Will you be doing more of them? I had another quick question, is it possible to put ImageLoder nodes loaded from an xml file into a multiDimensional Array? I assume it would be, but can I do it by calling the names of the imageLoaders? Say I have an array with 6 image loaders imageArray = loder.GetChilder(); and then I want to do something like imageArray[0] = ["image1","image2","image3"]; imageArray[1] = ["image4","image5","image6"]; then I want to add a certain image from that array... addChild(imageArray[0][1].content); Is doing something like this possible?
  10. I tried to look on this form for this answer, but didn't have any luck. I am able to get the xml loaded. I was able to add those imageLoader nodes into an array, but what I can't figure out is how to then display them. Here is the code I have: var queue:LoaderMax = LoaderMax.getLoader("dynamicLoaderImages"); //trace(queue.getChildren()); imagesArray = queue.getChildren(); queue.load(); trace(imagesArray[1]+" this is node 1 of array") trace(imagesArray.length); An addChild(imagesArray[1]); //doesnt work, so i thought I might have to use the contentDisplay property, but not sure how to in conjunction with my array. Thanks!
  11. Thank you so much for clearing that up for me! Big help. I have another question for you but this is more along the lines of OOP. I have my main class, and inside that class I create a new class called home:Home; home = new Home; I have a movieClip (contentContainer) that I add home into like such: contentContainer.addChild(home); I create another class; homeBtns:HomeButtons; homeBtns = new HomeButtons(sectionXml. contentContainer); I am trying to pass an xml file and the contentContainer file to the homeButton class. When I try to even trace this from the homeButton class homeWrapper = home that was passed in from the main class. trace(homeWrapper.home.x); What I am trying to do is access the dynamic text field inside the home class, but this throws an error: TypeError: Error #1010: A term is undefined and has no properties. I'm not sure I am going about this right, or even if you can pass a "class" into another "class" and access that classes timeline. Maybe I have to target the main timeline after it's beed added and access it that way? If this is confusing I understand...this is a new area for me and I know my vocabulary isn't quiet there yet.
  12. the problem I am running into, and maybe it due to my limited knowledge of OOP, is that the home is a class, and my target isn't established until the constructor is ran, but then it's to late to set a public var for that class.... if that make sense?
  13. When I add my eventListener to the blitMask, it seems to break the code..... can't seem to figure out why? public class Home extends MovieClip { public var t1:uint,t2:uint,y1:Number,y2:Number; public var timer:Timer = new Timer(250,2); public var bounds:Rectangle = new Rectangle(0,0,511,725); public var menuTemp:MovieClip = new MovieClip(); public var blitMask:BlitMask = new BlitMask(menuTemp, bounds.x, bounds.y, bounds.width, bounds.height, false); public function Home() { trace("2"); menuTemp = menuContent; blitMask.update(null, true) blitMask.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); //menuContent.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); } public function mouseDownHandler(event:MouseEvent):void { timer.reset(); timer.start(); TweenLite.killTweensOf(menuContent); y1 = y2 = menuContent.y; t1 = t2 = getTimer(); menuContent.startDrag(false, new Rectangle(bounds.x, -99999, 0, 99999999)); menuContent.addEventListener(Event.ENTER_FRAME, enterFrameHandler); menuContent.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); }
  14. Never mind, figured out a way by using a timer on the mouseEvent. Thanks!
  15. How could you add an hitarea for a mouse CLICK to that object that you are "throwing" I am able to add a hitarea, but if my mouse is using that area to drag it always counts that as a CLICK, if that makes sense? Thanks
  16. I seem to have been able to fix this by adjusting the area for the event listener. Thanks
  17. here is what I'm talking about http://www.gdovindesigns.com/v5/
  18. Hello, I have been working on a new site and seem to have ran into a problem. I am using liquid stage to handle all the placement of my elements on my site. I have a menu system on the left and a contact form on the right. It all seems to work when the page loads (still in testing just to make sure it's working the way I need it to). But I seem to run into problems when I start to resize the window. If the contact form is in it's animation and I resize the screen, I seem to be able to get it to "fall off the viewable screen" Does anyone have any idea what might be the problem for this? You can see what I mean here http://www.gdovindesigns.com/v5/ Thanks
  19. I have a site that I'm using liquid stage on, and when I go to re-size the window around I can get the content on the right side of the window to go missing. Has anyone had anything like this happen before?
  20. Will that trigger the browser scroll bars if either of those are met?
  21. I got liquid stage to working great, but when I use swffit to set the min height and width for the site, it seems to break the liquid stage aspect. Has anyone had any luck with getting these 2 to work together?
  22. This is something that I have been working on for some time, and I just can't seem to wrap my head around about how to get it working. I have a moveclip that is pinned to the Top_Right of my screen. This works just fine, the problem is how ever when I roll over that movieclip and attempt to change it's x(by 165 pixels) postion and then when you roll out, to change it back to where it came from. It uses the x cord of the flash stage size, so when you roll over it it it zooms towards the center of the screen. Here is the code I am working with: //set the LS and attach it var ls:LiquidStage = new LiquidStage(this.stage,1024,1300,1000,800); ls.attach(contactSection, ls.TOP_RIGHT); //this is from my class file for the movieclip that I am trying to move: this.addEventListener(MouseEvent.MOUSE_OVER,moveBgOut,false,0,true); public function moveBgOut(event:MouseEvent):void { //fade out envelope TweenLite.to(envelope,.5,{alpha:0,x:250}); //moves all the content TweenLite.to(this,1,{x:"-165",ease:Expo.easeOut}); TweenLite.to(this.cc,1,{alpha:1}); this.removeEventListener(MouseEvent.MOUSE_OVER,moveBgOut); ccBG.addEventListener(MouseEvent.MOUSE_OVER,moveBgIn,false,0,true); addContent(); TweenLite.to(copyRight,.5,{x:85}); } public function moveBgIn(event:MouseEvent):void { //moves content back TweenLite.to(this,1,{x:"165",ease:Expo.easeOut,onComplete:removeContent}); TweenLite.to(this.cc,.5,{alpha:0}); TweenLite.to(empty_3,.5,{alpha:0}); ccBG.removeEventListener(MouseEvent.MOUSE_OVER,moveBgIn); TweenLite.to(copyRight,.5,{x:0}); } I need to some how use the x cords of the actual screen of the browser and not just the stage of the flash....is the correct in the way of thinking? Thanks so much!
  23. My thinking for this problem is to capture the the current X position of that movie clip at it's starting point, call this StartX, and when the user rolls off of that object to then capture that X position call this backX and then use backX number and subtract that from startX. But I can't seem to get this to work.
  24. No you told me just what I was looking for. Thanks!!!! The only problem I run into with doing it this way, is that if user rolls off of that object before it's animation is complete, it sends it back the other way past it's original start postion, because it's using the x postion of that object during it's animation. If that makes sense? And I want the user to have the ability to roll off of the object before it's complete if they so choose to do so. Thanks.