kiogo

Members
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

0 Newbie

About kiogo

  • Rank
    Member
  1. Ok, I figured out what my problem was, basically I was attaching the image loader before it was added to the stage. I removed the onComplete handler, set liquidArea to _imagesContainer and made sure the slide was on the stage before attaching it to area. area = new LiquidArea(_imagesContainer, 0, 0, 980, 590); _curSlide = slide; _imagesContainer.addChild(_curSlide.image); area.attach(_curSlide.image, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE}); area.update(); Works perfect now. Thanks for all you help!
  2. I'd like to keep the images within the container. When I specify that container for liquidArea, I still get the parenting error. ls = new LiquidStage(this.stage, 980, 590, 980, 590); _imagesContainer = new Sprite(); this.addChildAt(_imagesContainer, 0); area = new LiquidArea(_imagesContainer, 0, 0, 980, 590); area.preview = true; private function _onCompleteHandler(event:LoaderEvent):void{ area.attach(event.target.content, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE}); area.update(); } _imagesContainer.addChild(_curSlide.image); //ensures the image is at the top of the stacking order inside the _imagesContainer area.update();
  3. Ok, thanks. Now I'm having an issue with the display object parent - "Error: The parent of the DisplayObject agencynetImage added to AutoFitArea instance7 doesn't share the same parent." So... if all of my imageloaders are being added to _imagesContainer with addChild(), do I need to change the liquidarea target? public function SlideshowExample() { super(); ls = new LiquidStage(this.stage, 980, 590, 980, 590); area = new LiquidArea(this, 0, 0, 980, 590); area.preview = true; Thanks so much for your help!
  4. I see what you mean, thanks for the explanation. Is it possible to attach each child (slide) to area from the ImageLoader? I tried this without any luck: new ImageLoader("assets/images/" + image.@name + ".jpg", {name:image.@name + "Image", centerRegistration:true, scaleMode:"proportionalOutside", bgColor:0x000000, estimatedBytes:820000, onFail:_imageFailHandler, onComplete:_onCompleteHandler}) private function _onCompleteHandler(event:LoaderEvent):void{ area.attach(event.target, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE}); }
  5. All slides would be a child of _imagesContainer, and that's what's been attached to the area. Do I need to re-attach _imagesContainer to area each time _imagesContainer.addChild(_curSlide.image); is called? I've posted a download to the code example here. http://www.kiogo.com/dev/slideshow-mod-nc.zip If you could take a look and see where I'm going wrong I would really appreciate it. Thanks for all your help on this.
  6. Thanks, on further experimenting, if I set the loaders like this, removing the width/height: new ImageLoader("assets/images/" + image.@name + ".jpg", {name:image.@name + "Image", x:0, y:0, centerRegistration:true, scaleMode:"proportionalOutside", bgColor:0x000000, estimatedBytes:820000, onFail:_imageFailHandler}) Then the first image behaves perfectly, but the following images will still show a gap above and below, or to the left and right depending on their orientation. Currently I'm calling area.update() after the slide has been added, but that seems to be updating just the container, and not the contents. _curSlide = slide; _imagesContainer.addChild(_curSlide.image); //ensures the image is at the top of the stacking order inside the _imagesContainer area.update(); TweenLite.to(_curSlide.image, 1, {autoAlpha:1}); //fade the image in and make sure visible is true. How do I get the slide within the _imagesContainer to update properly if the stage has been resized? Thanks for any help.
  7. kiogo

    Liquid Area 1118 error

    Sorry, that was the problem. Thanks!
  8. Hello, I am trying to modify your (excellent!) slideshow example so that the image scales to full screen, proportionalOutside. It seems to be working for vertical images, but horizontal images show red (area preview) at the top and bottom. Here's my code pertaining to the liquid area: public var ls:LiquidStage; public var area:LiquidArea; public function SlideshowExample() { super(); ls = new LiquidStage(this.stage, 980, 590, 980, 590); area = new LiquidArea(this, 0, 0, 980, 590); area.preview = true; this.addChildAt(_imagesContainer, 0); area.attach(_imagesContainer, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE}); area.update(); var xmlLoader:XMLLoader = new XMLLoader("assets/data.xml", {onComplete:_xmlCompleteHandler}); xmlLoader.load(); } private function _xmlCompleteHandler(event:LoaderEvent):void { _slides = []; var xml:XML = event.target.content; //the XMLLoader's "content" is the XML that was loaded. var imageList:XMLList = xml.image; //In the XML, we have nodes with all the info we need. //loop through each node and create a Slide object for each. for each (var image:XML in imageList) { _slides.push( new Slide(image.@name, image.@description, new ImageLoader("assets/images/" + image.@name + ".jpg", {name:image.@name + "Image", width:980, height:590, scaleMode:"proportionalOutside"}) ) ); } private function _requestSlide(slide:Slide):void { _curSlide = slide; _imagesContainer.addChild(_curSlide.image); //ensures the image is at the top of the stacking order inside the _imagesContainer area.update(); TweenLite.to(_curSlide.image, 1, {autoAlpha:1}); //fade the image in and make sure visible is true. _curSlide.setShowingStatus(true); //adds an outline to the image indicating that it's the currently showing Slide. TweenLite.delayedCall(5, _showNext); //create a delayedCall that will call _showNext in 5 seconds. } For some reason, horizontal images seem to behave like "proportionalInside", because they scale to the left and right edge initially and on re-size, but not beyond to fill all the way vertically. I can see that the liquid area is filling the screen, but either _imagesContainer, or the attached images, are not expanding all the way. Any advice is greatly appreciated. Thanks!
  9. kiogo

    Liquid Area 1118 error

    Hello, I am having problems with liquid area when specifying a scale mode, I get the following error: Scene 1, Layer 'actions', Frame 1, Line 4 1118: Implicit coercion of a value with static type Object to a possibly unrelated type String. Where line 4 is: area.attach(box_mc, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE}); If I remove the scale mode, I don't get an error, this below works fine: import com.greensock.layout.*; var ls:LiquidStage = new LiquidStage(this.stage, 550, 400, 550, 400); var area:LiquidArea = new LiquidArea(this, 0, 0, 550, 400); area.attach(box_mc); This is basically straight from the demo at http://www.greensock.com/as/LiquidStage/ What am I missing? Thanks
  10. Hello, Is it possible to update a liquid area on the fly? Basically I have 3 positions that I need my mc to adapt to. For example: Starts at: area.attach(mc, {scaleMode:ScaleMode.STRETCH}); Then via an event, I want the mc to tween to: area.attach(mc, {scaleMode:ScaleMode.HEIGHT_ONLY}); And another event would pin the same mc to the left of the screen: area.attach(mc, {scaleMode:ScaleMode.HEIGHT_ONLY, hAlign:AlignMode.LEFT}); Is it possible to update the liquid area params this way? And tween between the changes? Thanks for any help!