Example:
Controls
Right click ont the movie and select one of the options from the context menu.
First Of All
Open SwishMax and set the stage size, i have used 210 x 250 for the example.
Step. 1
Create a sprite and call it one, inside the sprite, create your content.
I have just selected the text tool and wrote sprite 1 loaded, just for a visual representation.
Step. 2
Follow step 1 but this time call the sprite two and add your content for the sprite again i have chosen the text tool and wrote sprite 2 loaded for the visual representation.
Once you have created you two sprites add the following script to Scene_1
|
onLoad () {
var rootMenu = new ContextMenu(); //code for sprite 1 rootMenu.hideBuiltInItems(); _root.menu = rootMenu; var testFunction1 = function () { one.gotoAndPlay(2); }; var newItem01 = new ContextMenuItem("Load Sprite 1", testFunction1); rootMenu.customItems.push(newItem01); _root.menu = rootMenu; //code for sprite 2 rootMenu.hideBuiltInItems(); _root.menu = rootMenu; var testFunction2 = function () { two.gotoAndPlay(2); }; var newItem02 = new ContextMenuItem("Load Sprite 2", testFunction2); rootMenu.customItems.push(newItem02); _root.menu = rootMenu; } onFrame (1) { stop(); } |
Now Press Ctrl+T to test it working.

10 Random Swish Tutorials :
10 Random FlashPerfection.com Tutorials:





