A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: node length

Hybrid View

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    996

    node length

    I'm trying to use EX4 built in looping to find the length of a list of items.
    here is the xml:
    Code:
    <display name="image1" type="image"> 
    <src>dev/img/homeGroup1.jpg</src>
    </display>
    <display name="image2" type="image"> 
    <src>dev/img/homeGroup2.jpg</src>
    </display>
    <display name="image3" type="image"> 
    <src>dev/img/homeGroup3.jpg</src>
    </display>
    <display name="image4" type="image"> 
    <src>dev/img/homeGroup4.jpg</src>
    </display>
    Actionscript Code:
    var max:Number = config..*.( attribute( "type" ) == "image")[0].length();

    Why would the above not work.

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    996
    Anyone.

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    In what way is it not working? error messages? unexpected output?

    Is config defined? Have you tried using the @ attribute syntax instead of the attribute function? Since you have [0] at the end, you are getting a single node and the length should return 1.

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    996
    5TonsOfFlax thanks I woke up this morning and realized the [0] was screwing me up.

    Thanks

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