Scripting the creation of a new image objects

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Scripting the creation of a new image objects

Post by Jellicle » Sat Feb 26, 2011 11:14 am

I need to create a number of new images objects on the fly that all share the same properties (image, scripts etc) as an image already on the card. What's the best way of doing that?
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Scripting the creation of a new image objects

Post by Dixie » Sat Feb 26, 2011 11:28 am

Hi...

Look in the dictionary under 'templateImage. Use the templateImage keyword to set up default properties to be used for any new images objects you want to create. Then the images you create will incorporate the properties that you have set...

be well

Dixie

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Scripting the creation of a new image objects

Post by jmburnod » Sat Feb 26, 2011 1:04 pm

Hi Jellicle,

You can also clone an image and rename it on the fly
Look at clone entry of the dictionary of LC

Best

Jean-marc
https://alternatic.ch

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Scripting the creation of a new image objects

Post by Jellicle » Sat Feb 26, 2011 11:37 pm

Thanks so much :)
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Post Reply