You are here: Recent News » Projects » Pixlib » pixIoC

 

pixIoC

Tags : ,

pixIoC is an extension of pixlib (AS 2.0 framework) developed by Francis Bourre.

This extension is based on Inversion of Control pattern and provides some features to build your application at runtime from an xml file like Spring.

Last but not least, it provides a powerful plugin system and a new event model with channels system.

download

mailing list

pixIoC tools development team

  • Axel Aigret
  • Michaël Barbero
  • Francis Bourre
  • Laurent Deketelaere
  • Nicolas Désy
  • Romain Ecarnot
  • Xavier Martin
  • Benoît Milgram
  • Marcelo de Moraes Serpa
  • Cédric Néhémie
  • Henrik Aleksander Norberg
  • Stefan Vandermeulen
  • Tim Will

Config file examples

Basic example with graphics only

<beans>
	<root id="root">
		<container id="scoreUI" url="swf/login.swf" depth="10">
			<property name="_x" type="Number" value="250"/>
		</container>
		<game id="gameUI" url="swf/game.swf" visible="false"/>
	</root>
</beans>

Basic example of class constructor call

<beans>
	<dll url="dll/FPSLoggerUI.swf"/
	<logger id="myLogger" type="com.bourre.visual.FPSLoggerUI">
		<argument ref="root"/>
		<argument type="Number" value="30"/>
		<argument type="String" value="myLoggerUI"/>
	</logger>
</beans>

Example with application loader and crossed references

<beans>
 
	<application-loader url="swf/loader.swf" 
						name-callback="mc1.myNameCallback" 
						progress-callback="mc2.mc3.myProgressCallback" 
						built-callback="myBuildCallback" 
						depth="1000" />
	
	<root id="root">
		<clip id="empty1" depth="10">
				<button id="button1" url="swf/button.swf"/>
				<button id="button2" url="swf/button.swf"/>
				<button id="button3" url="swf/button.swf"/>
		</clip>
		<clip id="empty2" depth="20">
				<button id="form" url="swf/form.swf"/>
		</clip>
	</root>
	
	<array id="buttonArray" type="Array">
		<argument ref="button1"/>
		<argument ref="button2"/>
		<argument ref="button3"/>
	</array>
 
	<array id="anotherArray" type="Array">
		<argument ref="myArray"/>
		<argument ref="form"/>
	</array>
	
</beans>

Mixed example with dll, constructor calls and references

<beans>
 
	<dll url="dll/AuthentificationPlugin.swf"/>
	<dll url="dll/RemotingRequest.swf"/>
	
	<root id="root">
		<ui id="loginUI" url="swf/login.swf"/>
	</root>
	
	<gateway id="gateway" value="http://www.tweenpix.net/flashservices/gateway.php"/>
	
	<service id="service" type="com.bourre.data.request.RemotingRequest">
		<argument ref="gateway"/>
		<argument type="String" value="com.periscope.test.Authentification.login"/>
	</service>
	
	<login id="authPlugin" channel="auth" type="com.bourre.pixioc.authentification.AuthentificationPlugin">
		<argument ref="loginUI"/>
		<argument ref="service"/>
	</login>
 
</beans>

Example with events, method calls and factory use

<beans>
 
	<dll url="dll/TweenFactory.swf" />
	<dll url="dll/TestUI.swf"/>
 
	<root id="root">
		
		<picture id="junglePic" url="img/jungle.jpg">
			<property name="_y" type="Number" value="250"/>
		</picture>
 
	</root>
	
	<mask id="mask" type="com.bourre.utils.Geom" factory="buildMask">
		<argument ref="junglePic"/>
		<argument type="Number" value="1000"/>
		<argument type="Number" value="250"/>
		<argument type="Number" value="350"/>
	</mask>
	
	<tween 	id="testFactory" 
			type="com.bourre.transitions.TweenFactory" 
			factory="buildTweenMS" 
			singleton-access="getInstance">
		
		<argument ref="junglePic"/>
		<argument type="String" value="_alpha"/>
		<argument type="Number" value="0"/>
		<argument type="Number" value="1500"/>
		
		<method-call name="addEventListener">
			<argument type="String" value="onMotionFinished"/>
			<argument ref="myUI"/>
			<argument method="myUI.release"/>
		</method-call>
		
		<method-call name="execute" />
		
	</tween>
	
	<ui id="myUI" type="com.bourre.demo.TestUI">
		<argument type="String" value="junglePic"/>
	</ui>
	
</beans>

Channel Event system

<beans>
 
	<dll url="dll/MyPlugin.swf"/>
	<dll url="dll/AnotherPlugin.swf"/>
 
	<plugin id="b0" channel="alpha" type="package.MyPlugin"/>
	<plugin id="b1" channel="beta" type="package.MyPlugin"/>
	<plugin id="b2" channel="delta" type="package.MyPlugin"/>
	
	<plugin id="l0" type="package.AnotherPlugin">
		<listen channel="alpha" />
		<listen channel="beta" />
	</plugin>
	
	<plugin id="l1" type="package.AnotherPlugin">
		<listen channel="delta" />
	</plugin>
	
</beans>

projects/pixlib/pixioc.txt · Last modified: 2007/02/19 03:24 by niko