SACC

/ / inspiration

Bird
Harrison 2008
Nora 2008
Spyder 2008
Chris M 2008
Mai Li 2008
Sarah2008




  1. Open Flash by clicking on the Flash Icon on the dock:



  2. Create a new document. Make sure it is Actionscript 2



  3. Save (+SHIFT+S) document in work folder Save as embedded_clips:



  4. Create at least three layers
    • Actions
    • Buttons
    • Images




  5. In Frame 1 of the Image layer create your background image



  6. Create an object either by inserting a new movie clip or creating a new layer and drawing on that layer. When Drawing is complete, select the image and convert to a movie clip (F8)



  7. In Scene 1, name your movie clip



  8. Open the library and doube click on your movie clip to open it



  9. Add more layers and elements



  10. On one layer create an element that will be invisible-convert it to a movie clip, name the instance in the properties window



  11. Return to scene 1



  12. Click on frame 1 of button layer and add a button (Windows>Other Panels>Common Libraries>Buttons)



  13. Name the instance of the button in the properties window



  14. Click on frame 1 of the Actions layer and open the actionscript window


  15. Create functions that control at least one property of your embedded clip when an event occurs.
    From previous example:
    btnName.onPress = function() {
        movie_clip.moveclip_obj._visible = 0;
    };
    btnName.onRelease = function() {
         movie_clip.moveclip_obj._visible = 1;
    };
    btnName.onReleaseOutside = function() {
        movie_clip.moveclip_obj._visible = 1;
    };



  16. Save, play and publish your movie, then link to and from homepage.



Here's an example of what you could try (but remember to embed your movie clip in another movie clip):
stop();
snd = new Sound();
snd.attachSound("Bubbles.aif");

_root.tank.fish1._visible = 0;
_root.tank.bubbles._visible = 0;
_root.tank.fish1.dx = -2;
_root.tank.fish2.dx = -2;
for (x=1; x<=2; x++) {
    _root.tank["fish"+x].onEnterFrame = function() {
        this._x += this.dx;
        if (this._x<(_root.tank._x-(_root.tank._width/2+this._width/3))) {
            this._x = (_root.tank._x-_root.tank._width/2)+this._width/2;
            this.dx *= -1;
            this._xscale *= -1;
        }
        if (this._x>_root.tank._x+this._width) {
            this._x = _root.tank._x+this._width/2;
            this.dx *= -1;
            this._xscale *= -1;
        }
    };
    _root.tank["fish"+x].onRollOver = function() {
        snd.start(0,1);
        _root.tank.bubbles._visible = 1;
        _root.tank.bubbles._y = this._y+_root.tank.bubbles._height/2;
        _root.tank.bubbles._x = this._x;
        _root.tank.bubbles.onEnterFrame = function() {
            if (this._y>=_root.tank._y+_root.tank._height/3) {
                this._y -= 3;
            } else {
                this._visible = 0;
            }
        };
        
    };
}
_root.btn.onRelease = function() {
    if (_root.tank.fish1._visible == 0) {
        _root.tank.fish1._visible = 1;
    } else {
        _root.tank.fish1._visible = 0;
    }
};