Jump to content


Converting Actionscript 1.0 to AS2.0 Help please(simple)


  • You cannot reply to this topic
No replies to this topic

#1 RenderBender

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 11 April 2008 - 08:35 PM

Hello, i am trying to make a double helix for my project and i managed to do it well with some help of a few things i found but i was only able to do it in actionscript 1.0 which is not what i want. can you guys help me convert this code to AS2.0? It looks very simple but i can't figure out what is wrong. This is what i have
3 frames with action script on the first frame i have this code
// the idea is to dulicate the movieclip with a little divertion each time and then applying the diversion again and again
for (i=2; i<30; i=i+1) 
{
	duplicateMovieClip ("/dna1", "dna" add (i), i);
	setProperty ("/dna" add i, _rotation, getProperty("/dna" add (i-1), _rotation)+11);
	setProperty ("/dna" add i, _x, getProperty("/dna" add (i-1), _x)+10);
}
setProperty ("/dna1", _visible, "0");

on the second frame i have this code.
for(i=2; i < 30; i = i+1)
{
	setProperty ("/dna" add i, _rotation, getProperty("/dna" add i, _rotation) + 5);
	
}
and on the third frame i have this
gotoAndPlay(2);
Here are the errors when i try to publish in AS2.0
**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 4: ')' or ',' expected
	 	duplicateMovieClip ("/dna1", "dna" add (i), i);

**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 5: ')' or ',' expected
	 	setProperty ("/dna" add i, _rotation, getProperty("/dna" add (i-1), _rotation)+11);

**Error** Scene=Scene 1, layer=Layer 2, frame=2:Line 4: ')' or ',' expected
	 	setProperty ("/dna" add i, _rotation, getProperty("/dna" add i, _rotation) + 5);

**Error** Scene=Scene 1, layer=Layer 2, frame=2:Line 6: Unexpected '}' encountered
	 }

Total ActionScript Errors: 4 	 Reported Errors: 4

Also, or otherwise
all i am trying to do is duplicate the movie clip X amount of times; move the newly duplicated clip up a bit and to the right a bit, and have each one rotate at a degree a little less then the first one, that way it will look like a double helix.

This is where i got the code from
http://www.sitepoint...na-double-helix
and that is what it should look like
can anyone help me
Also, i think it would be best if i didn't have to have the third frame setting itself back to the 2nd, i am trying to make a full website in flash and i'm going to need to have more frames
Thanks a lot for any help;
if you need photoshop help ask me.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users