I am trying to make IntelliJ IDEA 12
configure rsl
libraries for runtime loading.
Do you have any experience with that, and do you maybe have a sample XML
you put into aditional compiler options?
Also, I didnt find the plugin for this, if you know any please say
update:
To clarify the practice project more:
I want to make 2 'swf's that will have one tweening library used on a simple shape, but I want to make that tweening library crossdomain rsl.
Then the goal is to in MainApp load and add to stage one swf and then the other. What I expect to happen is that the first time rsl will be loaded and the second time it will be used from cache.
I am programing in pure AS3. Examples would be wonderful :) Right now I am trying to build one class that has RedSquare and tweening applied to that square. Ofcourse, tweening should come from rsl library.
Update 2:
I got to the point where I create [Frame(factoryClass='path.to.class')] and I create Preloader.
But here now I dont know how to make a preloader that would load rsl's and then go to the next frame, or main class. What [Frame] tag does, is it makes two frames, one for preloader, and one for main class that should be executed after.
Config I pass to the compiler:
<flex-config>
<!-- A list of runtime shared library URLs to be loaded before applications start. -->
<!-- GreenSock -->
<runtime-shared-library-path>
<path-element>/Users/matej/Documents/Projects/Work/External/greensock-as3/greensock.swc</path-element>
<rsl-url>http://localhost/~matej/rsls/greensock.swf</rsl-url>
<policy-file-url>http://localhost/~matej/rsls/crossdomain.xml</policy-file-url>
<rsl-url>http://localhost/rsls/greensock.swf</rsl-url>
<policy-file-url>http://localhost/rsls/crossdomain.xml</policy-file-url>
</runtime-shared-library-path>
<!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
</flex-config>
main class
package {
import com.greensock.TweenLite;
import Preloader;
import flash.display.Sprite;
import flash.events.MouseEvent;
[Frame(factoryClass="Preloader")]
public class RedSquare extends Sprite{
//---------------------------------------------------------------
// Private variables
//---------------------------------------------------------------
private var redRectangle:Sprite;
//---------------------------------------------------------------
// Constructor
//---------------------------------------------------------------
public function RedSquare() {
redRectangle = new Sprite();
redRectangle.graphics.beginFill(0xFFFF0000);
redRectangle.graphics.drawRect(100,100,50,30);
redRectangle.graphics.endFill();
addChild(redRectangle);
redRectangle.addEventListener(MouseEvent.MOUSE_OVER,onOver);
}
//---------------------------------------------------------------
// Public methods
//---------------------------------------------------------------
//---------------------------------------------------------------
// Private methods
//---------------------------------------------------------------
private function onOver(event:MouseEvent):void {
TweenLite.to(redRectangle,3,{x:400,y:200,rotation:160})
}
}
}