dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Help regarding one button script

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    14
    Here's the scenario

    I have made a picture viewer and I wanna know how to execute all pictures in one frame and one button.

    Right now here is my problem:

    Frame 1; Playbutton
    http://localhost/swiftgen.exe?sws=image.sws&pics=1

    Frame 2; Playbutton
    http://localhost/swiftgen.exe?sws=image.sws&pics=2

    Frame 3; Playbutton
    http://localhost/swiftgen.exe?sws=image.sws&pics=3


    and so on...


    I have 200 pictures and I don't want to execute it frame by frame


    I'm thinking of this kind of solution (pseudo code)
    ------
    Frame 1;
    x=1;

    Frame 2 Playbutton
    On Release

    http://localhost/swiftgen.exe?sws=image.sws&pics=x;


    Frame 3

    x=x+1;

    Goto Frame 2
    ------

    Same as the "reverse button" but x=x-1



    Im a total beginner and I hope somebody can help me

    Actionscript code would be very much appreciated


  2. #2
    ActionScript.org
    Join Date
    Aug 2000
    Posts
    1,030
    You had it pretty much right:

    Frame1:
    ------
    // incriment x, if it doesn't exist, create it
    x++

    Frame2:
    ------
    // button with these actions
    on (release){
    getURL("http://localhost/swiftgen.exe?sws=image.sws&pics=" + x)
    gotoAndStop(3);
    }

    Frame3:
    ------
    gotoAndPlay(1)

    This assumes you're using getURL to call your executable... all it does is concatenates the value of x onto the call string.

    Cheers

    Jesse

  3. #3
    Junior Member
    Join Date
    Apr 2001
    Posts
    14
    Thanks Jesse!

    Another problem

    Here are some of my files

    small pics
    small1.jpg
    small2.jpg
    small3.jpg
    :
    :
    small82.jpg


    big pics
    big1.jpg
    big2.jpg
    big3.jpg
    :
    :
    big82.jpg


    When I click "forward" button small2.jpg comes up when I click "open" button then big2.jpg shows up on the other side


    Questions:

    Regarding Jesse program. How to deal with the "open" and "back" button? 82 is the maximum number of pics. Is it also possible to make the maximum number of pics variable? So that I will not edit anymore the FLA file whenever I add more pics?




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center