A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Dynamic Text OK on HD, blank online!

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    8

    Thumbs up

    Hi all,

    I've spent the last 6 months working on my first Flash project. I've made heavy use of dynamically loaded text.

    The text window is in a root level 'menu' swf. The menu options load a new swf which in turn populates a text field back in the menu swf, got it?

    Right, now, this all works great on my local PC. Last night, I ftp'd all the files to my host (www.theglobe.com). The non text portions of the swf's work ok.

    None of the text displays! What's up people?
    The directory structure online is the same as on my PC. The ftp prog I used showed file permissions as 777 (wide open).

    I think I'm gonna' cry...

  2. #2
    Member
    Join Date
    Mar 2001
    Location
    Venice, CA
    Posts
    88
    I've had similar issues in the past. I believe it has to do with the time it takes Flash to load the text file on your local (fast) and on your web server (depends on the server). One thing you can do is set a variable such as EOF=yes at the end of your text file(s), and then in your preload (or even when displaying text at different points), use an if statement that requires that EOF=yes before going on. Of course you'd want a different varname for each file.

    Hope that helps,
    Kate

  3. #3
    There could be several reasons for this problem. E.g.,
    · You may be trying to manipulate the variables that are not present in your movie usually that happens when you load external variables and try to use them without making sure that they are loaded successfully.
    · You may be using fonts and your text field properties are not set properly i.e. you have not included the font outliens.
    · You are trying to get variables from a different server than your swf. etc etc.
    Hope this helps.
    Regards,

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Posts
    8

    We're getting closer

    Hey thanks guys.

    Let's see, the EOF suggestion. I have a preloader scene at the start of all swf's which waits until framesloaded == totalframes. Would that do it, or is my logic falling down a hole? I.e. the preloader only preloads itself and not the whole swf...?

    Fonts? I'm using Helevetica, and for the most part (98%), I've opted to include fonts.

    Servers? Hmm. (meekly) I put all the swf's in the same directory. Should I deduce that server landscape is not transparent with Flash? I have no idea how the files are spread out amongst theglobe's resources...

    Thank you!
    (teary eyed smile)

  5. #5
    Junior Member
    Join Date
    Jun 2001
    Posts
    8

    Anyone? Anyone?

    Any takers?

    I still haven't figured this out.
    Just for kicks, I added an EOF check for one of the text files (if var_EOF ne TRUE then go to and play previous (empty) frame, else go to and play next frame etc). It didn't resolve the issue, but it may have shed light on the truth. The playhead never gets past the EOF check. Again, this works fine on my hard drive (so I'm assuming the code works)...

    Anyone?


  6. #6
    It seems that you are trying to manipulate some variable which are not loaded yet.Remember, if you have a lot of text it takes it some time to load from a web server. "framesloaded == totalframes" are you using Flash 4? if so please copy and paste you code here.

  7. #7
    Junior Member
    Join Date
    Jun 2001
    Posts
    8

    Flash 4 code

    Yup, Flash 4, it is...


    Begin Tell Target ("../")
    Set Variable: "FrameLoad" = int((_framesloaded/_totalframes)*100)
    End Tell Target
    Set Variable: "percentage" = ../:FrameLoad&"%"
    Set Property ("Bar", X Scale) = ../:FrameLoad
    If (../:FrameLoad = 100)
    Begin Tell Target ("../")
    Go to and Play (_currentframe+1)
    End Tell Target
    Else
    Begin Tell Target ("../")
    Go to and Stop (_currentframe-1)
    End Tell Target
    End If


    The text files that are loaded (about 6 per swf) range between 1K and 7k. I had thought that because they were text they'd load in a flash (no pun intended).

  8. #8
    Well, the above code is for a pre-loader I presume you are using in your movie. You should remember when you pre load your movie your frame actions are not executed. So if you load an external text file after this pre-loader it will begin loading when your movie will start playing and play head will reach at that particular frame.
    Lets make sure that your variables are actually loaded. We can do a two-frame loop to establish that. Firstly at the end of your external text file add another variable say loaded=1 now load your external vars into level0 (for main timeline)…
    Code:
     Load Variables ("myExternalVars", 0)
    After this frame check that loaded is actually changed to 1 by putting this code in two frames. For first frame...
    Code:
    If (loaded=1)
          Go to and Play (_currentframe+2)
    End If
    Play
    And for second frame immediately after the first one…
    Code:
          Go to and Play (_currentframe-1)
    You can temporarily put a textfield in your movie called loaded to see that if it shows the value of 1. Now if your movie goes past this loop and you still cant see the text come back and we will try something else.

  9. #9
    Junior Member
    Join Date
    Jun 2001
    Posts
    8
    Hello Muhammad,

    ok, let's see...

    ************************************************** *******
    Directory structure.

    / (contains parent_menu.swf)
    /scene_movies (contains swf's to be loaded by menu choice)
    /text (contains text files to be loaded by scene swf's)

    ************************************************** *******
    The EOF declaration from profile_palm1.txt:

    main_text=long blah blah blah.&palm1_EOF=9

    //comment: I used 9 as my EOF indicator in the text file.
    // This EOF var is present only in the first text file //loaded (I thought I'd get one working then replicate code)

    ************************************************** *******

    Code from scene movie 1 (profile.swf):

    Frame 1 and 2 -> Preloader (as per previous post)
    Frame 3
    Load Variables ("./text/profile_palm1.txt", 0)
    Load Variables ("./text/profile_palm2.txt", 0)
    etc

    Frame 4
    If (palm1_EOF=9)
    Go to and Play (_currentframe+2)
    Set Variable: "Text_Indic" = /alm1_EOF
    End If
    Play

    //Text_Indic is has initial text value of
    //"1" in frame 3
    //"2" in frame 4
    //"3" in frame 5

    //Playhead "stops" on frame 4.
    // end comment

    Frame 5
    Go to Previous Frame
    //comment: I also tried the _currentframe-1 expression...

    Frame 6 on: the rest of the movie...

    ************************************************** *******

    Do you see the problem? Am I supposed to put the full URL when specifying the text file path (www.theglobe.com/username/text/load_this_file.txt)?

    Thank you for looking at this!

  10. #10
    First of all if you are loading multiple variables from one external text file your text must be URL encoded so it would be something like this…
    **********************************
    main_text=long%20blah%20blah%20blah%20blah&palm1_E OF=9
    **********************************
    Your directory structure?
    Macromedia tells us that relative URLs do not work consistently from browser to browser with Flash movies. To be on the safe side use the absolute URLs, which means a little bit more typing.

  11. #11
    Junior Member
    Join Date
    Apr 2001
    Posts
    29
    I'm still fairly new to this but I recon it's not working because loading anything externally won't need to be loaded in for the pre-loader script to say that the frame is loaded.

    hope that helps.

    god knows how to fix it... maybe do a check for one of the variables which are loaded or summat?!?

  12. #12
    Junior Member
    Join Date
    Jun 2001
    Posts
    8

    Back to work...

    Ok, I'm back (USENIX in Boston).

    Let's see, "URL encoded". Allrighty. I'll look that up. The example looks like I have to replace spaces with %20's. Hmm.

    More to follow...

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