Jump to content
Search Community

friendlygiraffe

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by friendlygiraffe

  1. i'm trying to tween a group using the following code TweenMax.allTo(ar, 2.5, {rotationX:0, rotationY:10, rotationZ:0, ease:Sine.easeInOut,overwrite:false},0); I would like the rotationY property to have a different value for each mc. Is this possible ?
  2. Hi - Is TweenProxy only available in the club greensock package? I get the following error import com.greensock.TweenProxy; import com.greensock.easing.Elastic; import flash.geom.Point; var myProxy:TweenProxy = TweenProxy.create(my_mc); myProxy.registration = new Point(100, 100); TweenLite.to(myProxy, 3, {skewX:30, scale:0.5, ease:Elastic.easeOut}); Thanks
  3. For some reason I cannot get the MotionBlurplugin working import com.greensock.*; import com.greensock.plugins.*; TweenPlugin.activate([MotionBlurPlugin]); TweenMax.to(mc, 2, {x:400, y:300, motionBlur:true}); I get this error I have attached my fla
  4. I am able to load in a VideoLoader Object, but I'm not able to display it on the stage AS: var _loader1:VideoLoader; var _loader2:VideoLoader; xmlPath = "xml/en/data.xml"; queue = new LoaderMax({requireWithRoot:this.root,name:"tractorQueue",integrateProgress:true,onComplete:completeHandler}); queue.append(new XMLLoader(xmlPath,{name:"xmlData", estimatedBytes:843})); queue.load(); function completeHandler(e:Event):void { _loader1 = LoaderMax.getLoader("sec4vid"); trace('_loader1: '+_loader1); _loader2 = new VideoLoader("videos/02_fuel.mp4",{container:this}); trace('_loader2: '+_loader2); _loader2.load(); } This outputs: However, _loader1.load(); does nothing. What is the problem here? Do I need to specify a container ? XML: <?xml version="1.0" encoding="UTF-8"?> Cab Suspension
  5. This seems to work for loaded swf's, but not for VideoLoader's var swf:ContentDisplay = LoaderMax.getContent("tractorswf"); setChildIndex(swf, 0);
  6. thanks, but is it possible to move the video before it starts playing. I want to have text overlaying the video as it's playing Thanks
  7. I have a VideoLoader called 'video', when it completes I'd like to change it's depth public function completeLoadHandler(event:LoaderEvent):void { video.playVideo(); setChildIndex( event.target.content, 0 ); } ...but it outputs the error: What am I doing wrong here ?
  8. ah no, I didn't realise I had to do that. It works now using: I used LoaderMax.activate([VideoLoader]); How come I don't have to activate the other loaders eg: SWFLoader ?
  9. Hi there, Yes that's exactly why I wanted to avoid it. I couldn't risk the XML not being loaded properly. But now that you've cleared it up, I will use it in future. Many thanks
  10. I am loading this XML, but the VideoLoader node doesn't seem to be loading : <?xml version="1.0" encoding="UTF-8"?> New Cooling package Find out more wwww trace('coolingSWF ' +LoaderMax.getContent("coolingSWF")); trace('coolingSWF2 ' +LoaderMax.getContent("coolingSWF2")); trace('coolingVID ' +LoaderMax.getContent("coolingVID")); Which displays:
  11. Ok thanks - Does this mean there is no reliable alternative to maxConnections, other than splitting the load into 2 parts? that's what I have done which works well for now
  12. Thanks for your reply Carl The problem is definitely the the tractor.swf loading first. I had a look at maxConnections, although this could be a solution it seems it might not work 100% all the time: Couple of questions: • Both my loaders are called 'mainQueue', should they be named differently ? • Is the second loader's onComplete call redundant? Should I remove it from the child and just use parent loader? • How can multiple loaders can share the same onComplete handler? I'd like to find a reliable way of getting the queue to load the XML first, rather than having to split the queue into two loaders Thanks!
  13. I have a loader queue in a parent swf. It loads a child swf and an XML file with several child XML files linked into it: XML: <?xml version="1.0" encoding="UTF-8"?> PARENT.swf var queue:LoaderMax = new LoaderMax({name:"mainQueue", integrateProgress:true, onComplete:completeHandler}); queue.append( new XMLLoader("data.xml", {name:"xmlData", estimatedBytes:4315}) ); queue.append( new SWFLoader("tractor360.swf", {name:"tractorswf", alpha:0, estimatedBytes:43195, container:this, autoPlay:false}) ); queue.load(); function completeHandler(event:LoaderEvent):void { var swf:ContentDisplay = LoaderMax.getContent("tractorswf"); TweenLite.to(swf, 0.5, {alpha:1}); } CHILD.swf (tractor360.swf) queue = new LoaderMax({requireWithRoot:this.root, name:"mainQueue", integrateProgress:true, onComplete:completeHandler}); queue.append( new SWFLoader("Assets.swf", {name:"Assets", estimatedBytes:4351877, container:this, autoPlay:false}) ); queue.load(); public function completeHandler(event:LoaderEvent):void { trace(this.name+" \n\nChild swf = "+LoaderMax.getContent("sections")+"\n\n\n\n"); } The problem is, the onComplete handler in the child swf varies in how much XML has been loaded. It seems like it's firing without the XML being properly loaded Is this because I have two onComplete:completeHandler's ? Should I just use one, in the Parent swf ? Thanks!
  14. Ok I figured it out, it seems that you can simply reference this by importing LoaderMax import com.greensock.loading.LoaderMax; and then referencing it LoaderMax.getContent("xmlData")
  15. Basically, I want to load XML into the main Container, load several swf's into it, and allow the child swf's to receive data from the XML loaded into the Container. Is this possible, or would I have to get each child swf to load it's own XML ?
  16. I have a container swf and within that I'm loading a queue of swf's using LoaderMax I'm also appending XML to the load too. I wondered how a child swf would reference data XML loaded in it's parent? For example LoaderMax.getContent("sections")[0]; works in the container, but not in the child Thanks
  17. I have a swf file stored in an XML doc which I load at start up. The load is set to false, but how do I call the swf later on if I want to load it? XML: AS: var queue:LoaderMax; public function loadLanguage() { xmlPath = "xml/"+Language+"/data.xml" queue = new LoaderMax({name:"mainQueue", integrateProgress:true, onComplete:completeHandler, onError:errorHandler}); queue.append( new XMLLoader(xmlPath, {name:"xmlDoc"}) ); queue.load(); } private function completeHandler(event:LoaderEvent):void { trace(LoaderMax.getContent("coolingSWF")); }
  18. Ok, I'm nearly there. I just need to figure out how to add the Library asset 'tractor_frames' to the stage, addChild() doesn't seem to work. Do I need to add it to the DisplayObject ? package { import flash.display.*; import flash.events.*; import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; public class Tractor extends MovieClip { var queue:LoaderMax = new LoaderMax({name:"mainQueue",onComplete:completeHandler,onError:errorHandler}); public function Tractor() { queue.append( new SWFLoader("Assets.swf", {name:"Assets", estimatedBytes:4351877, container:this, autoPlay:true}) ); queue.load(); } public function completeHandler(event:LoaderEvent):void { var childLoader:SWFLoader = queue.getLoader("Assets"); var librarySymbol:Class = childLoader.getClass("tractor_frames"); trace(librarySymbol); } public function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } } }
  19. How would I get the library MovieClip 'mc' from this code?: var queue:LoaderMax = new LoaderMax({name:"mainQueue", onComplete:completeHandler}); queue.append( new SWFLoader("Assets.swf", {name:"Assets", estimatedBytes:4351877, container:this, autoPlay:false})); public function completeHandler(event:LoaderEvent):void { var testClass:Class = queue.getClass("mc"); }
  20. that's great thanks Carl Another problem I'm having is using a container which loads a swf that loads another swf... Ideally I'd like to preload a few of the external swf's within the container (without adding them to the stage) What would be the best method of doing this?
  21. Hello - I'm using LoaderMax a lot now, but wondered if there was a way of using it to control shared assets at runtime?: Here is an example of external asset loading: http://old-wp.slekx.com/2010/01/flash-c ... -tutorial/ package { import flash.display.*; import flash.events.*; import flash.net.*; import flash.system.ApplicationDomain; import flash.system.LoaderContext; import flash.utils.getDefinitionByName; public class Project extends Sprite{ public function Project(){ // this context is necessary to find the shared assets var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain); // load in the asset swf var loader:Loader = new Loader(); var req:URLRequest = new URLRequest("Assets.swf"); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoaded); try{ loader.load(req, context); }catch(e:Error){ trace("Asset load error: " + e); } } private function onAssetsLoaded(_event:Event):void{ // get a reference to the loaded library var loader:Loader = LoaderInfo(_event.target).loader; var library:* = loader.content; var offsetX:Number = 0; // loop through each asset defined in the library // using the its 'availableGraphics' property. for each(var asset:String in library.availableGraphics){ // get the MovieClip class of the asset var assetClass:Class = getDefinitionByName(asset) as Class; // create an instance of the shared asset var sharedAsset:DisplayObject = new assetClass(); // position the asset sharedAsset.x = offsetX + 10; sharedAsset.y = 10; // add asset to the stage addChild(sharedAsset); // update position offsetX += sharedAsset.width + 10; } } } } Thanks
×
×
  • Create New...