Advertisement
Guest User

Untitled

a guest
Apr 27th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // create onEnterFrame function to fade-in the root element (if UI Element is shown up)
  3. function cry_onShow()
  4. {
  5.    _root._alpha = 0;
  6.    onEnterFrame = function()
  7.    {
  8.       if (_root._alpha < 100)
  9.       {
  10.          _root._alpha++;
  11.       }
  12.       else
  13.       {
  14.          // clear onEnterFrame function
  15.          onEnterFrame = function() {};
  16.       }
  17.    }
  18. }
  19.  
  20. // create onEnterFrame function to fade-out the root element (if requested by UI System)
  21. function cry_requestHide()
  22. {
  23.    onEnterFrame = function()
  24.    {
  25.       if (_root._alpha > 0)
  26.       {
  27.          _root._alpha--;
  28.       }
  29.       else
  30.       {
  31.          // clear onEnterFrame function and notify UI-System that this element does not need to be drawn anymore.
  32.          onEnterFrame = function() {};
  33.          fscommand("cry_hideElement");
  34.       }
  35.    }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement