Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently September 28th, 2024, 5:19 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Clonescript
PostPosted: June 6th, 2005, 7:42 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Hello,

Help needed.

I want an object to be cloned x times ( variable " kopieaantal" ), my script doesn't work.


Code:
count = l1

function Clonel1(){
for (kopieaantal1=0;kopieaantal1<count;kopieaantal1++) { //loops for the number l1
   image = this.GetName() //gets name of object
   this.CloneObject()
   
   }
}

Thanks for every help.

gr.

Ronnie Dackus


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: functions don't work in a script action
PostPosted: June 7th, 2005, 12:07 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Hi Ronnie,
By your use of this.GetName(), I'm presuming you are trying to declare a function inside a script action attached to an object trigger.
Functions don't work inside script actions -- you have to put functions into a Script Object.

cheers
Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: June 7th, 2005, 11:03 am 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
When you say "doesn't work", what exactly happens, and what were you expecting to happen?


For this message Dave Emberton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 7th, 2005, 12:56 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Thank you Paul and Dave,

Paul, still doesn't work....nothing happens.

Dave

I want an object to be cloned by the variable " kopieaantal".

Example:

On page 1 an user can give a number a text input field, this number is a pub variable. On page 2 a frame ( or object ) is visible one time, now the frame has to be cloned x times ( variable " kopieaantal" ).

Lets say the number ( kopieaantal ) is 3, I want to display on page 2 3 (cloned ) frames!!

Gr.

Ronnie Dackus


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 7th, 2005, 1:32 pm 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
Are you calling the function? Your code doesn't show you calling it anywhere.

What I mean about what do you expect to happen, is that if you just clone an object, an identical object will appear on top of the old one, and you probably won't be able to tell any difference. You need to do something with the clone to make it useful - i.e. move it.

Code:
count = l1

function Clonel1(){
for (kopieaantal1=0;kopieaantal1<count;kopieaantal1++) { //loops for the number l1
   image = this.GetName() //gets name of object
   var clone = this.CloneObject()

    clone.MoveY(kopieaantal1 * 10)
}



For this message Dave Emberton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: June 10th, 2005, 7:12 am 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Dave,

Thank you for comment,

The cloned object will be moved horizontal (x) by its width or (y) by its height, the user can choose.

I will give more info later this weekend.

Thanks already for your reply.

Ronnie


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group