Professional Web Applications Themes

Any way to unset a variable? - Macromedia Flash Actionscript

I am working on a rich media template system, which accepts a headline text, and body text (_root.textHead, _root.textBody) each template has default text in it, with the var field set as the proper _root value.. the first time the template loads within the editor, the text input fields pull the default text from the template into the edit fields and everything is fine. But they want it if the user switches the template, it recreates the content to contain the new templates default copy... but since the variable has now been declared, it uses the old text... I have ...

  1. #1

    Default Any way to unset a variable?

    I am working on a rich media template system, which accepts a headline text, and body text (_root.textHead, _root.textBody) each template has default text in it, with the var field set as the proper _root value.. the first time the template loads within the editor, the text input fields pull the default text from the template into the edit fields and everything is fine. But they want it if the user switches the template, it recreates the content to contain the new templates default copy... but since the variable has now been declared, it uses the old text... I have tried to set the variables to equal a newly declared var, but that doesnt help, and I cant find any "unset" or "undeclare" functions...

    Any Help??

    Trave


    trave801 webforumsuser@macromedia.com Guest

  2. #2

    Default Re: Any way to unset a variable?

    delete varname;

    or

    varname = undefined;


    Jeckyl Guest

  3. #3

    Default Re: Any way to unset a variable?

    try with

    blabla = undefined;


    elemental .std webforumsuser@macromedia.com Guest

  4. #4

    Default Re: Any way to unset a variable?

    that's probably going to result in "undefined" being displayed in the textfield. if it does, you might want to use:
    blabla="";


    kglad webforumsuser@macromedia.com Guest

  5. #5

    Default Re: Any way to unset a variable?

    how about trying

    x = null;




    nowB@ webforumsuser@macromedia.com Guest

  6. #6

    Default Re: Any way to unset a variable?

    what u can do is delete the variables and get your new info,
    delete _root.textHead;

    or 2nd option is vartextField = "";

    the string will be empty

    good luck

    rida



    Rhida webforumsuser@macromedia.com Guest

  7. #7

    Default Re: Any way to unset a variable?

    Ah Delete is probably the key... setting it to an empty string just made the text value as an empty string, I don't want it to exist whatsoever, so that the next time the child template would load, it uses what was initially typed into the dynamic text field from the designer...

    using _root.textHead = "" null / undefined / etc. all resulted in a string.

    even if it doesn't work, I can still get the designers to add in an additional line of code at the beginning of the timeline to set what the default is, so I am able to just pull from that if I needed to.

    just so PHP familiar programmers to know...

    keywords: unset == delete

    Thanks guys.


    trave801 webforumsuser@macromedia.com Guest

  8. #8

    Default Re: Any way to unset a variable?

    you're welcome.


    kglad webforumsuser@macromedia.com Guest

  9. #9

    Default Re: Any way to unset a variable?

    your welcome


    Rhida webforumsuser@macromedia.com Guest

  10. #10

    Default Re: Any way to unset a variable?

    you're welcome (might as well say it too)


    Jeckyl Guest

Similar Threads

  1. #21569 [Com]: PHP can't set cookies (setcookie) after invoking an unset variable
    By ggoswami at sbcglobal dot net in forum PHP Development
    Replies: 0
    Last Post: September 15th, 12:13 AM
  2. SID set or unset?
    By Jean-Christian Imbeault in forum PHP Development
    Replies: 3
    Last Post: September 10th, 02:19 PM
  3. unset()ing classes...
    By The Plankmeister in forum PHP Development
    Replies: 0
    Last Post: August 17th, 10:13 AM
  4. Replies: 0
    Last Post: July 9th, 04:39 PM
  5. #22014 [Com]: html_entity_decode with unset variable results in segfault
    By msw at altexa dot com in forum PHP Development
    Replies: 0
    Last Post: July 9th, 03:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139