A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: need help...(don't know how to title this)

  1. #1
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693

    need help...(don't know how to title this)

    Sorry for the awful title of the thread but I have no clue what I would call it... Anyways, I have created a class and have made a few objects of that class and I want to make a certain code that will go through those objects depending on if it is their turn or not... my ideal code looks like this however it doesnt seem to work...

    Code:
    import eSet.as;
    var Set1:eSet = new eSet(10, 4, 1, 4, 1);
    var Set2:eSet = new eSet(8, 8, 3, 5, 1);
    currSet=1;
    
    me.enemySpeed = random(Set[currSet].enemySpeed)+Set[currSet].enemySpeedP;
    if(enemyPast>Set[currSet].count){
    	currSet+=1;
    	enemyPast=0;
    }
    basically I cant figure out how to have it automatically go to the next Set since they are all labeled 1-10 or whatever how can I call up the next set using currSet in the way my code shows it? Set[currSet].count doesnt equate to Set1.count even if currSet = 1.
    Last edited by ChaseNYC; 06-29-2006 at 10:47 PM.
    mmm signature

  2. #2

  3. #3
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    Code:
    trace(["Set"+currSet].count);
    trace(["Set"+currSet]);
    trace(Set1.count);
    returns the following:
    undefined
    Set1
    10

    damn i got excited... that should work but it dooooeeessssnnnn't... sooo frustrated right now...
    mmm signature

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    but in the code you posted..

    Code:
    if(enemyPast>set[currSet].count){
    it was NOT capitalized..

    not sure if you saw it or if was supposed to be like that..etc.

  5. #5
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    yeah i noticed... fixed... but what you suggested looks like it would work but it doesnt and i dont know why...
    mmm signature

  6. #6
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    don't know why this works... but it does... its:

    Code:
    _root["Set"+[currSet]].count
    i'm interested in knowing why if anyone could explain how that works...
    mmm signature

  7. #7

  8. #8

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