Trouble accessing class from within components...


i started playing flex 2 last night , im pretty happy far, except im having problem accessing top-level variables , classes within custom components.

i have component, managetickets included in primary file support.mxml

in support.mxml have class setup this:

import myclasses.mysites;
public var mysite:object = new mysites();

now, whenever try access class within custom component, throws following error:
"1119: access of possibly undefined property mysite through reference static type class."

i have tried accessing (and few other ways no luck)
support.mysite.hello();
root.mysite.hello();


i have problem whenever set public variable in main file, , try access component.

thanks help!

well,
support.mysite.hello()
would work if mysite static variable of support, defined this...
static public var mysite:object = new mysites();

if support application file, , want set (non-static) property on component, believe want
application.application.mysite.hello();

i'd recommend typing mysite mysites object, rather generic object...
public var mysite:mysites = new mysites()
that'll let compiler know , members has.

rebecca hyatt
adobe


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support