[Pixlib] [pixioc basics] Part1 - Graphics
bali sunshine
bali33 at gmail.com
Wed Jan 17 02:04:40 EST 2007
What I can say ... great ... no, first, thank you Francis !!!
This first tutorial show how pixioc is powerfull and easy to understand and
use, at less bascically !
I have a question, it's possible to initialize _visible for a graphical
object directly in the same node where it's declared, and the other
attribute in the property root. It's possible to use the property _visible
in the root node too ?
Now, I'm waiting for other tutorial Francis, you let us discoverd a littel
part of pixico, you have now to show us more :-)
Thank you.
2007/1/16, Cédric Néhémie <cartel.com at free.fr>:
>
> It's amazing, the more I learn about pixioc, the more I love it :)
>
> Tell me if I'm wrong, an argument node also accept a ref attribute,
> witch automatically browse the graphical tree and return a reference to
> the corresponding object ?
>
> Cédric
>
> elimak wrote:
> > Looks so easy to use ! amazing Francis !
> >
> > Francis Bourre a écrit :
> >> When you need a graphical display in your application, just start by
> >> creating a root node in your applicationContext.xml file.
> >> Root node is mandatory if you wanna display images or swf in your
> >> application.
> >> If you don't need images or swf, just omit this ('root') node.
> >>
> >> ex - 1
> >> <root id="root">
> >>
> >> </root>
> >>
> >> Inside this node you can build your graphical structure.
> >>
> >> So what's possible ?
> >>
> >> Let's begin by displaying an image.
> >>
> >> ex - 2
> >> <root id="root">
> >>
> >> <image id="myImage" url="dir/test.png" />
> >>
> >> </root>
> >>
> >> - node name ('image') could be anything, it's just there for
> >> developer/designer's readibility.
> >> - id attribute ('myImage') is mandatory and must be unique in the
> >> applicationContext.xml file. It's the identifier of this image object
> >> inside in the application.
> >> - url attribute ('dir/test.png') is mandatory if you need to load
> >> external ressource. If you don't specify one, an empty movie clip
> >> will be created. See below, ex - 3.
> >>
> >> ex - 3
> >> <root id="root">
> >> <container id="myContainer" />
> >> </root>
> >>
> >> In ex - 3, I didn't specify any url attribute, so the assembler's
> >> gonna make an empty movie clip for me with 'myContainer' id.
> >>
> >> Now let's imagine I wanna have my image ('test.png') inside this
> >> empty movie clip ('myContainer'). See demonstration below, ex - 4.
> >>
> >> ex - 4
> >> <root id="root">
> >> <container id="myContainer">
> >> <image id="myImage" url="dir/test.png" />
> >> </container>
> >> </root>
> >>
> >> As you see in ex-4, I'll have the graphical structure described below
> >> at runtime:
> >>
> >> root
> >> |_
> >> myContainer( empty clip )
> >> |_
> >> myImage ( image loaded from 'dir/test.png' url )
> >>
> >> Now let's add a 2 swf files in the same container, proceed as shown
> >> below in ex - 5:
> >>
> >> ex - 5
> >> <root id="root">
> >> <container id="myContainer">
> >>
> >> <image id="myImage" url="dir/test.png" />
> >>
> >> <swf id="myFirstSwf" url="cat.swf" />
> >>
> >> <swf id="mySecondSwf" url="dog.swf" />
> >>
> >> </container>
> >> </root>
> >>
> >> As you can see identical node names ('swf') is not a problem, you can
> >> have the same node name at the same level or any level.
> >>
> >> Now, let's talk about depth management !
> >>
> >> pixioc auto manage depth for you.
> >> Depths are calculated like this, at the same hierarchy level, 1st
> >> node exposed in the xml file got lower depth than next node exposed
> >> in same file.
> >> It means that 'myImage' instance will got the lowest depth and
> >> 'mySecondSwf' instance will got the highest depth.
> >> 'myFirstSwf' instance will got higher depth than 'myImage' instance
> >> and lower depth than 'mySecondSwf' instance.
> >>
> >> If you need to hardcode depth, that's possible.
> >> Just do as shown below in ex - 6:
> >>
> >> ex - 6
> >> <root id="root">
> >> <container id="myContainer">
> >>
> >> <image id="myImage" url="dir/test.png" depth="20"/>
> >>
> >> <swf id="myFirstSwf" url="cat.swf" />
> >>
> >> <swf id="mySecondSwf" url="dog.swf" />
> >>
> >> </container>
> >> </root>
> >>
> >> 'myImage' instance will got 20 depth value.
> >> As, expected, 'myFirstSwf' instance and 'mySecondSwf' instance still
> >> have higher depths than 'myImage' instance.
> >>
> >> Ok, now what's about properties ?
> >> You can use all MovieClip properties, yesss all you need ! ;)
> >>
> >> Just proceed as below, ex- 7 :
> >>
> >> ex - 7
> >> <root id="root">
> >> <container id="myContainer">
> >> <property name="_x" type="Number" value="471"/>
> >> </container>
> >> </root>
> >>
> >> property node must have :
> >> - name attribute ('_x') which defines the name of the property,
> >> that's mandatory.
> >> - value attribute ('471') which defines the value of this property,
> >> that's mandatory too.
> >> - type attribute is optional. If you omit it, parser will
> >> use 'String' type.
> >> You can have as many properties defined you need for a single
> >> graphical instance.
> >>
> >>
> >> Ok, now, what about methods ?
> >>
> >> You can call any MovieClip methods, yesss any method you need ! ;)
> >> Methods will be called during application initialization, I mean when
> >> everything have been loaded and every object have been built.
> >>
> >> Just proceed as described below in ex- 8 :
> >>
> >> ex - 8
> >> <root id="root">
> >> <swf id="fade" url="swf/fade2.swf">
> >>
> >> <method-call name="gotoAndPlay">
> >> <argument type="Number" value="2"/>
> >> </method-call>
> >>
> >> </swf>
> >> </root>
> >>
> >> - name attribute ('gotoAndPlay') is mandatory in your method-call
> >> node, that's the name of the method to be called.
> >> If you need arguments, just use arguments nodes. In argument node,
> >> value ('2') is mandatory and type is optional. Default type is
> 'String'.
> >> You can have as many arguments (nodes) you need of course to
> >> execute a single method call.
> >>
> >> You can have as many method calls you need for a single graphical
> >> instance.
> >> Execution order will be from up to down.
> >>
> >> If you wanna hide a graphical instance on application start, you can
> >> use specific visible attribute as shown below in ex - 9:
> >>
> >> ex - 9
> >> <root id="root">
> >> <container id="myContainer" visible="false"/>
> >> </root>
> >>
> >> To conclude this 1st tutorial, I wanna insist on the fact that you
> >> can have the most deep hierarchy in your graphical structure you
> >> need, with as many childs and parents you need, any property and
> >> method call you need too.
> >>
> >> So, start to play now, and enjoy !!! ;)
> >>
> >> francis
> >>
> >>
> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> Pixlib mailing list
> >> Pixlib at osflash.org
> >> http://osflash.org/mailman/listinfo/pixlib_osflash.org
> >>
> >>
> ------------------------------------------------------------------------
> >>
> >> No virus found in this incoming message.
> >> Checked by AVG Free Edition.
> >> Version: 7.1.410 / Virus Database: 268.16.12/630 - Release Date:
> 15-1-2007
> >>
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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/20070117/8813ae65/attachment.htm
More information about the Pixlib
mailing list