dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: components values to associative array

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Location
    New Zealand
    Posts
    271

    components values to associative array

    Greetings

    I am wondering if one or more of you very helpful people could possible help me with some actionscript.

    I am creating a form using components, ie, textfields etc.

    And I need to pass the entered value into an associative array, and then have it traced for checking purposes.

    would someone be so kind as to assist me with this?

    thanks and regards
    Anton

  2. #2
    Novemberain Master
    Join Date
    Sep 2004
    Location
    Void
    Posts
    390
    That's quite a complicated task for automation. It's easier to use debugger, especially Admin Tool. Give it a try, it's really awesome one.


    Never give up...

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Location
    New Zealand
    Posts
    271
    thanks for the super quick reply.

    Unfortunately I'm not familiar with Admin Tool. Or the debugger (though I'm familiar with Bugger!)

    Where might I find such a tool?

    Thanks Unsteady!

  4. #4
    Novemberain Master
    Join Date
    Sep 2004
    Location
    Void
    Posts
    390
    You can down load it here

    It consists of two parts: debugger itself and the component to be placed on the Stage (AdminTool uses Flash Local Connection class to get information about your movie). To install a connection component use Macromedia Extension Manager.

    All other information is on AdminTool site. It is really wonderful thing, it allows you see everything in your movie in a quite comfortable way. It even highlights movie clips on the Stage when you select it in debugger (note: I mean AdminTool itself, not native Flash debugger which is not that bad but much less useful than AdminTool).

    And... welcome to the world of Flash debugging


    Never give up...

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Location
    New Zealand
    Posts
    271
    Thanks.

    I've just watched an instructional movie on it - it does look really cool

    http://www.acmewebworks.com/admintoo...Demo3_300k.flv

    However, for what I'm trying to achieve, that will be useful for tracing and watching but, as I'm not much of a coder, I just need some basic code to demonstrate how to add component values to an associative array.

    I can set the associative array up without any values if its easier.

  6. #6
    Novemberain Master
    Join Date
    Sep 2004
    Location
    Void
    Posts
    390
    There is no easy way to get all values of all components into one array. First of all it's easy to determine a value of TextArea but how to determine an exact value of Button or Scrollpane?
    What property to check?

    To do it you should create an array of classnames for components to be listed, pass the Stage through with for .. in and check if class exists on the list. If yes, then add a value to array.

    And then trace the array's content.

    If you're about learing a associative thing here is an example:
    Code:
    a = [];
    a["berry"] = "strawberry";
    a["citrus"] = "lemon";
    for(var key in a){
    	trace(key + " >> " + a[key]);
    }
    trace(a["berry"]);
    Hope this would help.


    Never give up...

  7. #7
    Senior Member
    Join Date
    Sep 2000
    Location
    New Zealand
    Posts
    271
    Thanks Unsteady

    youve been very helpful. Thats given me something to work with in the meantime.

    Though I'll probably be back with some more questions.

    thanks mate.

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Location
    New Zealand
    Posts
    271
    ok. I have another question.

    I've been playing around with the Admin Tool - its very cool.

    if I have a text input component with the instance name of 'session_id' - how do I trace the value of that?

    thanks

  9. #9
    Novemberain Master
    Join Date
    Sep 2004
    Location
    Void
    Posts
    390
    TextInput.text

    I this case you'd better to look up to Components Dictionary in Using Components in Help.


    Never give up...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center