A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Quick Variable Syntax Question

  1. #1
    Hairy Member robbmcaulay's Avatar
    Join Date
    Dec 2001
    Location
    Edinboro, yo!
    Posts
    1,596

    Quick Variable Syntax Question

    I am more of a graphics man myself and only dabble in variables etc. when needed...

    So here we go... I need to define variables on the time line and on the frame there is a button...

    Timeline AS :

    code:
    P = 284, 259;



    Button AS :

    code:
    on(rollOver){
    _root.mc_folio.slider._easing = setInterval(ease, 40, slider, P, 2);
    }



    Can anyone explain the proper syntax to make this work? I would be extremely grateful...

    Thanks, I will post the results as a thank you...

    Robb
    "Wah wah wah Dorothy Parker wah wah wah" - hanratty21

  2. #2
    Member
    Join Date
    Feb 2004
    Location
    Somewhere on Earth (I think)
    Posts
    87
    First of all, you would have to define a separate variable for each parameter you want to pass to your function later.

    So "P = 284, 259" should look like:

    code:
    P1 = 284;
    P2 = 259;



    And later on, when you use these variables , you would do it like this:

    code:
    on(rollOver){
    _root.mc_folio.slider._easing = setInterval(ease, 40, slider, P1, P2, 2);
    }



    Also, if your button is located in some movie clip, you would have to use "_root." in front of each variable you want to call from the main timeline. For example, the call to that function would look like this:

    code:
    on(rollOver){
    _root.mc_folio.slider._easing = setInterval(ease, 40, slider, _root.P1, _root.P2, 2);
    }


  3. #3
    Hairy Member robbmcaulay's Avatar
    Join Date
    Dec 2001
    Location
    Edinboro, yo!
    Posts
    1,596
    Thanks, will give that a try...
    "Wah wah wah Dorothy Parker wah wah wah" - hanratty21

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