Homepage -> Guida SWISHmax

REALIZZARE UN MENU' WEB







  1. Come prima cosa dovete creare le varie sprite e le varie forme ( piccoli rettangolini colorati ) costituenti la barra.




    Fig. 1




    Fig. 2



  2. La prima sprite è vuota come mostrno le due figure successive:




    Fig. 3




    Fig. 4



  3. La seconda sprite è uguale alla precedente.


  4. La terza sprite è costituita semplicemente da due rettangolini rossi; le Azioni da applicare sono elencate in questo file.




    Fig. 5




    Fig. 6



    Syntax
    onEnterFrame() {
    statement(s);
    }
    onEnterFrame(includingFirstFrame) {
    statement(s);
    }
    onEnterFrame(excludingFirstFrame) {
    statement(s);
    }

    Arguments
    includingFirstFrame: Optional keyword. see below
    excludingFirstFrame: Optional keyword. See below.

    Returns
    Nothing.

    Description
    This Event Handler Function is called at the start of each frame of display, whether the associated object is playing or not. However, if the sprite is removed, then the onEnterFrame actions are no longer processed. The Actions associated with the Event are processed before any Frame Action events for the object.

    If "includingFirstFrame" is specified, then the actions will be processed on all frames of display starting from and including the very first frame that the object is placed. If "excludingFirstFrame" is specified, then it will not run for the first time until the frame AFTER the object is placed. Compare this with the onLoad Event Handler Function, which will run ONLY for the first frame of display.

    The default if you specify neither option is "excludingFirstFrame" (this is the same behaviour as Flash uses for its enterFrame clip event).

    This Event Handler is an ideal place to install collision detection routines for games, etc.

    Sample
    s1, s2 are both Sprites. Below is the scripting for Sprite s1. Debug trace is generated on transition.

    onEnterFrame() {
        blIsNear = _parent.s2.isNearThis();
        if (blIsNear != blIsNearLast) {
            // we have moved to or from is Near condition
            trace("x=" + _X + " y=" + _Y + " isnear=" + blIsNear);
        }
        blIsNearLast = blIsNear;
    }

    onLoad () {
        blIsNearLast = false;    // initialise boundary condition
    }

    onSelfEvent (press) {
        this.startDragLocked();    // when object is clicked on, start mouse drag
    }

    onSelfEvent (release) {
        stopDrag();    // when mouse is released, stop mouse drag
    }



  5. La sprite sliderOver contiene invece le stesse due forme rettangolari di prima, solo che sono gialle; le Azioni da applicare sono elencate in questo file.




    Fig. 7



  6. Le altre Sprite, dalla button1 alla button6, sono tutte uguali e rappresentano appunto i vari bottoni della barra; le Azioni da applicare sono elencate in questo file.




    Fig. 8





    Fig. 9



    Self Events occur when the mouse interacts with an Object in a Scene or a defined key is pressed. Only Objects that are defined as Targets can use Self Events. More than one Self Event can trigger the same Action.


    · onSelfEvent (press): press the left mouse button while the cursor is over the Sprite

    · onSelfEvent (release): release the left mouse button while the cursor is over the Sprite

    · onSelfEvent (rollOver): move the mouse cursor from outside the Sprite to over it with no mouse button pressed

    · onSelfEvent (rollOut): move the mouse cursor from over the Sprite to outside it with no mouse button pressed

    · onSelfEvent (dragOver): move the mouse cursor from outside the Sprite to over it with the left mouse button pressed

    · onSelfEvent (dragOut): move the mouse cursor from over the Sprite to outside it with the left mouse button pressed

    · onSelfEvent (releaseOut): release the left mouse button after moving the cursor outside the Sprite

    · onSelfEvent (keyPress): press the define Key. The required key can be entered in the Key field or selected from the common keys drop-down Menu.



  7. A tal punto non rimane altro che impostare qualche settaggio alla scena e salvare ed esportare l'applicazione.




    Fig. 10