1.You can pass Class object to JavaScript:
JSInterface.window.TweenMax = TweenMax;
In this case you should use FLObject.call method to call TweenMax methods:
TweenMax.call("to", [box, time, params]);
2.You can pass only needed methods from TweenMax:
var window:JSDynamic = JSInterface.window;
window.TweenMax = new JSDynamic();
window.TweenMax.to = TweenMax.to;
In this case you can call TweenMax methods as in ActionScript:
TweenMax.to(box, time, params);
3. You can get link to ActionScript class directly from JavaScript
after JSInterface initialization:
window.TweenMax = FLObject.instance('com.greensock.TweenMax');
But in this case don't forget to mention TweenMax somewhere in your
code to be sure it was compiled into SWF:
package{
import com.greensock.TweenMax;
public class JSClassLinkage extends AbstractApplication{
TweenMax;
....
Check attached examples in "bin-debug" folder. I've used FLSimple
objects to pass parameters AS IS, without linkage.
2011/8/19 mb <syf...@gmail.com>:
--
Oleg Galaburda
http://blog.actualwave.com/
http://jsinterface.googlecode.com/
http://guibuilder.org/
Nice work!
Currently I am working on third version of this library, it will be up
to three times faster(It will replace ExternalInterface JavaScript
code by own version) in modern browsers with Flash Player 11.
It will not be backward complatible, but I will use JavaScript
getters/setters and dynamic JavaScript class creation and this will
allow to call Flash methods/properties as usual:
var easeOut=Bounce.easeOut;
or create instances
var movieClip = new MovieClip();
So, stay tuned. :)
2011/8/22 mb <syf...@gmail.com>:
--