Announcement Announcement Module
No announcement yet.
how to setup springactionscript? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to setup springactionscript?


    im new in this forum. i hope u can help me. im interested in springactionscript and want to use it. my problem is how to start? :/

    im using fdt as my ide and flex4sdk as my core library also added sprinactionscript 0.7.1 swc.

    i just want to start but first i need a good example so i tried to draw a rectangle. the constructor of my class which is drawing my rectangle needs only one argument. this argument i want to assign with spring actionscript.

    a simple xml file:
    <?xml version="1.0" encoding="utf-8"?>
    <objects xmlns=""

    <object id="exampleObject" class="com.spring.ExampleClass">
    <constructor-arg value="600"/>


    here is my drawing rectangle class:

    package com.spring {
    	import flash.display.Shape;
    	import flash.display.Sprite;
    	public class ExampleClass extends Sprite {
    		public function ExampleClass(width:int) {
    			var rectPoint4 : Shape = new Shape();, 0x0099FF, 1);; 3,- 3, width, 700);;
    and here is my class which should invoke the xml file.

    package com.spring{
    	import flash.display.Sprite;
    	public class AS_Spring_Example extends Sprite{
    		private var applicationContext : XMLApplicationContext;
    		private var myObject:ExampleClass;
    		public function AS_Spring_Example(){
    			applicationContext = new XMLApplicationContext();
    			applicationContext.addEventListener(Event.COMPLETE, handleComplete);
    		public function handleComplete(event : Event) : void {
    			trace("AS_Spring_Example instantiated");
    			myObject = applicationContext.getObject("exampleObject") as ExampleClass;

    my question is, what shall i do now?:/
    shall i write "addChild(myObject);" in the "AS_Spring_Example" Constructor? It doesnt work. if i run the AS_Spring_Example class i get first the error message:
    TypeError: Error #2007: Parameter child not allowed to be 'null'.
    at flash.display:: DisplayObjectContainer/addChild()
    at com.spring::AS_Spring_Example()
    and then

    Error: An object definition for 'exampleObject' was not found.
    at org.springextensions.actionscript.ioc.factory.supp ort::AbstractObjectFactory/getObject()
    at com.spring::AS_Spring_Example/handleComplete()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_doParse()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextProperties()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextConfigLocation()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_onLoaderComplete()
    if im running the rectangle class "ExampleClass" then "of course" i get the error message:
    ArgumentError: Error #1063: inconsistent arguments for com.spring::ExampleClass(). 1 expect, 0 recieved.
    so how can i draw my rectangle?

    It would be nice if u could help me and give me a solution. im saying thank u already and hope the best
    Last edited by Falko; Jun 24th, 2009, 06:30 AM.

  • #2
    same problem

    Hey Falko,

    I'm pretty sure your suffering from the same problems as the person in this thread:

    The problem is you're using the new namespaces for the upcoming version 0.8 but are including the version 0.7.1 of the library.

    hope this helps,




    • #3
      change to flex builder

      thank u for ur suggestion but it's still not working:/

      it seems like i dont get it to start with fdt. so i changed my ide and im using now flexbuilder3 its working fine but i have to get used with flex.

      im still interested how to use springas in fdt, so if somebody have an idea it would be nice

      thank u again and i wish a nice weekend!


      • #4
        not working in FDT?

        Hi Falko,

        I find it incredibly strange that it would not work with FDT to be honest, and also don't have any clear suggestions what might be the problem.

        I myself am not an FDT user, so I can't really say much about it. So I hope there's other users on the forum here who do use FDT and might be able to help you out.

        If you find out what the problem was then please report it here as well, if its an FDT specific issue I'd like to include it in the documentation for future reference.