A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [help] _global scoping issue

  1. #1
    Member
    Join Date
    Oct 2002
    Location
    Valparaíso, Chile
    Posts
    80

    [help] _global scoping issue

    Hi:
    I have this strange problem when using _global to reference a variable in FMX.
    in the first frame of tha main timeline i have declared a variable, _global.content="hi, i'm the content"; it renders correctly in a dynamic html text field. But when i try to change the content with a button, like on (release){_global.content="i'm the new text";}, it won't do a thing... if i replace _global with _root it works, though. I want to further understand how to use the _global thing, if somebody knows what i'm doing wrong, i'll be very thankful.

    Cheers!

    Sir Patroclo
    sleeping is a luxury I can't afford
    ____________
    www.sir-patroclo.com

  2. #2
    Senior Member
    Join Date
    Mar 2003
    Location
    127.0.0.1
    Posts
    154
    in my most honest opinion, ive been programming for a long time, and when i first learned of global, i said "wow, now i dont have to find the variable first (i.e. _root.something.something.variable), i can just call it....." it never worked right, and it ends up if you use regular variables, your code is more efficient, and easier to follow......
    [sorry my reply had no help on global which you sought]

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