Jump to content
Search Community

Jakob Sternberg

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by Jakob Sternberg

  1. Sorry in late on this one. I need to do something like this. Now this thread is four years old, are there any new features or things i should look out for, or would it be the same approach as @Dipscom's codepen example?
  2. Ok, It didn't work, now the animation just moves really slow, aprox 1fps. But if i use 0.0000001 it works (good enough anyways)
  3. 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
  4. Ehmm omg.. i must be tired.i DO get the desired effect by using transformOrigin.. sorry for wasting your time :/
  5. My last reply didnt make much sense, i was in a hurry and forgot a few words. Sorry! i've edited it Ok, so rotation makes a element rotate around it's own center. But can i change it so it rotates around, let's say the bottom left corner? Thanks alot
  6. The x/y offset. The goal was to some how change the rotation point/axis of the elements. Thanks Edited...
  7. Hi I want to create a bezier motion, and each element should rotate around it self, sofar so good. Now, can i control each element's offset? I tried to use transformOrigin, but it does not seem to work. What am i missing? =)
  8. 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.
  9. 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. =)
  10. 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(); ;
  11. 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..
  12. 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
  13. 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?
  14. Hi Hmm, might be a "Flash thing" ..it usually is heh Ok, if you dont' mind having a look, you see the warnings aswell? http://edweb.dk/Temp/MovieA_MovieB.zip If so, it should be fixable.
  15. 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 =)
  16. 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
  17. Ok, it's definitely possible to get a perfect loop with flv's. i',m actually unsure of that now 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 ), it wont play the file, so stick with flv's (only tried flv and f4v)
  18. I believe you need to use .url instead of .nativePath And remember on IOS youre not using AIR Runtime, your flash code will be converted, why you will also not be able to load SWF's into your application at runtime (i was baffled by this, and it was something that took my stubborn head, days to realize)
  19. 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".
  20. Here's a AS3 version =) function pauseTweensIn(mc:MovieClip,doPause:Boolean = true):void{ for (var i:uint = 0; i < mc.numChildren; i++) { var tweens:Array = TweenMax.getTweensOf(mc.getChildAt(i)) var c:uint = tweens.length while(c--) doPause ? tweens[c].pause() : tweens[c].resume(); } }
  21. Hey Carl, apreciate your thoughts on this For now i've "solved" this by leaving a empty sound track in the FLV's it may not be 100% seamless, but it's acceptable in my situation.
×
×
  • Create New...