Jump to content
GreenSock

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

maurik

Members
  • Posts

    10
  • Joined

  • Last visited

maurik's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Its a bit big. its a lot of classes on top of a custom library, and the program is still very buggy on its own. it could take a lot of time for you to dig into it if it helps, this is the list of what happened - 1 tweenlight through an error saying function is not a value, in function renderTime on the line - this.ratio = _ease(time, 0, 1, this.cachedDuration); (i have it on line 429, but my version of tweenlight is different from the official in one line where it checks whether the target is null in the constructor.) i added a try catch to output _ease and target along with the error, and they were both null. i added a variable called _targetName and in the constructor it changes to the name of the target it it has a name, or to "unnamed" if it doens't when it threw the error in renderTime, _targetName was null can you think of anything that would cause this? thanks
  2. Hey, I had some bugs in a badly written program, but one of them i didn't understand - TweenLight threw an error in renderTime (value is not a function, meaning _ease), and i checked and found out that both _ease and target were null. I checked if the constructor was being called and found out it wasn't. How can an instance throw an error before it was instantiated?
  3. thank you so much, works perfectly now.
  4. the time i pass just "120" in "value" is if i dont use stringToObject. in the other cases i pass a full object (with or without brackets). normal example - doesnt use stringToObject property "alpha" value ".5" simple tween example property "" value "alpha:.5" think i found something. after the tween is applied, all the properties are reset as if the mc is in native state. so if i tweened mc1 to rotation 90, in order to tween it back to 0, i have to type -90. same thing happened with the filters - they were all added to previous filters. just no idea why. i uploaded it to http://annacarmi.co.il/control.html. checked there and the above examples work, made a reset button for easier debugging. thanks for taking the time to look into this, meanwhile i'll play around, and ask in other places and post what i find. hope somebody will find a use for it when it works.
  5. i was wrong. it doesnt overwrite filters, what actually happens is: the second time i try to tween the same property, it's value is either unpredictably changed or ignored. i have no idea how to explain it, and i can't seem to find any specific pattern it follows. it happens to filters as well as to simple properties. attached source files, explanation on how to use everything is written on the stage. many thanks
  6. hello! i have made a tool for controlling objects/properties/methods at runtime. it works fine, but i wish to integrate tweenmax so i could easily control complex things like colorMatrixFilter as well. it almost works and about half the time it tweens them, but sometimes it doesnt, and it overwrites filters in a funny unpredictable way etc. i was wondering if someone could help me. this is my code: package { import flash.display.MovieClip; import com.gskinner.utils.StringUtils; import com.greensock.*; public class test extends MovieClip { public var resets:Array = new Array(); public function control(variable:String, property:String, value:String, time:Number = 0, before:String = ""):void { var m = getMC(this, variable); if (before != "" && resets[before] == undefined) { var pre:Object = new Object(); for (var i:String in m) { pre[i] = m[i]; } resets[before] = pre; } if (property.indexOf("Filter") != -1) { var h:Object = new Object(); var n:Object = stringToObject(value); h[property] = n; h["overwrite"] = true; TweenMax.to(m, time, h ); }else if (property in m) { if (m[property] is Boolean) m[property] = Number(value); else m[property] = value; trace(property, ":", m[property]); } } public function getMC(prev:Object, str:String):Object { var m:Object; if (StringUtils.contains(str, ".")) m = getMC(prev[stringUtils.beforeFirst(str, ".")], StringUtils.afterFirst(str, ".")); else m = prev[str]; return m; } public function stringToObject(tString:String):Object { var object:Object = new Object(); var stripped:String = tString.substr(tString.indexOf('{') + 1); stripped = stripped.substr(0, stripped.lastIndexOf('}')); var propArray:Array = stripped.split(','); for (var i:uint = 0; i < propArray.length; i++) { var objectProp:Array = propArray[i].split(':'); var propName:String = StringUtils.trim(objectProp[0]); var propValue = StringUtils.trim(objectProp[1]); object[propName] = propValue; } return object; } public function reset(variable:String, id:String):void { var m = this[variable]; for (var i:String in resets[id]) { m[i] = resets[id][i]; } resets[id] = undefined; } } } thanks! PS if anybody finds this code useful feel free, + if anybody can optimize it in any way please let me know! thanks again, michael
  7. I see. well, thank you very much for clearing that out.
  8. Ok. would this be quicker - add a parameter to the vars object - record:Boolean = false. if true, on tweenlite's ENTER_FRAME event, along with updating the properties of the tweened object, it also stores all the changed properties in an array (could be even a single property). the array's length corresponds to the number of frames the tweening took, each object in the array contains the properties of the tweened object as they were at that frame. thus you create a library of recorded tweens, and to replay a static tween you do something very similiar to creating a new tween instance, only skipping all the calculations. logically, this should be quicker to execute. if i have at realtime about 50 tweening things that depend on a lot of non changing variables and perhaps a complex trigonometric calculation (that once calculated doesnt change), would i not benefit from the fact that they dont have to calculate nothing, but simply read from array?
  9. hello there is there any possibility to convert tweenmax animation into frames? most of my animations are done with tweenmax, and a lot of them don't depend on any variable, completely static. i noticed that even basic animations done to small objects sometimes make CPU peak. i thought that perhaps as frames they would take less. is it true? is it possible? thanks, michael
  10. http://annacarmi.co.il all the animations are done with tweenmax
×