I don't post here often (still very much learning!) but I'm trying to
make a Module component that has all the core navigation I'll call it,
as I have many Modules that I want to load over various conditions.
I'm running into this kind of error below A LOT, with this and other
things, in the debugger:
ReferenceError: Error #1069: Property leftCan not found on Main and
there is no default value.
at Main/shrinkLeft()[D:\workspace\modulelayout\Main.mxml:18]
at Main/__leftButClosed_click()[D:\workspace\modulelayout\Main.mxml:44]
I don't seem to be able to reference IDs, and other things such as
properties, variables, entire functions and the like from modules when
in the main app, and vice-versa, sometimes yes, sometimes no.
I always import Application
(Application.application.whateverYouWantToGrab) but often my items
still don't show up in the contextassist helper.
I think the answer lies partly in creating something that holds all my
public functions and variables, and from there initializing them when
the app loads on creationComplete, but I rally have no idea how to do
that.
Could someone please offer me some suggestions? In this case, I'd like
to be able to use not <mx:Module etc> but something like
<shawn:myModule etc> which has all the nav elements I want available
to all modules.
The nav elements themselves work perfectly (they'd better, it's really
simple stuff right now! LOL) when I include everything in one Main app
and no Module loading...
For example, here's my code for this, the scripting, which is in the
main app, not the module:
<mx:Script>
<![CDATA[
import mx.events.ModuleEvent;
import mx.modules.*;
import mx.core.Application;
import mx.events.ModuleEvent;
public function initFrames():void{
resetFramesBut.visible=false
leftButClosed.visible=true;
Application.application.bottomCan.percentWidth=100;
}
public function shrinkLeft():void{
Application.application.leftCan.percentWidth=0;
Application.application.rightCan.percentWidth=100;
resetFramesBut.visible=true;
leftButClosed.visible=false};
public function shrinkBottom():void {
Application.application.bottomCan.percentWidth=25
Application.application.rightCan.percentHeight=100;
};
public function framesReset():void{
Application.application.leftCan.percentWidth=25
Application.application.rightCan.percentWidth=75;
resetFramesBut.visible=false
leftButClosed.visible=true};
]]>
</mx:Script>
Any help would be greatly appreciated...
Shawn Gibson