[Xerte] Page Templates - Interface Customization

Julian Tenney Julian.Tenney at nottingham.ac.uk
Fri Sep 11 09:23:25 BST 2009


I suspect the swf hasn't loaded yet. You're trying to get at a timeline
before the swf has loaded and initialised. Use the onLoad event on the
icon to try the same code that sets your text, or some other code that
runs later,

You might want to look at using a component icon rather than a graphic
icon, as you can pass an initObject into an init function in your swf
when it loads up, rather than handle events, and certain things -
FileLocation, debug(), rootIcon (I think) are passed into the swf for
you to more conveniently use.


-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of James
McCleese
Sent: Friday, September 11, 2009 4:42 AM
To: Xerte discussion list
Subject: RE: [Xerte] Page Templates - Interface Customization

Thanks for the help everyone -- I was able to get my navigation buttons
in my .swf working hand in hand with the rootIcon navigation functions.
However, I'm having a problem similar to one another user was having
with some dynamic text boxes that I use to display the current page and
a total page count. I've done a couple of things to try to debug and ran
up against a problem I thought you might help with :)
 
In my .swf I can use the code:
 
this._parent._parent.rootIcon.controller.numpg_txt.text =
this._parent._parent.rootIcon.pages.length
 
...in a button which will set the numpg_txt dynamic text box to the
total number of pages.
 
However, in the onInit event, I use the code:
 
rootIcon.controller.numpg_txt.text = rootIcon.pages.length
 
...which doesn't work at all. I have established that the onInit script
I wrote is firing. I've also used debug() to establish that I have the
correct hierarchy, but according to the onInit script, numpg_txt is
undefined. Is there a problem with a Xerte script utilizing components
in a .swf? I notice that in the default interface there is a current
page / total pages count -- is this a .swf/.fla and if so, is the .fla
available?
 
 
                    James McCleese
Technical Support Supervisor | Tier One Uverse
2Wire Services & Support
2Wire, Inc. Company Confidential.  The information contained in this
message may be privileged and/or confidential.  If the reader of this
message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you
are hereby notified that any dissemination, distribution or copying of
this communication is strictly prohibited.  If you have received this
communication in error, please notify us immediately by replying to the
message and deleting it from your computer.

________________________________

From: xerte-bounces at lists.nottingham.ac.uk on behalf of Dave Burnett
Sent: Thu 09/10/09 3:58 AM
To: Xerte list
Subject: RE: [Xerte] Page Templates - Interface Customization


> I can definitely try that change to the button, but what concerns me
more is when I attempt to pull rootIcon.CurrentPage to a dynamic text
box, I get an "undefined" value. Seems like my .swf can't find the
"rootIcon"...


It helped me with the swf relationship structure when I started to think
of it like a directory tree on a hard drive.

If you have any programming background, you know that C:\ is also
referred to as "root".
So if you think of the Xerte engine swf as "root", (rootIcon), loading a
swf into it is like creating another directory in C:\ or root.
So now I have C:\my_swf.

To have my_swf talk to anything in root, I have to add a direction to
look "up" a folder in the directory tree.
In DOS I would use ../my_swf, the ".." being shorthand for saying "look
up a directory from 'my_swf'", or "look in my parent directory".

Same as a loaded swf.
You have to tell the swf to look "up" a directory from where it is
(this), to it's parent (this._parent)

So if my_swf loads another swf, it's like creating another directory and
another level in the tree:

C:\my_swf\swf_loaded_by_my_swf
Another layer of depth in the tree, so for swf_loaded_by_my_swf to talk
to root, look up 2 directories:

this._parent._parent

HTH

Dave













________________________________

With Windows Live, you can organize, edit, and share your photos. Click
here. <http://www.windowslive.com/Desktop/PhotoGallery>  
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte


More information about the Xerte mailing list