Jump to content
Search Community

jguthrie

Members
  • Posts

    34
  • Joined

  • Last visited

Posts posted by jguthrie

  1. I didnt know if I should post this in loading or tweening....

     

    So I am loading in another swf with LoaderMax to play videos through youtube in my movie. I am also animating objects at the same time in the swf that is loading in the youtube swf. For some reason, this is causing a security error. (If I dont load the swf but animate, no error. If I dont animate but load the swf, no error. But both together. Error)

     

    Not sure how to fix this. Error Msg:

    SecurityError: Error #2121: Security sandbox violation: BitmapData.draw: http://www.mydomain.com.au/facebook/FacebookCommunityTab.swf cannot access http://s.ytimg.com/yt/swfbin/watch_as3-vflFkxRDW.swf. This may be worked around by calling Security.allowDomain.
    at flash.display::BitmapData/draw()
    at com.greensock.plugins::MotionBlurPlugin/set changeFactor()
    at com.greensock::TweenMax/renderTime()
    at com.greensock.core::SimpleTimeline/renderTime()
    at com.greensock::TweenLite$/updateAll()
    

     

    Code for loading and animating:

    
    private function setupVideoPlayer():void {
    		//Loading in the video player
    		var cntext:LoaderContext = new LoaderContext(true);
    		_loader = new SWFLoader("YouTubeSingle.swf", { onComplete:onLoadSWFComplete, onError:onLoadSWFError, onSecurityError:onLoadSecurityError, onScriptAccessDenied: onLoadScriptError ,context: cntext} );
    		addChild(_loader.content);
    		_loader.load();
    	}
    
    private function onLoadSWFComplete(event:LoaderEvent):void {
    		_youTubePlayer = _loader.rawContent;
    		_youTubePlayer.x = 10;
    		_youTubePlayer.y = 200;
    	}
    private function animateCommentsIn():void { //onComplete:onFinishTween
    		TweenMax.allTo([comment1, comment2, comment4, comment5, comment3], 2, { bezierThrough:[ { x:449, y:490 }, { x:"-90", y: "225" } ], scale:.9, delay:.3, alpha:1, motionBlur:true, ease:Cubic.easeInOut }, .4 , onCompleteAll);
    	}
    

     

    Its also worth noting that none of the errors I am listening for are getting tripped.

  2. Yes that is right along the lines of what I want to do, thanks! I knew it had to be some sort of event I was missing...

     

    Here is my code. I dont know if this is the best way to NOT add the XML to my container movieclip ... I need the if statement there so that it doesnt throw an error when it tries to do so...

     

    private var _loaderMax:XMLLoader;
    
    private function loadMyXML():void {
    		LoaderMax.activate([imageLoader]); //only necessary once - allows XMLLoader to recognize ImageLoader nodes inside the XML
    
    		_loaderMax = new XMLLoader("images.xml", {onComplete:completeHandler, onError:errorHandler,onChildComplete:childCompleteHandler});
    		//_loaderMax.append( new XMLLoader("images.xml", {name:"imagesXML"}) );
    		_loaderMax.load();
    
    	}
    
    	private function childCompleteHandler(event:LoaderEvent):void {
    		 trace(event.target + " completed!");
    		 if (event.target.name != 'imagesXML') {
    		 	_sImage_mc.addChild(event.target.content);
    		 }
    	}
    
    

    my xml:

    <?xml version="1.0" encoding="UTF-8"?>
    
    
    
    
    
    
    
    
    
    
    

  3. I am trying to load an XML file using LoaderMax, then loop through the XML, loading a variable number of images whose path/name are in the XML file. I have looked into the method described in point #3 here but it seems as if you need to know the 'name' of the image before you load it to access it on the onComplete method. Can this be done? Is there a name attribute in a LoaderEvent that I am not seeing?

     

    In the end, I want each image to be added to flash as they are loaded and not have to wait until all of them are loaded...

     

    Thanks!

  4. I need to have animations that stay in sync with a video that is playing. Can i set the duration of my TimelineMax animation to be the length of the video? (Then simply set delays in secs on each animation when i want it to occur?) I can achieve this effect by adding a few dummy tweens at the end of my animations but this seems kinda hackish.

×
×
  • Create New...