# # Sample Menu example for Swftools http://www.quiss.org/swftools/ # # # # .flash bbox=250x200 version=6 name="menu.swf" compress .font myfont "../font/Automaton.swf" .box fond width=250 height=200 color=gray fill=white line=2 .box button_idle width=100 height=35 color=blue fill=salmon line=3 .box button_hover width=100 height=35 color=red fill=salmon line=3 .box button_pressed width=100 height=35 color=gray fill=salmon line=3 .box item_area width=115 height=165 color=green line=6 .text text_button font=myfont text="Menu" color=blue size=50% .text text_item1 font=myfont text="One" color=blue size=50% .text text_item2 font=myfont text="Two" color=blue size=50% .text text_item3 font=myfont text="Three" color=blue size=50% .text text_item4 font=myfont text="Four" color=blue size=50% .sprite empty .end .button object_menu .show button_idle as=shape .show button_idle as=area .show button_hover as=hover .show button_pressed as=pressed .on_move_in: _root.MenuOn(); .end .on_press: _root.MenuOff(); .end .end .button item_zone .show item_area as=area # for test only # .show item_area as=shape .on_move_out: _root.MenuOff(); .end .end .button menu_item1 .show button_idle as=shape .show button_idle as=area .show button_hover as=hover .show button_pressed as=pressed .on_move_in: _root.MenuOnStop(); .end .on_press: this.geturl('javascript:alert(\'You pressed the item 1\')'); _root.MenuOff(); .end .end .button menu_item2 .show button_idle as=shape .show button_idle as=area .show button_hover as=hover .show button_pressed as=pressed .on_move_in: _root.MenuOnStop(); .end .on_press: this.geturl('javascript:alert(\'You pressed the item 2\')'); _root.MenuOff(); .end .end .button menu_item3 .show button_idle as=shape .show button_idle as=area .show button_hover as=hover .show button_pressed as=pressed .on_move_in: _root.MenuOnStop(); .end .on_press: this.geturl('javascript:alert(\'You pressed the item 3\')'); _root.MenuOff(); .end .end .button menu_item4 .show button_idle as=shape .show button_idle as=area .show button_hover as=hover .show button_pressed as=pressed .on_move_in: _root.MenuOnStop(); .end .on_press: this.geturl('javascript:alert(\'You pressed the item 4\')'); _root.MenuOff(); .end .end # # Place Objects # .put fond .sprite menu_button .put object_menu x=20 y=20 .put text_button pin=center x=70 y=37 .end .sprite menu_on .frame 0 .put menu_item1 20 20 .put text_item1 pin=center x=70 y=37 .frame 5 .put item_zone 118 18 .change menu_item1 125 20 .change text_item1 pin=center x=175 y=37 .put menu_item2 125 20 .put text_item2 pin=center x=175 y=37 .put menu_item3 125 20 .put text_item3 pin=center x=175 y=37 .put menu_item4 125 20 .put text_item4 pin=center x=175 y=37 .frame 10 .change menu_item2 125 60 .change text_item2 pin=center x=175 y=77 .change menu_item3 125 100 .change text_item3 pin=center x=175 y=117 .change menu_item4 125 140 .change text_item4 pin=center x=175 y=157 .frame 10000 .end .action: _root.createEmptyMovieClip("menu",500); _root.attachMovie("menu_button","menu",500); function MenuOn() { menu = "1"; _root.createEmptyMovieClip("menu_item",400); _root.attachMovie("menu_on","menu_item",400); } function MenuOnStop() { menu_item.stop(); } function MenuOff() { menu = "0"; _root.createEmptyMovieClip("menu_item",400); _root.attachMovie("empty","menu_item",400); } .end .end # End swf movie