dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: My life is in your hands!!

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    14
    I think it's possible to die of frustration. I'm doing something wrong, and I don't know what it is, or how to fix it, but I think I might fall over I'm so aggravated. If you can find it in your heart to take pity on me and help spare my life, I promise to be a good person and to give you credit on the site if you want it. K here goes...
    I have this form with 2 variables-- (player and email). Within the on(release) action for the form's "submit" button, I declare a new variable called "directory" which I send to my CGI script. The script looks like this...

    <hr size=1 noshade color=gray width=80%>
    <blockquote>
    <font size="1" color="navy">
    on (release) {
    directory = player;
    loadVariablesNum ("http://www.trendmasters.com/vendobot/cgi-bin/randomtoy.cgi", 0, "POST");
    }
    on (release) {
    tellTarget ("/") {
    gotoAndStop ("random prize", "re");
    }
    }
    </font>
    </blockquote>

    <hr size=1 noshade color=gray width=80%>

    **(I don't just want directory to equal player, but I want this to work first.)

    The CGI script parses this info and creates a new folder with the name of the value of "directory" in http://www.trendmasters.com/vendobot/players/ In this new folder, the CGI script then creates a new document containing a response. This new document is named resp.htm. All of this works fine. Later in my dumb flash movie, I load the information in resp.htm into a dynamic text box. This is where I'm having the problem. The script for the MC that contains the text box looks like this...

    <hr size=1 noshade color=gray width=80%>
    <blockquote>
    <font size="1" color="navy">

    onClipEvent (enterFrame) {
    first = "http://www.trendmasters.com/vendobot/players/";
    third = "/resp.htm";
    newurl = first+directory+third;
    loadVariables (newurl, "_root.responsers.text response", "GET");
    }

    </font>
    </blockquote>
    <hr size=1 noshade color=gray width=80%>


    For some reason, it seems like the script does not recognize the "directory" variable. I can load text if I use a normal URL specifying the location without any variables. I'll include my flash movie. All of this occurs in the random prize scene. The text is supposed to load in the red ball the bot spits out. Anyway, I appreciate any help. I'm really trying to learn ActionScript, but it ain't easy. Perl is much easier.
    Thanks,
    Diana

    if you want to see the sample...go here
    http://www.trendmasters.com/vendobot...barrellaz.html

    if you want to download my flash movie and give it a go...click below
    http://www.trendmasters.com/vendobot/vendosnot.zip




  2. #2
    look i really don't have a clue what your problem is, but i can tell you something that i would try.

    try using
    value = ( put your addresses here )toString(length of string);

    this would properly conatenate your addresses into one string so that your loadVariables() function could understand it.

    Or maybe you could just use eval() ?

    i'm also learning about concatenating so please correct me if i'm wrong.
    i was trying to concatenate numbers and then turn it into a numeric value but had no luck.
    for example

    rr= 99;
    gg= 33;
    bb= 00;

    color = "0x" + rr + gg + bb;


    can anyone help?
    i imagine its similar to the problem that dschutte is having.


    [Edited by thomasglyn on 11-15-2000 at 04:51 PM]

  3. #3
    Junior Member
    Join Date
    Sep 2000
    Posts
    14
    I tried what you were talking about, but it didn't seem to work. Anyway, "toString()" is for Arrays and returns a string with the array elements separated by commas. Correct me if I'm wrong here. I am new to this. I did a little more testing and found that if I put

    <font size=1 color=navy>
    <blockquote>
    newurl= "http://www.trendmasters.com/vendobot/players/"+directory+"/resp.html";
    </blockquote>
    </font>

    in with the button actions where "directory" is originally defined, and send the "newurl" variable to my CGI script,I get the correct value for newurl if I have my CGI script print it out. I think that this indicates that when I try to call the a variable that was originally set in a different MC, I am unable to call it. Am I supposed to do something different if I set a variable in one movie clip and call it from another?

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    it appears that that the variable directory is on a different timeline to the movieclip which does the concatenation of the three variables, first,directory and third

    So when you are creating your new variable "new url" use this instead:

    newurl=first+_root.directory+third

    That should work now!
    Let me know!
    Regards FlashGuru

  5. #5
    Junior Member
    Join Date
    Sep 2000
    Posts
    14
    YOU ROCK MY WORLD!!! I knew it was something like that...I just didn't know how to do it! BTW...for our concatenating friend...Flash did not like me setting up the variables as below:
    <blockquote>
    <font size=1 color=navy>
    first = "http://www.trendmasters.com/vendobot/players/";
    third = "/resp.htm";
    newurl = first+directory+third;
    </blockquote>
    </font>

    Instead, I had to do it like this:
    <blockquote>
    <font size=1 color=navy>
    newurl = "http://www.trendmasters.com/vendobot/players/" + _root.directory + "/resp.htm" ;

    </blockquote>
    </font>


    I don't know if that helps, but a little FYI. THANKYOU! THANKYOU! THANKYOU! THANKYOU! THANKYOU!

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