Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Problem accessing public function in another module


Level 1
Hi there,

I have only started working with Flex 3 only couple of days
ago. I am a Delphi experienced programmer if that helps.

I have created a small Flex Project which contains 3 Flex
modules. The modules are not loaded as SWF files but with the

My modules are data-aware and they work fine on the first
change state. I am also able to update my data by pressing a

I have two big problems I hope you gurus could help me.

1. Is it possible to access a public function written in a
different module ? (Once again I state that I load the modules
using the <local:formname/>

2. Is it possible to execute an action when I change the
currentState because my script only fires only with the
creationComplete which triggers the first time.

my module code looks like

<mx:Module xmlns:mx=""
layout="absolute" width="780" height="560"
creationComplete="doInit()" >

public function doInit():void


rs = new HTTPService;












Thank you all guys and really really sry for being such a
n00b 😞 😞 😞 🙂 :(:(:(

2 Replies


Level 2
have you tried

<local:formname id="fn"/>

and then in your script this.fn.doInit() should work!

Do you have the event on which you're chaning the
currentState? If so, that would be place to add more logic.

For a more graceful solution of the latter take a look at the
enterState and exitState event of the State class.

By the way, are you sure why are you using 'modules' versus
custom components here?



Level 1
Hi again,

First of all let me thank you for taking you time with me...

I tried the id-thing unsuccesfully, I have uploaded my source
at mywebsite (
I hope you could take a look. Having said that 🙂 🙂 could you
plese provide with an example of how this.func() would work on
seperate states. Or an example how I can fire an event on change
state within the different module or how from the mail application
I can fire a function that resides within a module.

Feeling at 32 is a really bad feeling man 🙂 🙂

Plz help and thx again 🙂