A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: what is clone?

  1. #1
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429

    what is clone?

    I'm just messing around listing properties for the various objects and I can't seem to figure out what the the .clone property does.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    A clone property would be the same property as its parent since a clone is the exact copy of a parent. So if you have clones of movieclips for example.

    The term clone is also used to create new nodes in xml: cloneNode.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Nov 2002
    Location
    NYC
    Posts
    43
    It's for BitmapData, Filters and various other things...

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    The clone() method returns an exact copy of the bitmap, filter or whatever else.

  5. #5
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    How exactly does that work? Does it store a clone in memory or duplicate it on-screen? What would be a need for clone()?

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    snowflakes for example
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    whats a usage example?

  8. #8
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    see above
    - The right of the People to create Flash movies shall not be infringed. -

  9. #9
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    *looks up* man, gotta clean my ceiling. No code up there though :P

  10. #10
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You wanted a usage example?! I didn't know. I thought you wanted to know for which purpose you need to clone. Don't know a coding example in Flash 8 yet. I will wait until I get the program. However, it's amazing how much code is out before the program is out
    - The right of the People to create Flash movies shall not be infringed. -

  11. #11
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    clone() creates a copy of the object in actionscript. Nothing visual at all:

    Code:
    myBitmap = new flash.display.BitmapData(100,100,true,0x00000000)
    myBitmap.draw(someMovieClip,someMovieClip.transform.matrix)
    otherBitmap=myBitmap.clone()
    this.attachBitmap(otherBitmap,1)

  12. #12
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    ah, cool thanks.

  13. #13
    mtxoracle
    Join Date
    Nov 2001
    Posts
    1

    Lightbulb Noob..

    Quote Originally Posted by FlashGuru
    clone() creates a copy of the object in actionscript. Nothing visual at all:

    Code:
    myBitmap = new flash.display.BitmapData(100,100,true,0x00000000)
    myBitmap.draw(someMovieClip,someMovieClip.transform.matrix)
    otherBitmap=myBitmap.clone()
    this.attachBitmap(otherBitmap,1)
    So whit this code, flash will make multiple copies of an object (i'm assuming that its a bitmap object...)? So if i wanted an object to create a trail of itself somthign like this would be what im looking to use...?
    Last edited by mtxoracle; 03-30-2006 at 03:57 PM. Reason: more clarification of my understanding (and so i dont sound i'gnant)

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