Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Jakob Sternberg

Members
  • Content Count

    56
  • Joined

  • Last visited

Posts posted by Jakob Sternberg

  1. Hi i'm creating a banner and using gsap to do some particle animation,

    I need to keep the filesize down so i'm using TweenLite instead of TweenMax 

     

    One thing that doesent seem to work with TweenLite is pauseAll?

     

    Is that correct, or do i need to add a plugin or something?

     

    Or, is there alternative way to mimick the TweenMax.pauseAll() with TweenLite

     

    Thanks

  2. Another solution could be to optionally make Animation.as create the _gsAnimation mc in the same SWF as the class was included, MovieB.swf ( An "option", same way you set OverwriteManager)

     

    That would probably mean a couple of bad things, -  if that SWF gets unloaded, GSAP would stop working. - You could end up creating multiple mc's on multiple timelines. etc etc.

     

    Again, these facts would just be "known" limitations when using the option.

     

    It would take a few more lines of code in core, but you would get around having to do any "prepping" in MovieA.swf when using this method.

  3. I know my solution as a whole may not be very elegant, but the core change alone should be fine and really minimal as can be. Functionally-wise i don't see the code-change would break anything.

     

    What you achieve by making the change is little, i agree... But, on the other hand, it's basically costless.

     
    I hope you will concider it. =)

  4. Ok, a little more complete version:

    _________________________

     

    With only two lines changed in Animation.as..

    var gsMcName:String = "_gsAnimation" + String(version).split(".").join("_");
    ticker = mc[gsMcName] || mc.createEmptyMovieClip(gsMcName, l);

    ...I can avoid the warnings by adding this snippet in root SWF  (Or any SWF or Timeline, as long as there IS one in the actual root, if not?..nothing!, i just get the warnings.)

    function gsPrepSubload(){
        if( _url === _root._url){
            //Only if we are somewhere in _root SWF, or it doesn't matter
            var gsMcName:String = "_gsAnimation" + String(com.greensock.core.Animation.version).split(".").join("_")
            var l:Number = 999;
            while (_root.getInstanceAtDepth(l)) l++;
            var gsMc:MovieClip = _root[gsMcName] || _root.createEmptyMovieClip(gsMcName,l);        
            if(!gsMc.onEnterFrame) gsMc.onEnterFrame = gsMc.addEventListener = gsMc.removeEventListener = null;
            };
        };
    
    // Anywhere in root SWF
    gsPrepSubload();
    ;
  5. I somewhat agree, still we deal with medias whos systems require AS2 banners.

     

    But I'm also sure you are aware that greensock framwork is widely used , also in banner production workflows. 

    In "Rich-media" you will in most cases have a external SWF loading another, also known as "polite load". You cannot stuff TweenMax into the polite part as its too heavy.. the whole idea of the polite load is that is has to be light. (often < 50kb), so the scenaraio of having TweenLite initializing from subloaded SWF is not that uncommon i think.

     

    Again, it's totally harmless, and i'll agree that it's a"flash thing" in the sense that, if you check if TweenLite could actually create those methods, that you get warnings about, then you see it could!, also why everything works, you just get the darn warnings (so lame why you cant turn them off)

     

     

    Solutions for picky users:

     

    Well for the "prep a movieclip"-technique, a very simple fix would be on line 236, (if im not too wrong)

    var gsMcName:String = "_gsAnimation" + String(version).split(".").join("_");
    ticker = mc[gsMcName] || mc.createEmptyMovieClip(gsMcName, l);

    Then the user could do in _root SWF:

    _root.createEmptyMovieClip("_gsAnimation" + String(com.greensock.core.Animation.version).split(".").join("_"),_root.getNextHighestDepth());

    Requires action by user, but codechange is minimal, and fully backwardscompatible

     

    It could be a "prepper" class, that could be available? (entirely seperate from core, only creating the movieclip)

    import com.greensock.*
    gsPrepSubload();

    ---

     

    I'm still thinking,... if you could somehow trick the ticker mc to set the handlers on itself - but i guess that would be inventing a way to circumvent sandbox entirely, so i don't think it's possible =P

     

    Edit: Corrected the "if movieclip exists" script part..

  6. Ok it is these 3 lines, starting on line 237 in Animation.as, that causes the warnings:  you can put traces between them, and see for yourself.       

    ticker.onEnterFrame = _tick;
    ticker.addEventListener = _addTickListener;
    ticker.removeEventListener = _removeTickListener;
    

    So.. clearly it IS TweenLite/Max that causes the warnings. ( just to state it again xD )

     

    The external SWF can use _roots.createEmptyMovieClip method, but the movieclip it returns has not any methods defined yet, so as the external SWF tries to define the three non-existing methods on the movieclip, we get the warnings.

     

    i guess, defining it as a "flash thing" depends on how fixable it is =)

    So, i made small hack illustrating that it is possible to avoid the warnings.

    I have to create my own "ticker" in root, to be sure that i have "prepped" it for TweenMax

     

    From anywhere in the "root" swf: (i know it could be shorter)

    _root.createEmptyMovieClip("_gsAnimationCustom",_root.getNextHighestDepth())
    _root["_gsAnimationCustom"].onEnterFrame = null
    _root["_gsAnimationCustom"].addEventListener = null
    _root["_gsAnimationCustom"].removeEventListener = null
    

    I would have to modify Animation.as before line 237:

    if(typeof(mc["_gsAnimationCustom"]) === "movieclip"){
    	ticker = mc["_gsAnimationCustom"]
    }else {
    	ticker = mc.createEmptyMovieClip("_gsAnimation" + String(version).split(".").join("_"), l);
    	}
    

    Thats it, the warnings are gone!, and actually it only took two lines of code to make it possible to avoid the warnings. Please concider a solution (i see a few)

     

    ----

    I've made a file-example illustrating the whole thing,greensock classes included:

    http://edweb.dk/Temp/MovieA_MovieC_Fix.zip

  7. I think understand the security sandbox =)

     

    Ok, but to my understanding/experience its possible to avoid these warnings by prepping empty objects in the local SWF.

     

    Hmm, question, IS TweenMax setting variables and/or creating objects in parents, or root even?

     

    ( i had a quick look at the files but could not locate it )

     

    So i guess what i'm after is, could i create some empty objects/variables, with the right names, in the rootSWF and avoid the warnings?

  8. Hi

     

    MovieA.swf (contains no greensock classes at all)

    MovieB.swf (uses TweenMax)

     

    When i load MovieB.swf (online) from MovieA.swf (local)  i get some warnings in the FlashEditor output. ( 3 x "MovieB.swf tried to access incompatible context "MovieA.swf")

     

    Using System.security.allowDomain("*") does not solve or affect the problem at all. 

    Everything works as expected, i just wish to get rid of the warnings.

    I'm trying to streamline a small banner production framework for others/colleagues to use, and i'd rather have a "warning-free" setup =)

  9. Yiikes!!!... sadly, i was wrong, when i upload to the internet it goes wrong..,damn, I thought i tested it online (the whole purpose of my recoding :/)

    I'm having deadline tomorrow on a crossplatform app web/desktop/IOS (all in one code, yeah ;D ) - and i NEED animated backgrounds made from video.
    ..So since the FLV plays and loops fine locally (IOS/Air), and only giving problems when used in web app (standard flash), i'm going to use FFMPEG to convert the FLV's i already made, into SWF's (wooot)

     

    That might sound like a lot of extra work, but infact it's done superfast, and lossless! as FFMPEG can simply wrap the existing FLV into a SWF, no re-encoding!

     

    So only a  little extra work there, and then , ok, i need to make the code able to handle both types of background animation.. but that's pretty easy, and done once

     

    I made a bat file that i can drag drop a FLV file onto and it will convert it to SWF, it looks like this "%~dp0ffmpeg" -i "%~1" -vcodec copy -f avm2 "%~dpn1.swf"

    (Bat in same folder as ffmpeg.exe)

     

    So for now, i'm back to using FLV's that has the exact length of the loop (for use as local content), AND then convert those FLV's to SWF's for web use.

     

    This is quite a workaround.. i and i must admit i'm a bit disapointed in flash when comes to videolooping, which i thought flash would be king at.

     

    Edit: ffmpeg creates a video object on stage with the instance name "video", so you can use rawContent.video.smoothing = true , after the SWF has loaded.

     

    --

     

    Some info and more workarounds (from the guy Tony)

    http://stackoverflow.com/questions/10193937/how-to-loop-flv-seamlessly

  10. Ok, it's definitely possible to get a perfect loop with flv's.  i',m actually unsure of that now :D

     

    What WONT work is, if your flv is exactly the length of the loop.  blablablala

    I guess the best thing is to do the looping with cuepoints. Not sure if the looping cuepoint has to be the type of "Navigation" , but i somehow imagine that the encoder adds a keyframe exactly at that frame (i might be totally wrong about that)

     

    f4v's works fine with this method..
    Note: if youre developing AIR for IOS, then f4v is a "no-go" (legit info :P), it wont play the file, so stick with flv's (only tried flv and f4v)

  11. A little update: I tried using f4v instead, same thing =/

     

    Update2: So far i'm getting best results by looping between two cuepoints (having some "spare" video before the looping point, aprox 1 sec). I think the fact that the video file has to go all the way back to 0, has some negative effects in regards to looping.  Edit: I dont' know if it makes any diiference, but i set the looping cue to have the type "Navigation", and the replay cuepoint is set to "Event". 

×