Jump to content
Search Community

attaboy

Members
  • Posts

    39
  • Joined

  • Last visited

attaboy's Achievements

0

Reputation

  1. AhHa not all v11 are the same. The one I just downloaded has pointIsLocal now I just have to get the thing to scale up.
  2. It didn't scale up but I haven't tried to fix that yet and I can't get pointIsLocal to work I downloaded the latest version but I already have it v11 I looked in the transformAroundPoint class but didn't see a pointIsLocal method. Isn't v11 the latest version?
  3. I found out why I didn't see anything. It wasn't scaling so I set the scale to 1 when I instantiated. It isn't working as I expected but I might be able to figure it out on my own.
  4. I replaced the first line of code below with what I thought would work but nothing happens I press the button and nothing not even a error message. //TweenLite.to(bio, 3, {transformAroundCenter:{x:450, y:400, scaleX:1, scaleY:1, delay:1}, rotation:1440, ease:Back.easeOut, easeParams:[.7]}); TweenLite.to(bio, 3, {transformAroundPoint:{point:new Point(383,307), scaleX:1, scaleY:1, rotation:1440, pointIsLocal:true}, ease:Back.easeOut, easeParams:[.7]});
  5. I have a MC that can be viewed here http://www.jimslounge.com/erikMay27/testBio4.swf It rotates around center as I wanted it to do. When I added a scrolling text field I get this http://www.jimslounge.com/erikMay27/testBio5.swf the center of the MC changes as the 800 px high text field scrolls. I was wondering if there was anyway I could transformAroundCenter using the center of the MC as it was before adding the TextField. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import com.droolpigs.*; TweenPlugin.activate([TransformAroundPointPlugin, TransformAroundCenterPlugin, ShortRotationPlugin]); var textAS:TextAutoScroll = new TextAutoScroll("bio.txt", 30, 420, 700, 800); var bio:Bio2 = new Bio2(); bio.scaleX =.001; bio.scaleY =.001; bio.x=450; bio.y=400; bio.addChild(textAS); // dragdrop stuff bio.addEventListener(MouseEvent.MOUSE_DOWN, drag); bio.addEventListener(MouseEvent.MOUSE_UP, drop); load_btn.addEventListener(MouseEvent.CLICK, loadAbout); unload_btn.addEventListener(MouseEvent.CLICK, unloadAbout); function drag(e:MouseEvent):void { e.currentTarget.startDrag(); } function drop(e:MouseEvent):void { e.currentTarget.stopDrag(); } function loadAbout(e:MouseEvent):void { addChild(bio); TweenLite.to(bio, 3, {transformAroundCenter:{x:450, y:400, scaleX:1, scaleY:1, delay:1}, rotation:1440, ease:Back.easeOut, easeParams:[.7]}); } function unloadAbout(e:MouseEvent):void { if(bio){ TweenLite.to(bio, 2.5, {transformAroundCenter:{x:450, y:400, scaleX:.001, scaleY:.001}, rotation:-1440, onComplete:removeit}); } } function removeit():void { removeChild(bio); }
  6. Sorry I have a bad habit of skimming through things and assuming I know what was written. I put the new version online and it's working great. I owe you at least a keg of beer.
  7. I have a slide show which greensock helped me with he pretty much rewrote it it's very cool the way he did it . It slices and splices in arrays (please excuse my ignorant explanation I haven't gotten around to examining how it works in detail. My only issue with it is I don't think it scales well. I feed in 182 images with a combined total of 10.4 meg when the swf loads it uses 124 meg then it adds about 1.25 meg memory as each image is displayed until it reaches 293 meg at which point gc kicks in and keeps it there. import com.greensock.*; import com.greensock.easing.*; import com.greensock.loading.*; import flash.display.*; import flash.geom.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.ContentDisplay; var duration:Number = .5; var timeline:TimelineMax; var bars:Bars = new Bars(); bars.cacheAsBitmap = true; holderBG.addChild(bars); createTimeline(); function createTimeline():void { timeline = new TimelineMax({repeat:1, repeatDelay:5, yoyo:true, onComplete:showRandom, paused:true}); for (var count:int = 1; count <= 10; count++) { var mc:MovieClip = bars["bar" + count]; timeline.insert(TweenMax.from(mc, duration, {x:"64", alpha:0, ease:Cubic.easeOut}), (count - 1) * 0.1); } } var xmlLoader:XMLLoader = new XMLLoader("bioPics-data.xml", {onComplete:onXMLLoadComplete, autoDispose:true});; xmlLoader.load(); var images:Array; var displayQueue:Array; //same as "images" array initially, but each time we show a random image, we remove it from this array so that we can make sure the same image never shows twice in a row. We repopulate the array by slicing the images array once displayQueue is empty. var curSlide:ContentDisplay; function onXMLLoadComplete(e:Event):void { var queue:LoaderMax = new LoaderMax({maxConnections:1}); var nativeHolderSize:Rectangle = holderBG.getBounds(holderBG); for each (var image:XML in xmlLoader.content.image) { queue.append( new ImageLoader(image.@src, {centerRegistration:true, width:nativeHolderSize.width, height:nativeHolderSize.height, scaleMode:"proportionalInside"}) ); } images = queue.content; //a LoaderMax's "content" is an array of all of its child loaders' content. In this case, a bunch of ContentDisplay objects. displayQueue = images.slice(); //choose a random image to load first... var randomIndex:int = int(Math.random() * displayQueue.length); displayQueue[randomIndex].loader.prioritize(false); //ensures that it is first in the loading queue displayQueue[randomIndex].loader.addEventListener(LoaderEvent.COMPLETE, startSlideshow, false, 0, true); //we just want to wait for the first one to load before beginning. The rest can load in the background. displayQueue.splice(randomIndex, 1); queue.load(); } function startSlideshow(event:LoaderEvent):void { displaySlide(event.target.content); } function showRandom():void { if (displayQueue.length == 0) { displayQueue = images.slice(); } var randomIndex:int = int(Math.random() * displayQueue.length); displaySlide( displayQueue[randomIndex] ); displayQueue.splice(randomIndex, 1); } function displaySlide(slide:ContentDisplay):void { if (curSlide != null) { holderBG.removeChild(curSlide); } curSlide = slide; holderBG.addChild(slide); slide.cacheAsBitmap = true; slide.mask = bars; bars.width = slide.rawContent.width; bars.height = slide.rawContent.height; timeline.restart(); } any ideas? I was hoping to use this on a larger slide show I support it presents about 1000 images that average about 150k.
  8. oops my fault I was pointing to a old greensock folder form before I became shockingly green. greensock is the best!
  9. When I try to activate TransformAroundPointPlugin and TransformAroundCenterPlugin I get a 1120 Access of undefined property msg
  10. WOW! This goes way beyond what I was hoping for. You've showed me a much better way to write slide shows I'll study this code thoroughly and go through some of the gs tutorials as well. Thanks so much.
  11. Closer still we've got everything working except the transition tween...see attachment
  12. Thanks for the help I think we're getting close. I removed some extraneous code and tried to implement your changes. Here's what I have now: //// this is timeline code within a MovieClip//// import com.greensock.*; import com.greensock.easing.*; import com.greensock.loading.*; import flash.display.*; import flash.utils.*; import flash.events.*; import flash.net.*; import flash.text.*; import flash.geom.*; var bars:Bars = new Bars(); var n:int = 0; var intCurrentSlide:int; var req:URLRequest; var holder:Sprite = new Sprite(); var loader:ImageLoader; var rand:int; var nxtNum:int; var picNum:String; var slideCount:int; var xmlLoader:URLLoader; // slideshow xml loader var xmlSlideshow:XML; // slideshow xml var strXMLPath:String = "bioPics-data.xml"; var slideName:String; var duration:Number=.5; var prevSlide:String; var timeline:TimelineMax; createTimeline(); xmlLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete); xmlLoader.load(new URLRequest(strXMLPath)); function onXMLLoadComplete(e:Event):void { xmlLoader.removeEventListener(Event.COMPLETE, onXMLLoadComplete); xmlSlideshow = new XML(e.target.data); // create new xml with the received data slideCount = xmlSlideshow..image.length(); // get total slide count loadSlide(); } function createTimeline():void{ timeline =new TimelineMax({repeat:1,repeatDelay:5,yoyo:true,onComplete:loadSlide, paused:true}); for (var count:int = 1; count <=10; count++) { var mc:MovieClip=bars["bar"+count]; timeline.append(TweenMax.from(mc, duration, {x:"64", alpha:0, ease:Cubic.easeOut}), -.4); } } function loadSlide():void { rand = Math.ceil(Math.random()* slideCount - 1); [b] loader = new ImageLoader(slideName, {onInit:displaySlide, centerRegistration:true, container:holder}); // the assignment of loader seems to be where I'm getting hung up this is the line 54 in error msg.[/b] loader.load(); } function displaySlide(e:Event):void { trace("in displaySlide"); var bounds:Rectangle = holder.getBounds(holder.parent); bars.x = bounds.x; //bars is a MC in the library bars.y = bounds.y; bars.cacheAsBitmap = true; holder.cacheAsBitmap = true; holder.mask = bars; bars.width = holder.width; bars.height = holder.height; holderBG.addChild(holder); //holderBG is a MC that's placed on stage at author time holderBG.addChild(bars); timeline.restart(); } When I run it I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock.loading.core::LoaderItem/_setRequestURL()[C] at com.greensock.loading.core::LoaderItem()[C] at com.greensock.loading.core::DisplayObjectLoader()[C] at com.greensock.loading::ImageLoader()[C] at Bio2/loadSlide()[bio2] at Bio2/onXMLLoadComplete()[bio2] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete()
×
×
  • Create New...