NEED HELP CHANGING TO AS3 code

  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

was trying to apply this code i have on a movie clip using AS 3..any suggestions?



onClipEvent (enterFrame) {
_x = random(640);
_y = random(480);
_rotation = random(360);
_alpha = random(100);
_xscale = nue;
_yscale = nue;
nue = random(65);
}
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

That looks like its essentially AS1 code. You can't mix the different code bases so you're going to have to convert all this code to AS3.

Adobe has put together this section to help you with that transition.
  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

i know that its AS1 code..i want to know how that could be manifested to AS3 because im working on a AS3 flash now
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Well first of all you cannot place code ON an object in AS3. You will have to place your code on a frame and use an instance name to refer to your clip. Next your best bet is to go through the code line by line and change the concepts to the new version.

For example onClipEvent (enterFrame) is now
Code: [ Select ]
function functionName(event:Event):void
{
movieclipname.addEventListener(Event.ENTER_FRAME, functionName);
  1. function functionName(event:Event):void
  2. {
  3. movieclipname.addEventListener(Event.ENTER_FRAME, functionName);
  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

thanks, and i do understand what your saying, i was hoping someone could me change those simple concepts to AS3 style code..that being said, the link to the AS3 "cookbook" is very helpful and informative. thanks again.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.