A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: about function

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    23

    about function

    I all,

    I would like to create a function to color stuffs.

    Like this:
    PHP Code:
    function colorIt (){
        
    newClr = new Color(box)
        
    newClr.setRGB("0xff0000")
    }

    colorIt() 
    I want the object to color and the color to be dynamic.
    My question is:
    Is it possible to send the object name and the color in tis fuction colorIt()?


    thanks for ur help

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    This should do the trick

    PHP Code:
    function colorIt (mc:MovieClipcolor:Number):Void{
        
    newClr = new Color(mc)
        
    newClr.setRGB(color)
    }

    colorIt(box0xff0000) ; 
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    23
    Exellent. thanks silentweed

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    your welcome
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

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