A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Senior Member Mo1010427's Avatar
    Join Date
    May 2005
    Posts
    343

    resolved [RESOLVED] [MX] Question on reading array information

    Hello, I'm working on making Back and Forward buttons (like browser buttons) for the projector file I'm creating. I have looked briefly at swfaddress, but I don't think that will work on my case since I want the file to run as a standalone movie, not in a browser. Anyhow, my question is how can I read the last value in my array? Or even better, how can I read the second to last value in my array? I've got the back button to work slightly by using the .pop() function. I ran into a problem though doing it that route. I don't necessarily need the information stripped from the array, I simply want to have Flash read the data within it. As I was typing this I had an idea and tried it, it seems to work out for the most part, some bugs still, but hey. I'm going to post the .fla to get opinions anyhow. Is there a better route to take then what I'm doing? Is there a more efficient way? Appreciate any comments. Thanks.

    Mo

    P.S. the forward is yet to be coded, and to nav you use the "2, 3, 4, and 5" keys. "Back Arrow" is to go back.
    Attached Files

  2. #2
    For the love of ~GIMP~ calmchess's Avatar
    Join Date
    Sep 2006
    Posts
    2,583
    PHP Code:
    backBtn0.onPress = function(){
    var0 array0.length 1;
    var1 array0[var0];
    trace(var1);

    ~calmchess~

  3. #3
    Senior Member Mo1010427's Avatar
    Join Date
    May 2005
    Posts
    343
    GIMP,

    I tried out your code. I had to edit "array0.length - 1" to "array0.length - 2" It kept on getting the information of the frame that I was currently on, not the one I came from. I do like the tidier code. Going to see if I run into problems when I go forward and backward. I don't really see why I should off the top of my head, but seldom do things work out the way I plan I'll post anymore questions and the .fla when I get everything working. I thank you.

    Mo

  4. #4
    Senior Member Mo1010427's Avatar
    Join Date
    May 2005
    Posts
    343

    Problem Solved

    I finally got the thing to work the way I needed it to. I'm uploading the .fla in case anybody else is interested in implementing browser "back" and "forward" functions into standalone applications. The file is in MX format. To navigate use the 2, 3, 4, and 5, keys on the keyboard. To go back or forward use the left arrow key and the right arrow key respectively. The number on the screen shows the current frame that you're on.

    Mo
    Attached Files

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