A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: image loading problem using external text file

  1. #1
    Junior Member
    Join Date
    Aug 2002
    Posts
    17

    image loading problem using external text file

    Hi,

    please somebody help me with this annoying problem:
    I have a homepage with 2 swf-s, one in the top frame and the other one in the left frame.

    When the user clicks on a menu item in the top frame I would like to change the picture in the left frame SWF.

    My solution would be a text file, containing a variable that should be changed after user no.1 clicked on the menu item.

    Now, I don't have the the idea how I could make Flash (MX) to write a single number into currentpic.txt .

    Reading from curpic.txt is solved, so the left frame swf is (nearly OK).

    btw the reading is a bit buggy too...
    I have
    curpic.txt containing curr=1
    and in the FLA

    Loadvariablesnum("curpic.txt",0);
    loadmovie("pic/"+curr+".jpg","mymovieclip");

    and this doesn't work unless I insert this line after loadvarnum:
    if (curr=1) {
    rr=1
    }
    if (curr=2)
    {rr=2
    } and so on.

    and I replace curr to rr in the loadmovie line.

    so please, give me a little help, especially on the writing issue!

    big thanks in advance!!

    bye
    sajoati

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    everything is a bit wrong...
    a) your design implies that the left frame would constantly reload the text file to get any changes
    b) you cannot do loadvariables and immediately use the results for a loadmovie - the loadvariables needs at least one frame (opening a local text file) or perhaps a few seconds (loading from a server)
    c) code like if(a = 1) does not test whether a equals 1 but rather sets a to 1 and then runs the associated statement (since the new value satisfies the test)

    You should consider an alternate approach:
    a) if the operation is not crucial for your navigation, use javascript to tell the left frame to set a specific value and / or goto a specific frame - this will not work for IE on Macs or for Netscape 6 browsers
    b) reload the left frame from the menu frame with a geturl
    c) if you are using MX, check out the localconnection stuff

    Musicman

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Posts
    17
    thanks Musicman, I will try to follow your advices!

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