#
 # Button1 example for Swftools http://www.quiss.org/swftools/ #
 # 
 # jpeg button and actionscript movie control # 


.flash bbox=300x200 version=5 name="button1.swf" compress 

        .box fond width=300 height=200 color=gray fill=white line=2
        .jpeg button_idle "first.jpg" quality=100%
        .jpeg button_hover "next.jpg" quality=100%
        .jpeg button_pressed "last.jpg" quality=100%
        .swf movie "example.swf"

 

.sprite movie_clip 

        .frame 1
        .put movie pin=center x=-100 y=150 scale=40%
        .frame 100
        .change movie pin=center x=150 y=150 scale=70%
        .frame 140
        .change movie pin=center x=150 y=150 scale=70%
        .frame 240
        .change movie pin=center x=400 y=150 scale=40%


 .end 


.sprite blank
 # empty movie :-)
 .end 


.button jpeg_button 

        .show button_idle as=idle
        .show button_idle as=area
        .show button_hover as=hover
        .show button_pressed as=pressed
        # ActionScript
        .on_press:
        RunMovie();
        .end


 .end
 #
 # Place Objects
 #
 .put fond 


.put jpeg_button pin=center x=150 y=50 #
 # Actionscript routines
 # 


.action: 


var movie_state ; 


function RunMovie() { 

        if (movie_state == "run") {
        _root.attachMovie("blank","movie1",2);
        movie_state = "stop";
        } else { 
        _root.createEmptyMovieClip("movie1",2);
        _root.attachMovie("movie_clip","movie1",2);
        movie_state = "run";
        }


 }
 .end 


.end 