A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: asp variable / movivclip problems

Hybrid View

  1. #1
    Hammer
    Join Date
    Mar 2001
    Location
    Warrington UK
    Posts
    274
    I am writing a quiz game in a simialar style to who wants to be a millionaire.

    I am loading variables from a database using an asp page. The varilables are loading in fine but when I try to code using the variables flash does not seem to recognise them.

    eg

    colA = root.aud_A;
    moviclip._yscale=colA;

    and I am also having problems with if statements

    if (answer == "answer_A")

    does anyone have any ideas?

    Thanks in anticipation

  2. #2
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    Are you sure your variables have loaded? i always prefer to load variables in an XML object, because this object has a onLoad() event... if you need to know how, just drop me a line with the variables that need to be passed and how you did it, or check out the XML object reference. any XML knowledge?

    ------------
    Uritsukidoji
    ------------

  3. #3
    Hammer
    Join Date
    Mar 2001
    Location
    Warrington UK
    Posts
    274
    I don't think the variables had loaded properly as they were displayed but action script was not working on them.

    I have now resorted to passing them in in the following style all though will try loadvaribalesnum when flash file complete.

    movie?variable1=<%=variable1%>&etc

    I am interested in the advantages / disadvantages of loading the varibales using an xml page, I have very little knowledge of xml but my college is very good at it so between us we should be able to do it.

    There are 20 variables which need passing to the flash file and aslo they need to be passed back to the database when flash has finnished with them.

    Thanks

  4. #4
    Hammer
    Join Date
    Mar 2001
    Location
    Warrington UK
    Posts
    274
    I don't think the variables had loaded properly as they were displayed but action script was not working on them.

    I have now resorted to passing them in in the following style all though will try loadvaribalesnum when flash file complete.

    movie.swf?variable1=<%=variable1%>&etc

    I am interested in the advantages / disadvantages of loading the varibales using an xml page, I have very little knowledge of xml but my college is very good at it so between us we should be able to do it.

    There are 20 variables which need passing to the flash file and aslo they need to be passed back to the database when flash has finnished with them.

    Thanks

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    All right...

    you can build up your requested page (the ASP page) as follows (or any other valid XML, i'm sure your collegue can get you out):

    <XML>
    <QUESTION VAR1="yourvar1" VAR2="yourvar2" />
    </XML>

    //Then you can put this code in one Flash frame:


    function questionOnload(success){
    _root.play();
    }
    question = new XML();
    question.onLoad = questionOnLoad;
    question.load('myPage.asp');

    stop();

    //Then you can put this code in the next frame

    MyVar = question.firstChild.nextSibbling();
    trace(MyVar.attributes.VAR1);
    trace(MyVar.attributes.nodeName);

    // OK, i'm not sure if the last syntax is correct, i have to type it without being able to test it in Flash, but with some creativity and object-knowledge you will be able to extract the variables from the XML Object...

    Good Luck,

    Uritsukidoji


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