A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Passing Vars into a text paragraph??

  1. #1
    Junior Member
    Join Date
    Apr 2000
    Posts
    4

    Question

    Greetings Freinds,

    I am trying to pass a set var into a paragraph of text. I figured out how to read a var using a text box and setting the var name of the text box to that of the var it-self. This is nice and all but for resons of simplisity I would like to be able to have 1 paragraph and call a var half way into it, for example:

    Welcome, {name} we are glad you stoped back. Your account ballance is {balance}, bla bla bla......

    Is This possible without having to set a text box for each interpreted var?

    Thanks,

    ------------------
    MotionMan - AKA Wes

  2. #2
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175

    Post

    Hi !

    Lets say that you have textfield vith variable field1 and textfile.txt with

    name=Nowbody&balance=Notning&loaded=1&

    inside it
    So you can say in first frame

    Load Variables ("textfile.txt", 0)

    leave second frame blank and in the third say

    If (loaded=1)
    Set Variable: "field1" = "Welcome, " & name & " we are glad you stoped back. Your account ballance is " & balance & ", bla blabla......"
    Else
    Go to and Play (1)
    End If



    ------------------
    Good luck !
    Ilya. -Polar Lights Studios-
    Flash sources page

  3. #3
    Junior Member
    Join Date
    Apr 2000
    Posts
    4

    Question

    Thanks,

    I tried doing just what you said, It calls the vars fine but when it displays in the text field is displays exactly what I type not the vars. Ex> "&name&" instead of nobody.

    What am i doing wrong?

    ------------------
    MotionMan - AKA Wes

  4. #4
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175

    Smile

    Hi again

    Are you sure that you have "variable" in properties of "value" window inside Set Variable action dialog ?

    ------------------
    Good luck !
    Ilya. -Polar Lights Studios-
    Flash sources page

  5. #5
    Junior Member
    Join Date
    Apr 2000
    Posts
    4

    Talking

    How do you do that, I get either string or expression.

    ------------------
    MotionMan - AKA Wes

  6. #6
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175

    Talking

    Hi !

    Ops
    Sorry - i mean expression of course

    ------------------
    Good luck !
    Ilya. -Polar Lights Studios-
    Flash sources page

  7. #7
    Junior Member
    Join Date
    Apr 2000
    Posts
    4

    Talking

    Thanks A Lot

    That did it.



    ------------------
    MotionMan - AKA Wes

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