dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] Damm it why wont this work (Array)

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    140

    [F8] Damm it why wont this work (Array)

    Code:
    myMcs=new Array("Alpine_mc", "Jump_mc");
    
    
    but1.onRelease = function()
    {
    	for(var i=0; i<myMcs.length; i++)
    	{
        myMcs[i].gotoAndStop(2);
    	trace(myMcs);
    	break;
    	} 
    }

    dont understand why the above will not work, basically when a button is pushed i want Alpine.mc.gotoAndStop(2); and Jump_mc.gotoAndStop(2);
    but it wont

    any ideas?

  2. #2
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    try this > myMcs=new Array(Alpine_mc, Jump_mc);
    inder

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    140
    awesome thanks for taking the time, didnt realise it made a difference
    anyway thanks again this works below if anyone has the same issues

    Code:
    myMcs=new Array(Alpine_mc, Jump_mc);
    
    
    but1.onRelease = function()
    {
    
    for(var i=0; i<myMcs.length; i++)
    	{
    	myMcs[i].gotoAndStop(2);
    	trace(myMcs);
        } 
    	
    }

  4. #4
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    just because you were inserting strings in array. that was the problem
    inder

  5. #5
    Learning Flash yow's Avatar
    Join Date
    Jun 2007
    Location
    melbourne
    Posts
    110
    This was really helpful for me to see too - thanks!
    code tested in Flash Basic 8 (AS2), Windows XP

  6. #6
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    inder

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