Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 6th, 2024, 9:19 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: assign GotoPage() to clone button
PostPosted: November 26th, 2005, 9:47 pm 
Offline

Joined: November 3rd, 2004, 12:12 pm
Posts: 117
Location: France - Bretagne
hi,

how to assign GotoPage() to cloned button.
What i want to do : i have 3 different base button that i clone several time each. my cloned button must link to other different page ??

thank you
benoit

_________________
Opus Pro 06, Win XP.


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 27th, 2005, 2:15 am 
Offline

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

Without knowing the structure of the pub, it's hard to give
specific instructions, but this should give you a pretty good
idea of how to get there.


HTH
Chris


You do not have the required permissions to view the files attached to this post.

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 27th, 2005, 3:06 pm 
Offline

Joined: November 3rd, 2004, 12:12 pm
Posts: 117
Location: France - Bretagne
excellent,
with your script i have understood what i was doing wrong

It is that line that help me : "nav_button.page=pgname"
My script work but i don't know why and... i like to know how my script work, so could you explain me what is ".page" in the line "nav_button.page=pgname" .

What i don't understand with clone object that it seems to have two name assign to it :

exemple :
eval("clone"+num+"=circle.CloneObject()")
num++

normally with that code the clone is given the name (clone0, clone1...)
but when you want to display the name of those clone, it display like "circle.14255252" . I really don't understand that

thank you very very much
Benoit

_________________
Opus Pro 06, Win XP.


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 27th, 2005, 9:28 pm 
Offline

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

nav_button.page=pgname works like this.

nav_button = the clone
nav_button.page = creates a new property of the clone "page"
nav_button.page=pgname = assigns the contents of the var "pgname" to the new property

Now, each clone has a property called "page" so you can call the value
like this

this.page

Whenever you call this from a clone, it will return the value that was
stored in it. (in this case the value of pgname)

Two names

This is done so you can call the specific clone from a script.

If you call "circle.14255252" from a script, the script thinks your
calling an object called "circle" with a property called "14255252".

Of course, the script finds "circle" (the original object which was cloned)
but does not find the property "14255252" and returns an error.

So we use this code to assign an "alias" to each clone
eval("clone"+num+"=circle.CloneObject()")

This way, we can call the clone without an error by using the alias assigned.

clone0.Move(20,20)
clone1.GetPosition()
clone2.Hide()
.........

Hope this clears it up for you.

Cheers
Chris

_________________
Opus Resources and Services


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 28th, 2005, 10:02 am 
Offline

Joined: November 3rd, 2004, 12:12 pm
Posts: 117
Location: France - Bretagne
Chris,
thank you to have take time to explain me that.
I's a great help for me.

benoit

_________________
Opus Pro 06, Win XP.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 6 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