Skip navigation
Forstias
Currently Being Moderated

Ajusting to the AS 2.0/3.0

Oct 26, 2007 2:09 AM

Hello

Iv been struggling abit with the new way that AS should be written. (im the old school flash scripter dropping scripts everywhere :) ). I understand the basic principle of classes and have been testing with them, but what i realy miss is, or are unable to find out, is how to contuniuesly update the behaviour of objects with a script. It used to be easy, just an onEnterFrame and you knew the script was running at every refresh. This is not the case however with classes that I make, they only run codes once. So how do I encorporate that it keeps updating the position of objects for example?
 
Replies
  • Currently Being Moderated
    Oct 26, 2007 5:16 AM   in reply to Forstias
    For example, for subject Hero create file Hero.as:
    class Hero extends MovieClip {
    function Hero() {
    }
    function onEnterFrame() {
    _x++; // for example,move Hero every frame right +1 px
    }
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 26, 2007 8:32 AM   in reply to hotdes
    I've only done AS3 stuff so far, and honestly not alot of it, but I think one of the big changes that occured has to do with listeners. Many of the onRelease() type functions use listeners now.

    So for instance onRelease is basically the MouseEvent.CLICK

    In the below example the instance name of the button is (instanceName), and the function is named (gotoFunction)

    Bottom line is, you'll probably have to do a little research to find these new events.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)