Jump to content
Search Community

Tito

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Tito

  1. There's been a number of questions on how to clone a imageLoader.getContent, so I thought I'd chuck in a slightly more complete solution so people don't have to waste time doing it. package com.optricks.Tools { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.geom.Matrix; import flash.display.DisplayObject; import flash.geom.Rectangle; /** * ... * @author Tito */ public class ImageTools { private static const _myType :String = "ImageTools"; public static function cloneImage(image:DisplayObject) :DisplayObject { var bmd :BitmapData; var bitmap :Bitmap; var spr :Sprite; var bounds :Rectangle = image.getBounds(image); bmd = new BitmapData(int(bounds.width + 0.5), int(bounds.height + 0.5), true, 0x0); bmd.draw(image, new Matrix(1, 0, 0, 1, -bounds.x, -bounds.y)); bitmap = new Bitmap(bmd, "auto", true); bitmap.x = bounds.x; bitmap.y = bounds.y; spr = new Sprite(); spr.addChild(bitmap); return spr; } }} Hope this saves you 20 minutes
  2. when loading images via an xml file with LoaderMax, I use the following format regularly: <?xml version="1.0" encoding="iso-8859-1" ?> All values except the z value are set correctly. Z is always set to zero. Any chance of this being fixed?
  3. Good, that's what I thought. Just wanted to check cos my simple example worked, but I didn't know if it was fully loading things twice. BTW.. can't see two loaders with the same name.. which one did you mean? There's filename and loadername but there should not be any repeats.
  4. I'm loading a large number of images and content through XMLLoader nested xml files. I would like to set a preload going right at the start of my program startup, but none of the objects will be created at this point. It seems that if you load a file twice, it isn't actually re-loaded into LoaderMax, but the cached copies are taken. However if you you reload an XML file that is a couple of layers down and prioritize it before the original one has loaded, will this work? Eg "All.xml" <?xml version="1.0" encoding="iso-8859-1" ?> ... "UIImages.xml" <?xml version="1.0" encoding="iso-8859-1" ?> ... So in this case, two levels down is the file HeaderImages.xml. If, before it is loaded, I try to load it again, putting in a completion handler, will this completion handler report correctly that it has been loaded? Alternatively, will the completion handler work if it has been loaded?
  5. if you do it with the XML loader, you can 0pass custom content in through the xml as the xmlloader just filters through the image loaders. I don't have an example for you but look at the XMLLoader examples, and the flash xml structure documentation. They can be used together
  6. if you do this: timeline.tweenFromTo(from.toString(), to.toString(), { ease:Strong.easeInOut, timeScale:timeFactor } ); then the timeScale is not applied to the current tween.. Instead it is applied to the next one. this does work though: timeline.timeScale = timeFactor; timeline.tweenFromTo(from.toString(), to.toString(), { ease:Strong.easeInOut } ); note: All tweens on the timeline are TweenMax.to's
×
×
  • Create New...