A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: 2 dyn. TextFields & linking from .txt to .txt

  1. #1
    Junior Member
    Join Date
    Dec 2000
    Posts
    22
    Hi everybody,

    I'm having this problem I can't fix... Let me explain what I want first:
    It's just like having 2 HTML frames: navigation and main frame. In nav.html (loaded in the navigation frame), I have a several links to several pages, that have to be opened in the main frame. In HTML you do <A HREF="main001.html" target="main">Link 1</A> and for the second link <A HREF="main002.html" target="main">Link 2</A> (assuming the main frame has the name "main").

    But now... How do I get this effect in Flash? ...

    ... when in stead of frames, I have TextFields (dynamically loaded) and in stead of *.html, I have *.txt. BTW I'm working with 1 *.swf, let's say Movie.swf.
    The links are in the nav.txt and this is loaded in the navigation-TextField. Each link has to open another *.txt (main001.txt for link1, main002.txt for link2 etc) in the main-TextField - thus, the main-TextField has to load different URL (*.txt), depending of the link.

    -- HOW TO DO THIS??

    What I have until now, is those 2 TextFields, and the those links in nav.txt. I fixed it with JavaScript

    <A HREF="JavaScript:FileOpen('001')">Link1</A>
    <A HREF="JavaScript:FileOpen('002')">Link2</A>
    etc.

    This calls the function FileOpen in Movie.html (generated by Flash when publishing Movie.swf)

    function FileOpen(i) {
    window.document.movie.return(i);
    }

    the value i that is parsed by the function has to build the name of the to be called file:
    e.g. Link1 sends 001. In Flash, the URL of the loadvariablesNum is 'main' + i + '.txt'
    and so the URL of the to be loaded file is main+001+.txt = main001.txt

    This DOES NOT WORK! the function FileOpen is not correct, but what is wrong with it and how do i fix this function?!
    or, if I'm completely wrong, how to fix the whole problem, so I can achieve my goal?

    Thanks in advance,
    veedub

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Jerusalem, Isreal
    Posts
    254
    ok... i think i got your problem right...
    when you ask javascript function to return(i); it will simply returns the value of "i". very usefull for math functions, but not in this case.
    what you need to do is window.document.movie=i
    (or maybe:window.document.movie.value=i)
    but still, my friend, and that's the bad news, i dont think that the object: window.document supports the mathod "movie".
    check to see if it is correct.
    good luck, man

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