[xray] Minimal connector-only code

John Grden neoriley at gmail.com
Tue Feb 7 08:24:15 EST 2006


Hey all, I finally caught up with this thread ;)

Karina, thanks for doing this!  really appreciate it, as always

_root :  I would suggest not using _root, but _level0 to be more specific.
_root, is a little more vague in that _root can be affected by levels and or
_lockroot property.

Singleton : I myself, don't have a problem with using a singleton - in fact,
I use em' all the time depending on the need.  Usually, in a situation where
scope and static meet.  In fact, I'd really like to swith the
Xray.xrayclass to singleton since it works with a component on stage. 
I have to do
some crapy workarounds because of inspectable properties not being available
to the static methods.

One fix I use in this situation, that seems very handy and still oopish is
to give an "_instance" property:

class com.blitzagenyc.xray.myclass extends MovieClip
{
   public static var _instance:MovieClip;

   // constructor
   function myclass()
   {
      _instance = this;
   }
}

//then, when I need to get to that instance
import com.blitzagenyc.xray.myclass;
var value = myclass._instance.propertyName;
myclass._instance.methodName();

Anyway, the singleton approach is a fine way to do it IMHO, but I understand
*why* Chris did it staticly

On 2/6/06, Karina Steffens <karina at neo-archaic.net> wrote:
>
> > Thanks! It worked first time :-).
>
> Excellent! :)
>
> >
> > > method from anywhere in your application. The method needs to be
> > > passed a movie clip reference to load the connector in.
> >
> > I passed in "_root". Is that the best option normally?
>
> Yes, _root is as good a place as any to load the connector, I think.
> Anywhere where you can create a new movie clip would work just as well.
>
> >
> > > Looking at it again, it's probably the wrong place for the
> > connector
> > > name, if that can be changed. It might be better to just give the
> > > connector a generic name ("XrayConnector.swf" perhaps?) ...
> >
> > I think that is a good idea and I made that change, renaming
> > the connector swf to match.
>
> I think it makes sense to do so, especially if you're using this with
> multiple projects. The original connector can keep it's own name and
> versioning, and copies inside projects can be given the generic name.
> Any objections to this from John & Allen?
>
> Karina
>
>
> _______________________________________________
> 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/20060207/d95939b3/attachment.htm


More information about the xray mailing list