[Xerte] Some simple Qs and comments

Tenney Julian Julian.Tenney at nottingham.ac.uk
Wed Jan 30 14:54:28 GMT 2008


If you ever want to know what an object can do, or see all it's
properties, try inspect(object);

Inspect is a more powerful debug(), which will loop over all properties
and methods of the object and dump them out to the debugger.

Try this in a script icon:

inspect(rootIcon);

It can often give you a clue.

For more hardcore debugging / inspection you can do inspect(object,true)
which will not only loop through all the mehods / properties of an
object, but will recurse through all the properties and methods of its
children and their children and their children and...

You can also do these things directly in the debugger - the text field
at the bottom is for entering a line of code you want to execute. Type
inspect(rootIcon) right in there and hit the 'evaluate' button...

Julian

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Riley Fred
Sent: 30 January 2008 14:39
To: Xerte discussion list
Subject: RE: [Xerte] Some simple Qs and comments

Thanks, Julian - I'd never have guessed that, but it works a treat.
Neither would I have thought to use the 'rs' rather than 'id' property
to reference the button. I couldn't find the setStyleProperty method in
the Xerte scripting reference, but presumably it maps onto an object
method in the Actionscript class hierarchy? Not button as that only has
one method, but perhaps a parent object?

Cheers

Fred

> -----Original Message-----
> From: xerte-bounces at lists.nottingham.ac.uk 
> [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of 
> Tenney Julian
> Sent: 30 January 2008 09:14
> To: Xerte discussion list
> Subject: RE: [Xerte] Some simple Qs and comments
> 
> Give the button a rs property of 'btn'. This is the property 
> you use to address the button using code. Note that the id 
> property for interacion responses refers to the page of 
> content the response controls, not the response itself.
> 
> Make the interaction perpetual, so you can add some script 
> under the interaction that can adjust the settings:
> 
> In that script do this:
> 
> btn.setStyleProperty('textBold', true);
> btn.setStyleProperty('textColor', 0xFFFF00); 
> btn.setStyleProperty('textSize', 30); 
> btn.setStyleProperty('textFont', 'tahoma'); 
> btn.setStyleProperty('face', 0xFF0000);
> 
> cheers Fred,
> 
> Julian
> 
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte


More information about the Xerte mailing list