Ask a Question related to Macromedia Flash, Design and Development.
-
John A Fotheringham #1
Constructor not invoked
I've created a class in ActionScript called OptionsPanel. It's
intended as a pop-up with some checkbox items on it.
In my code I invoke this as follows
this.attachMovie ("optionsPanel", "options_mc", 1);
and sure enough the panel appears. But... the panel appears only
as it has been created in the authoring environment. That is the
static components appear, but any attempt to add dynamic content
isn't happening. In particular the constructor doesn't appear to be
executed, and stranger still a trace of the options_mc doesn't show
any of the defined methods, or any fields added in the constructor.
I have other classes that work as expected, including a second
options panel which has only dynamic content added in the constructor.
This is weird because the requested movie *is* being displayed, but
it's as if the constructor and any other defined methods are
inaccessible. I have a "traceObject" method on _root that can be used
to examine objects. After the movie has been attached this fails to
show any of the functions of the class, or any properties that should
have been added in the constructor.
The panel class contains a CheckBox and a ComboBox. Both have
change handlers that get called okay. The movie consists of three
layers, and I found the change handlers had to be placed in
the same layer as the controls. The majority of the script is
in a dedicated "scripts" layer.
I read elsewhere it might be a naming issue, so I tried to rename
the panel with no success... besides, the panel is being invoked,
I just don't have access to it's methods (and hence) it's
dynamic data.
Could the placing of script in multiple layers be the problem?
Any help/pointers would be appreciated.
--
John A Fotheringham ("Jaf")
Purple turtles living in sin, doo dah, doo dah
John A Fotheringham Guest
-
#39457 [NEW]: Multiple invoked OO connections never close
From: josh at mykoala dot com Operating system: OS X 10.4.8 PHP version: 5.2.0 PHP Bug Type: MySQLi related Bug description:... -
Command Event in button being magically invoked.
Top of page: Listbox and button. Listbox contains a list of products. Button says "Load". Beneath both is a datagrid. In the datagrid, 25 columns... -
How to stop the webservice once invoked
Hi, I'm consuming my own webservice through a web page by using a button. So on button click my web service gets invoked and does a defined... -
Calling SUPER::constructor in the constructor
Is it possible to call the constructor that a function inherits from its parent? I tried calling SUPER:: and SUPER-> in a constructor and got... -
Getting the name of an invoked method?
Hello, In the C Ruby API, is there a clean way to get the name of the method which has been invoked? ie. If there is a single C function... -
John A Fotheringham #2
Re: Constructor not invoked
>Could the placing of script in multiple layers be the problem?
Okay, I'm answering my own question here. This was indeed the
problem. I removed the controls and change handler routines
from the "controls" layer and placed both into the "scripts"
layer. Having done that, the Constructor was called, and
I could see methods and dynamic data as expected.
Subsequent tests showed that only the script code needs to be
moved... you can leave the controls on a separate layer.
So placing some change handler code in a different layer seems to
have managed to "hide" all the class code placed in a different
layer (all this on frame 1).
Is this a bug or by design? If by design, can someone please
explain it to me.
This may relate to another problem I've been having, namely that
any components I add in the authoring environment statically
don't expose their methods (such as setValue etc), and refuse
to match all sensible "instanceof" tests. The only cure for
that I've found is to create all component objects dynamically
in the constructor, which is a little painful.
--
John A Fotheringham (Jaf)
Convert text files to HTML or RTF in seconds
[url]http://www.jafsoft.com/products/index.html[/url]
John A Fotheringham Guest



Reply With Quote

