[Pixlib] Converting MovieClip in MovieClipHelper
Marcelo de Moraes Serpa
celoserpa at gmail.com
Sun Jan 28 15:58:44 EST 2007
Wow! Very good Eka! I was just needing something like that for my current
project as I've created lots of custom MovieClips as custom components, I'm
sure Neo will make things easier for me. Great work :)
On 1/28/07, eka <ekameleon at gmail.com> wrote:
>
> Hello :)
>
> yes isn't a framework of components but a library to creates components
> based on pixlib ;) it's different :)
>
> You can try the examples in the bin/test/ directory in the SVN of the
> project.
>
> http://svn.riaforge.org/neo/neo/trunk/bin/test/neo/
>
> Example to creates components (buttons, list, etc.) :
> http://svn.riaforge.org/neo/neo/trunk/bin/test/neo/display/components/
>
> In Neo you can use the neo.display.components.container library to
> manipulate the layout of your movieclips or display in list, menu, matrix
> list etc..
>
>
> http://svn.riaforge.org/neo/neo/trunk/bin/test/neo/display/components/container/
>
> Neo it's a light version of my other personal framework LunAS in the VEGAS
> projet in RIAForge :)
>
> EKA+ :)
>
> 2007/1/28, Marcelo de Moraes Serpa <celoserpa at gmail.com>:
> >
> > Hey Eka, thanks for sharing the __resolve() method technique, I didn't
> > have a clue it was possible. Just got to the Macromedia Livedocs and found
> > out more this native Object method. We learn something new everyday!
> >
> > About this framework of yours - Neo, could you give us some more details
> > about it? Is it a component framework or a set of classes to make it easier
> > to work with external components?
>
>
>
> Thanks!
> >
> > Marcelo.
> >
> > On 1/27/07, eka <ekameleon at gmail.com > wrote:
> > >
> > > Hello :)
> > >
> > > The MovieClipHelper use composition but you can use in your
> > > MovieClipHelper a component or a class who inherit MovieClipHelper :)
> > >
> > > PS : if you want use components based on Pixlib you can use my
> > > OpenSource library based on Pixlib : Neo
> > > http://neo.riaforge.org/index.cfm
> > >
> > > I use this library when i work with Francis ;)
> > >
> > > For example you can use my neo.util.factory.DisplayFactory class to
> > > create a dynamic movieclip in your MovieClipHelper with your custom class
> > > who inherit MovieClip.
> > >
> > > http://svn.riaforge.org/neo/neo/trunk/src/neo/util/factory/
> > >
> > > PS : if you want control the internal Movieclip in the MovieClipHelper
> > > with the MovieClipHelper you can add a __resolve method in you
> > > MovieClipHelper class
> > >
> > > /**
> > > * Resolve the specified property name.
> > > */
> > > public function __resolve( name:String )
> > > {
> > > if ( _proxy == null ) return ;
> > > if( !_proxy.hasOwnProperty( name ) ) {
> > > if( _proxy.__proto__[name] == undefined ) return ;
> > > }
> > > if( typeof(_proxy[name]) == "function" ) {
> > > var p = _proxy ;
> > > return function() {
> > > return p[name].apply( p, arguments );
> > > };
> > > } else {
> > > return _proxy[name];
> > > }
> > > }
> > >
> > > with proxy is the reference of your internal MovieClip (replace this
> > > value with the getView() method)
> > >
> > > exemple :
> > >
> > > var display:MyDisplayUI = MyDisplayUI ( MovieClipHelper.*
> > > getMovieClipHelper*( UIList.MY_DISPLAY ) ) ;
> > >
> > > display.play() ; // launch the play() method of the internal MovieClip
> > > of this MovieClipHelper :) the __resolve delegate the method
> > >
> > > EKA+ :)
> > >
> > >
> > >
> > > 2007/1/27, Stef X <stefx.lists at gmail.com>:
> > > >
> > > > Eka, yes i red this but my problem isn't there ;)
> > > >
> > > > I don't want to attach any classes to my assets but only want to
> > > > use the power of MovieClipHelper such as move() , setSize(), resolveUI().
> > > > I acknowledge that i'm a bit lazy so it will be very much easier to
> > > > write
> > > >
> > > > resolveUI(data.forecast).hide()
> > > >
> > > > than
> > > >
> > > > GraphicLibLocator.getInstance().getGraphicLib( data.forecast).hide()
> > > >
> > > > or
> > > >
> > > > resolveUI( data.tendency ).move( 100, 100 );
> > > >
> > > > than
> > > >
> > > > var mc : MovieClip = GraphicLibLocator.getInstance().getGraphicLib(
> > > > data.tendency ).getView();
> > > > mc._x = 100;
> > > > mc._y = 100;
> > > >
> > > > Thanks a lot Eka, Tim for your help...
> > > >
> > > > What do you think Francis about to put the constructor or
> > > > MovieClipHelper public to have a simple way to extend our MovieClips ?
> > > >
> > > > St3fX
> > > >
> > > > 2007/1/27, Tim Will <thedigitalartist at gmail.com>:
> > > > >
> > > > > It's not a silly question Stef! It's a good question, because
> > > > > this is a fundamental change for people who are used to developing in
> > > > > Flash. This is the essential difference with Inheritance and Composition.
> > > > > Traditionally, Flash is set up for Inheritance, but Composition is more
> > > > > flexible.
> > > > > So...a MovieClipHelper is a wrapper for a movieclip - it is
> > > > > composed of a movieclip, plus extra functionality. You don't convert your
> > > > > MovieClips to MovieClipHelpers, you compose a MovieClipHelper with a
> > > > > MovieClip.
> > > > > Here is the order you must use:
> > > > > 1. Instantiate GraphicLib (you can use LibStack if you have a lot
> > > > > of Graphics to load). You should pass in a name that you get from your
> > > > > UIList...because later on you will need that name.
> > > > > 2. Call the Load() method of GraphicLib to get your swf to load
> > > > > in. When it does, it will become the content of the GraphicLib. The whole
> > > > > point of the GraphicLib is basically just to get the thing into memory, and
> > > > > monitor the progress as it loads.
> > > > > 3. Once fully loaded, you can instantiate your UI, which should be
> > > > > an extension of MovieClipHelper. When you do, you pass in the same name you
> > > > > used to make the GraphicLib (e.g. UIList.somename). Using that
> > > > > name, a Locator finds the GraphicLib, gets it's contents (your movieclip)
> > > > > and registers it to the UI as 'view'. Now the UI can affect the movieclip
> > > > > by addressing it as 'view'.
> > > > >
> > > > > Does this make a bit of sense? Once you get the hang of it, it is
> > > > > not hard, just takes some practise.
> > > > >
> > > > > -tim.
> > > > >
> > > > >
> > > > > On 1/27/07, Stef X < stefx.lists at gmail.com> wrote:
> > > > >
> > > > > > Hello there,
> > > > > >
> > > > > > Now i solved my first problem i face a second.
> > > > > > In my main UI i load differents assets using a LibStack.
> > > > > > The question i asking me is why the loaded assets are MovieClips
> > > > > > instead of MovieClipHelpers that are a bit more powerfull and will the
> > > > > > MovieClipHelper's constructor is private, how to convert my MovieClips in
> > > > > > MovieClipHelpers ?
> > > > > > Sorry for these silly questions but i would like to become a
> > > > > > real pixLiber too ;)
> > > > > >
> > > > > > Cheers
> > > > > >
> > > > > > St3fX
> > > > > >
> > > > > > _______________________________________________
> > > > > > Pixlib mailing list
> > > > > > Pixlib at osflash.org
> > > > > > http://osflash.org/mailman/listinfo/pixlib_osflash.org
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Pixlib mailing list
> > > > > Pixlib at osflash.org
> > > > > http://osflash.org/mailman/listinfo/pixlib_osflash.org
> > > > >
> > > > >
> > > > >
> > > >
> > > > _______________________________________________
> > > > Pixlib mailing list
> > > > Pixlib at osflash.org
> > > > http://osflash.org/mailman/listinfo/pixlib_osflash.org
> > > >
> > > >
> > > >
> > >
> > > _______________________________________________
> > > Pixlib mailing list
> > > Pixlib at osflash.org
> > > http://osflash.org/mailman/listinfo/pixlib_osflash.org
> > >
> > >
> > >
> >
> > _______________________________________________
> > Pixlib mailing list
> > Pixlib at osflash.org
> > http://osflash.org/mailman/listinfo/pixlib_osflash.org
> >
> >
> >
>
> _______________________________________________
> Pixlib mailing list
> Pixlib at osflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/pixlib_osflash.org/attachments/20070128/1bcbbb88/attachment.htm
More information about the Pixlib
mailing list