dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: changing the main scene variable...... from inside a movieclip button

  1. #1
    i have this button inside a movieclip.The movie clip is placed on the main scene where i have set a variable called counter..... all i want is that every time the user clicks the button the variable counter should increase by one. (there is some reason why i cant place the button on thw main scene)
    ....but the simple command of....
    "counter" = counter + 1
    ......for the button doesn't work.
    There must be a specific way of guiding its way to the main scene variable. I am not aware of that.... please help!
    ...........gauree

  2. #2
    Senior Member
    Join Date
    Oct 2000
    Posts
    274
    Alright,

    You could try using the Tell Target:

    Tell Target ("_level0")
    Set Variable "counter" = counter + 1
    End Tell Target

    .._level0 is the maintimeline level, or I think you can target a variable on the maintime line by using */:* but I'm 100% sure about that.

    See ya


  3. #3
    Generally speaking you have to use tell target only when you want to control a timeline. Try This...
    Code:
    Set Variable "/:counter" = /:counter + 1
    or if you must want to use levels (which in the described scenario is not necessary) try this...
    Code:
    Set Variable "_level0/:counter" = _level0/:counter + 1
    Hope it helps.

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