[xray] Minimal connector-only code

John Grden neoriley at gmail.com
Tue Mar 14 08:09:49 EST 2006


Ok, i finally sat down and tested the singleton (thank you Karina!)

It works just fine, like you say, with 2 lines of code:

import com.blitzagency.xray.util.XrayConnect;
var xRay = XrayConnect.getInstance(_level0, true);

But my question would be, why use it instead of XrayLoader?  The only
savings typing-wise is 1 argument, but you've now got extra kb added to your
file:

import com.blitzagency.xray.util.XrayLoader;
XrayLoader.loadConnector("xray.swf", _level0, true);

Maybe there's another benefit I'm missing - what do you guys think?  I don't
mind adding it to the package as an option at all, but just want to make
sure there's a good reason for it being there.

John

On 3/14/06, xray at osflash.org <xray at osflash.org> wrote:
>
> > So what should become Daren's example :
>
> Below is the code that works for me. I'm not sure there has been a new
> release since so you have to make and put XrayConnect.as in the
> com.blitzagency.xray.util directory. In case you don't have it I've
> attached it.
>
> Darren
>
> //-------------------------------------------------------------------
> import com.blitzagency.xray.util.XrayConnect;
>
> class HelloWorld{
> /** Holds reference to the single global class that main() creates */
> static var app:HelloWorld;
>
> /** Constructor: does all the work */
> function HelloWorld(){
> _root.createTextField("txt",10,0,0,0,0);
> _root.txt.autoSize='left';
> _root.txt.text="Hello World!\n";
>
> _global.tt("Finished initializing HelloWorld");
> }
>
> /** Program entry point: creates one global instance of our class */
> static function main(){
> XrayConnect.getInstance(_level0,true);    //true means show
>                                         //frames per second
> app=new HelloWorld();
> }
>
> }
>
>
> _______________________________________________
> xray mailing list
> xray at osflash.org
> http://osflash.org/mailman/listinfo/xray_osflash.org
>
>
>
>


--
John Grden - Blitz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/xray_osflash.org/attachments/20060314/f85ffe84/attachment.htm


More information about the xray mailing list