Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently April 22nd, 2025, 1:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Referencing text with opus script
PostPosted: March 9th, 2005, 6:37 pm 
Offline

Joined: March 9th, 2005, 6:32 pm
Posts: 1
Hello,

I have just started using Opus. I am familiar with Director and Lingo (Director's programming language) but I am trying to learn Opus as this is the program of choice at my workplace.

My question is how do you reference text? I.e. in director you could create a text object say called Text1, give it a value, say Hello and then change it using a button by using code on the button along the lines of:-

on mouseup me
member(Text1).text = "The new text"
end

Where .text is the property to reference the object Text1's text. What is the equivilent in Opus Script? Or is it more complicated than in Director?

Thanks everyone

Deano.


For this message Dean_19 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: March 9th, 2005, 7:04 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

To change the contents of a text object, you first need to select its contents using the SetSelection() function. For example, the following script will select the entire contents of a text object named 'Text':

Code:
Text.SetSelection(0,-1)


Once selected, you simply need to use the ReplaceSelection() function to insert the required string or variable into the object. For example:

Code:
Text.ReplaceSelection("This is my text")


The text object named 'Text' should now display This is my text.

Kind regards,

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group