A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Loading Variable from a local File ?

  1. #1
    Junior Member
    Join Date
    Mar 2000
    Posts
    2

    Question

    Hoping someone can help a newcomer !

    I'm trying to make an intelligent portal for an intranet, with severals menus (clips animation).
    I want to be abble to make some of those clips visible or not, depending on the person who is connecting to the server (by testing the value of variables).
    For example, i want the financial persons abble to see their menu but not the one from the marketing; and vice versa.

    For that purpose, i have on the local disk C:\ of each person a flat file (name.txt) with those values.

    I want this flat file to be load by the animation of the portal (portal.swf)?

    I try the load variable solution on the portal.swf:
    Load Variables("file:///C:/name.txt",0)

    When i try on my local disk (.swf and .txt, both on my C:\ disk); it is working perfect !

    But when i try to connect to my server http (.swf on the intranet server, and .txt on my C , the variable is not load at all !!

    I think this is a problem with the URL adress, but i can't get it!

    Thanks in advance.

    PS: Is there an other way to make an intelligent portal ?

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    2

    Unhappy

    Thanks for your answer ricoshea...

    but i have missed something or I didn't explain correctly my problem; because I don't think I am setting the variables before I load it.

    I have on my local disk the following flat file: FIN=0&MKT=1

    And I have a portal.swf with two clip animations (let say financial and marketing) which is on the server.
    On my time liner I have a first frame with the action: Load Variables("file:///C:/name.txt",0)

    Then I test the value of the two variable FIN and MKT.
    If FIN=1 or 0 then the clip financial is visible or not
    If MKT=1 or 0 then the clip marketing is visible or not

    If I test the portal.html with the following adress on my browser I:\wwwroot\portal.html it is working !!
    If I test the portal.html with the following adress on my browser http://intranet/portal.html it is not working !!

    I think that when I pass by the normal way to connect to my server (http://...), the URL "file:///C:/name.txt" is not understanding by the server (perhaps he can't understand which C:/ i am talking about ?).

    Seb

  3. #3
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756

    Talking

    HI, why dont you try this. Use an entry page which is something like 'this page uses Flash blah blah,enter',this will be a link to a Perl script which is gonna intercept the persons IP number and will automaticaly redirect him/her to your page(s). You dont have to worry loading variable or instaling *dat file on every comp. Since I see you will be working on intranet level geting the IP will not be a problem ( those are static you know ). What do you think?
    Mad-Sci

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    195

    Post

    Problem is.. Your computer is the ONLY one that knows your hard drive as C:. When you view that movie another computer (or, apparently, even on your computer going across the intranet) it: A) no longer recognizes C: as your hard drive, or B) will not allow a remote file access to your hard drive.

    Basically.. you cannot keep that file on a local drive. You need to post that file on a drive that is available to the entire intranet, and provide the path as such.

    Perhaps you could post the file in the same folder that your SWF movie is in. Then you would just need a relative path to the file like this:

    Load Variables ("name.txt",0)

    Or you could use the complete path

    Load Variables ("http://intranet/name.txt",0)

    or whatever.. just so long as that file is on a drive accessable to the whole intranet.


    Does that make sense?
    <EMBED src="/cgi-bin/ubb/Members/sigs/00000205.swf" quality=high WIDTH=500 HEIGHT=50 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED>

  5. #5
    Senior Member
    Join Date
    Feb 2000
    Posts
    195

    Exclamation

    woops.. didn't catch your post Mad-Sci, actually.. that's an even better idea!

  6. #6
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756

    Post

    One more thing I would recomend OHTTPd as a server rather than Microsoft Personal Web
    Just a tought.
    chao

  7. #7
    Junior Member
    Join Date
    Mar 2000
    Location
    Seattle, WA
    Posts
    19

    Post

    You might be running into a weird problem I ran into...if you set any variables before your load variables command, they won't load...try loading your variables, then setting any additional variables you need...might fix your problem.
    <EMBED src="/cgi-bin/ubb/Members/sigs/00000549.swf" quality=high WIDTH=400 HEIGHT=80 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED>

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