Jump to content
Search Community

a-ok

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by a-ok

  1. I'm a little confused - why can't you use it in the straightfoward way like:

     

    var swf:SWFLoader = new SWFLoader("someSwf.swf?cat=3", {name:"mainSWF", container:this, x:50, y:100, onInit:initHandler, estimatedBytes:9500})
    swf.load(); 

     

    ?

     

    Is there something breaking for you? Carl was just trying to help you get rid of the query string because it sounded like that's what you were asking for initially but I guess that's not what you're after.

     

    Sorry I've been extra stupid (and I forgot all about this thread). I was getting the error when testing the site through Flash and not through a browser so it was able to load someSwf.swf but produced an error when loading someSwf.swf?cat=3

    :oops:

  2. if you want to strip the query string (the ? and all the comes after), you can run your swf's url through a cleaner function prior to putting it into your swfLoader

     

    Thanks but I need the query string to be sent to the file that's being loaded. It looks like I'll have to make a function that parses the query string and creates an URLrequest out of it. :(

  3. Did you wait for the content to load first? rawContent is null until the content loads.

     

    If you're still having trouble, please post a very simple FLA that demonstrates the issue (no need to post your production file(s)) so that we cna publish it and see what's going on.

     

    Yup, that was it, I'm the king of stupid. What confused me is that I was able to change alpha, x and other properties yet not to play and stop the video.

     

    Anyway, thanks for your help.

  4. Thanks but when I replace

    var firstchild = itemArray[currentItem].getChildAt(0);
    firstchild.gotoAndStop(2);

    with

    var firstchild = itemArray[currentItem].getChildAt(0);
    firstchild.rawContent.gotoAndStop(2);

    I get:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

     

    trace(firstchild); //returns [object ContentDisplay]
    
    trace(firstchild.rawContent); //returns null
    
    firstchild.alpha = 0.5; //fades the loaded SWF correctly

  5. var firstchild = itemArray[currentItem].getChildAt(0);
    firstchild.gotoAndStop(2);

    reports the following error:

    ReferenceError: Error #1069: Property gotoAndStop not found on com.greensock.loading.display.ContentDisplay and there is no default value.

     

    itemArray[currentItem] was set as a container for a SWFloader but itemArray[currentItem].getChildAt(0) is not a MovieClip but something called ContentDisplay. I want to control whatever's at getChildAt(0) as a MovieClip, how do I do that? I tried casting it as MovieClip() but it doesn't work.

     

     

    Thanks

  6. if you continue to use layer masks in Flash you are no doubt going to run into more problems when combining actionscript with your masked elements. this is totally beyond a greensock issue and is something inherently wrong with Flash.

     

    use ActionScript to mask instead http://www.republicofcode.com/tutorials ... s3masking/

     

     

    That's a bit too much to ask as I've never had problems with masks until this motionBlur stuff and I don't have the time to change this (will it work on animated/scripted masks?).

     

    GreenSock should make it clear that this feature is broken in some cases (in my case in all cases) especially since they're charging $50 for the motionBlur plugin.

  7. Hey a-ok,

     

    I pasted your code into a Flash CS4 project and it worked with no errors.

     

    In the documentation http://www.greensock.com/as/docs/tween/ ... lugin.html there is a reference to the containerClass when using Flex and some other stuff that can happen if you are using masks or 3D rotation in the Flash IDE.

     

    Check it out. After reading if you still have trouble please post back with more info on your environment and I'm sure someone will help you.

     

    Carl

     

    Pretty much all my content is masked so this is useless to me. :(

  8. Why isn't this working?

     

    import com.greensock.*;
    import com.greensock.plugins.*;
    TweenPlugin.activate([MotionBlurPlugin]);
    
    TweenLite.from(sub31, 0.2, {x:sub31.x+50, motionBlur:true, alpha:0, delay: 0});
    TweenLite.from(sub32, 0.2, {x:sub32.x+50, motionBlur:true, alpha:0, delay: 0.1});

     

    I get the following error many times.

    Property containerClass not found on Boolean and there is no default value.

     

    What could be the problem?

  9. You can call unload() on a SWFLoader (or any loader) anytime.

     

    Yes, it's ok now, thanks. I read about methods unload() and dispose() but due to my poor grasp of AS3 basics I didn't know how / where to use it. So much about learning as I go...

  10. Another little thing:

     

    I have a menu with several items, each of which loads one swf into a movieclip called container. However, if a menu item is clicked while a swf is loading then both SWFs start loading at the same time (twice as slow). I'm sure this is useful in many cases but I'd like whatever was previously loading to be discarded. How do I do that?

     

    function loaderflow(e:Event):void {
    if (gvc.vars.loadthisnow!=loadswf) {
    	loadswf = gvc.vars.loadthisnow;
    	trace("Now loading  "+loadswf);
    
    	var i:int = this.container.numChildren;
    	while (--i > -1) {	this.container.removeChildAt(i);}
    	var loader:SWFLoader = new SWFLoader(loadswf, {container:this.container, onComplete:completeHandler});
    	loader.load();
    
    	function completeHandler(event:LoaderEvent):void {
    		TweenLite.to(container, 1, {alpha: 1});
    	}
    }
    }
    

     

     

    Thanks

  11. Did you watch the videos? Just curious.

     

    Yeah, I got to the half of the second video where he says "The display of loaded assets is simplified by optionally wrapping content in an class instance that extends a native display object." and then I turned it off because I don't know what that means. Besides I never learned anything by actually listening to someone, it would be nice to have a text tutorial.

     

     

    1) If you want to remove all the content inside a MovieClip when you load a new swf, you'd need to either dump the whole MovieClip and just recreate it or go through all of its children and removeChild() each one like this:

     

    That worked, thanks. I'm used to AS2 where it's loadMovie(url,target) and when you do it again it replaces the previously loaded movie. LoaderMax adds a child to the container and I didn't know how to remove it. removeChild(), it's so obvious now. :)

     

     

    2) When you define a "container" in your vars parameter of your SWFLoader, you're already telling it to load into that object. For example:

     

    Yeah but when I load something else into that same object it gets added in front of it instead of replacing it.

     

     

    Does that help?

     

    Yeah thanks, that's all I needed.

  12. Now I really don't understand what's going on. Your example doesn't work for me - nothing happens.

     

    I want to load a swf INTO a movie clip called container that is already on the timeline. In doing so I want to replace whatever other content that movie clip has. When I load something else into that movie clip, I want it to replace the previous content.

     

    var loader:SWFLoader = new SWFLoader(loadswf, {estimatedBytes:1024*1024, container:this.container, onComplete:completeHandler});
    loader.load();
    
    function completeHandler(event:LoaderEvent):void {
    	container = event.target.rawContent; // this is probably what's wrong but I don't know how to put a loaded clip into an existing clip on the timeline
    	TweenLite.to(container, 1, {alpha: 1});
    }
    

     

    This is so annoying, in AS2 I can do everything I want but in AS3 I can't even get my head around the simplest things. Some progress...

  13. I'm new to AS3 and LoaderMax and I don't know how to access the loaded swf.

     

    function loadthisnow(loadswf:String):void {
       var contentloader:LoaderMax = new LoaderMax({name:"contentLoader",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler});
       contentloader.append(new SWFLoader(loadswf,{name:loadswf,estimatedBytes:1024*1024,container:this.container}));
       contentloader.load();
    }
    

     

    And the loaded swf appears but how do I do stuff to it? I can do stuff to this.container but how do I access the loaded swf? I ask this because when I load other content it just appears in front of the previously loaded content so I want to be able to delete the previously loaded swf or move it or something. There is a blurb in the documentation about empty, dispose or something but it's too short and doesn't have examples.

     

     

     

    Thanks.

×
×
  • Create New...