Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Clone objects in array
PostPosted: July 23rd, 2005, 11:32 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
Hello,

Help needed!!!!

I want to clone objects ( frames ) created in a frame ( Frame_5990 ), but my script doesn't work, please check the script. I call the two scripts with a button, tel() and clonemove() in one script.

Code:
/* CREATE AN ARRAY OF SELECTABLE OBJECTS */
function tel(){
count = Frame_5990.GetNumberChildren()//counts number of objects on page
objarray = new Array() //creates a new array named 'objarray'
for (n=0;n<count;n++) { //loops for the number of objects on page
   object = this.GetChild(n) //determines name of child
   type = object.GetType() //checks what type of object it is
   if (type == "frame") { //if child is an image object
      objarray[n] = object //store this object to the 'objarray' array
   } else {
   return
}
}
}

function clonemove(){
clonearray = new Array()
  for (n=0;n<objarray.length;n++){
pos = objarray[n].GetPosition()
width = objarray[n].GetWidth()
height = objarray[n].GetHeight()
clonearray[n] = objarray[n].CloneObeject()
clonearray[n].SetPosition(0,0)
objarray[n] = clonearray[n]
}
}


I hope someone can help.

Thanks

Ronnie Dackus


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 4:36 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
Hi Ronnie

Are there other object types in Frame_5990 ?

Chris

_________________
Opus Resources and Services


For this message Chris Jones has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 5:40 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
Thanks for your reply,

No Chris only frames...only the frames that are visible have to be added to the clonearray in the script I added:

Code:
if ((type == "frame") && (show=true))


Only to select the frames that are visible.

cheers

Ronnie Dackus


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 5:53 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
==============================================

function tel(){
var x = 0
count = Frame_5990.GetNumberChildren()//counts number of objects in Frame_5990
objarray = new Array() //creates a new array named 'objarray'
for (n=0;n<count;n++) { //loops for the number of objects in Frame_5990
object = Frame_5990.GetChild(n) //Stores the child object in variable object
if (object.IsShowing()) { //if child is showing
objarray[x] = object //store this object to the 'objarray' array
x++
}
}
}

=============================================

HTH
Chris

_________________
Opus Resources and Services


For this message Chris Jones has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 6:06 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
Will try this you use x is there are reason for???


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 6:09 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
Sorry x=n


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 6:26 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
Error

Script[41] (21, 0) : Object Not Found : The called object is not a valid object type (undefined? null?)

I changed also script clonemove


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 6:52 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
Ronnie

please repost the entire script

Chris

_________________
Opus Resources and Services


For this message Chris Jones has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 6:58 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
Her it is Chris,

I'm having problems focusing on my pub so please forgive me I've I ask stupid? questions!!!!!

function tel(){
var x = 0
count = Frame_5990.GetNumberChildren()//counts number of objects in Frame_5990
objarray = new Array() //creates a new array named 'objarray'
for (n=0;n<count;n++) { //loops for the number of objects in Frame_5990
object = Frame_5990.GetChild(n) //Stores the child object in variable object
if (object.IsShowing()) { //if child is showing
objarray[x] = object //store this object to the 'objarray' array
x++
}
}
}

function clonemove(){
clonearray = new Array()
for (n=0;n<objarray.length;n++){
pos = objarray[x].GetPosition()
width = objarray[x].GetWidth()
height = objarray[x].GetHeight()
clonearray[n] = objarray[x].CloneObeject()
clonearray[n].SetPosition(0,0)
objarray[n] = clonearray[n]
}
}

[code][/code]


For this message Ronnie Dackus has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 7:03 pm 
Offline

Joined: November 28th, 2004, 6:05 am
Posts: 141
Location: USA
Fixed


===============================================

function tel(){
var x = 0
count = Frame_5990.GetNumberChildren()//counts number of objects in Frame_5990
objarray = new Array() //creates a new array named 'objarray'
for (n=0;n<count;n++) { //loops for the number of objects in Frame_5990
object = Frame_5990.GetChild(n) //Stores the child object in variable object
if (object.IsShowing()) { //if child is showing
objarray[x] = object //store this object to the 'objarray' array
x++
}
}
}

function clonemove(){
clonearray = new Array()
for (n=0;n<objarray.length;n++){
pos = objarray[n].GetPosition()
width = objarray[n].GetWidth()
height = objarray[n].GetHeight()
clonearray[n] = objarray[n].CloneObject()
clonearray[n].SetPosition(0,0)
objarray[n] = clonearray[n]
}
}

===============================================

Chris

_________________
Opus Resources and Services


For this message Chris Jones has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 23rd, 2005, 7:17 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
Thanks Chris,


gr.

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  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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