Access the class from the loaded module

I have this in the main application and I the public variable test in the module. The problem is that I don't know how to access it properly.

public

var fontsModule:IModuleInfo;

public var FontsClass: Class;

public

function initApp(evt:FlexEvent):Sub

{

fontsModule = ModuleManager.getModule ("modules/fontsBG.swf");

fontsModule.addEventListener (ModuleEvent.READY, fontsLoaded);

() fontsModule.load

new ApplicationDomain (ApplicationDomain.currentDomain), null , null , moduleFactory);

}

public function fontsLoaded(evt:ModuleEvent):Sub

{

FontsClass = fontsModule.factory.create)

as Class;

          trace ()' HERE: "(+ FontsClass.test);". "

}

If I replace the class with the name of the 'FontsBG' class actions script in this example, everything would work, but the main swf file size goes from 100 to nearly 400 kbs when the fontsBG.swf file is 67 kbs. So I'm certainly not doing it right.

So the question is: what is the correct way of loading the modules and using their properties and functions - through the class or interface and how it's done? Please set up a small code example so I can get the concept of base as well as the readers of this thread.

Thank you!!!

(3) again, you will need to use a shared interface or a common base class.

Most people put the UI widgets in a module and they all extends UIComponent

You can reference them as UIComponents.  If they need to access other

Properties and methods, they define an interface.

(1) my guess is that the button does not know what a module with embedded

fonts loaded and don't refresh to use.  Normally, you would

wrap styles in the module with the fonts, and then set styleonce

the module is loaded.  In this case, you specify MyriadPro as the

CSS font family and he would set via setStyle once the module is loaded.

Tags: Flex

Similar Questions

  • Call or function of the class from a loaded MC

    Hello

    Can someone tell me if its possible to call a function or a class from a loaded MC?

    mainMovie charge MC > MC calls the function in a class of mainMovie

    If so, what is the best method?

    I tried this loaded MC but (of course) an error:

    movieClip (parent.parent). DO_THIS();

    Thanks for everything 'light' on this.

    Have the loaded SWF file send a custom event that spreads and listen to this event in the parent.

    In SWF loaded:

    dispatchEvent (new Event ("customEvent", true));

    Parent:

    addEventListener ("customEvent", handleCustomEvent);


    function handleCustomEvent(event:Event):void

    {

    do your stuff in the parent here
    }

    TS

  • Breach of Security Sandbox to access the service module remains localhost in the dev environment

    Our application has a "main" module with a link button, and clicking each button link load different modules in the main content area.

    So a single module, we get a Security Sandbox Violation when we try to do a post of several part of the image data.

    I can't find something different on this module, the other modules multipart posts fine.

    I added thre SWF and various files (for example containing the parent folder, etc.) to Flash Player global settings, but no luck. We have added a liberal area file but still no luck.

    BTW, we use ModuleLoader, we should ModuleManager?

    Help, please.

    Security Sandbox Violation
    Connection to

    http://localhost:PORTNUMBERHIDDEN / services/rest/mycompany/222/assetservice/asset? action = his veasset & objecttype = serviceOffer & objectid = 5960 & User-Agent = flex3.0 & randomNum = 1328144876976

    interrupted - not allowed to

    file:///C:/Perforce/main/Portal/main/bin-debug/serviceOffer-2.4.0.18-snapshot.swf

    I got the answer from this web post:

    http://StackOverflow.com/questions/1270347/unexpected-Flash-security-exception-when-using-URLLoader

    Instead of setting the contentType like this:

    request.contentType = ' multipart/form-data; limit ="+ POSTUploadBuilder.boundary;

    Set the contentType like this:

    request.requestHeaders.push (new URLRequestHeader ('Content-Type', ' multipart/form-data; limit =' + POSTUploadBuilder.boundary));

    Here's how to create the limit in my POSTUploadBuilder class:

    public class POSTUploadBuilder {}
    private static var _boundary:String = "";
    private static var _mainBoundary:String = "";
           
    public static void get limit (): String {}
    If (_boundary. Length == 0) {}
    var i: uint = 0;
    var len:uint = 0 x 20;
                   
    for (; i< len;="" ++i)="">
    _boundary += string.fromCharCode(0)) (uint (97 + Math.Random () * 25));
    }
    }
               
    Return _boundary;
    }

  • Failing of DataGrid Item Renderers, personalised in the loaded module.

    I'm an application that manages a lot of types of data records.  You can load the plug-in (in the form of swf modules) which provide additional models record and the views and editors for these record types.

    Above all, it works fine, except for a serious problem: wherever they are defined (inline, in the same file, the same swf or swc interface), any custom spark grid point motors which are used in the loaded views or editors cause my application crash when running.  Oddly, my DataGroup element converters seem to be the same problem, so far.

    I've found a workaround.  In other words, if I fix the rendering engine when running, creationComplete and refer to this renderer in the main application, then it works fine.  However, it's a bit of a pain, if one of my plugin writers want to use a custom grid element converter I have has not planned in advance.  I really want a way for my plugin-developers being able to define new renderers, if necessary.  Clues on how to address this problem?

    Here is the the crash stack trace:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    to spark.components::Group/addElement() [E:\dev\4.5.1\frameworks\projects\spark\src\spark\com ponents\Group.as:1342]

    to spark.components.gridClasses::GridLayout/createTypicalItemRenderer() [E:\dev\4.5.1\framewo rks\projects\spark\src\spark\components\gridClasses\GridLayout.as:748]

    to spark.components.gridClasses::GridLayout/updateTypicalCellSizes() [E:\dev\4.5.1\frameworks \projects\spark\src\spark\components\gridClasses\GridLayout.as:883]

    to spark.components.gridClasses::GridLayout/measure() [E:\dev\4.5.1\frameworks\projects\spark \src\spark\components\gridClasses\GridLayout.as:444]

    to spark.components.supportClasses::GroupBase/measure() [E:\dev\4.5.1\frameworks\projects\spa rk\src\spark\components\supportClasses\GroupBase.as:1148]

    at mx.core::UIComponent/measureSizes() [E:\dev\4.5.1\frameworks\projects\framework\src\mx\cor e\UIComponent.as:8496]

    at mx.core::UIComponent/validateSize() [E:\dev\4.5.1\frameworks\projects\framework\src\mx\cor e\UIComponent.as:8420]

    to spark.components::Group/validateSize() [E:\dev\4.5.1\frameworks\projects\spark\src\spark\c omponents\Group.as:1012]

    at mx.managers::LayoutManager/validateSize() [E:\dev\4.5.1\frameworks\projects\framework\src\ mx\managers\LayoutManager.as:665]

    at mx.managers::LayoutManager/doPhasedInstantiation() [E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:792]

    at mx.managers::LayoutManager/doPhasedInstantiationCallback() [E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]

    In fact, I thought that this outing yesterday, but apparently you forgot to answer.

    The problem you are having has to do with modulefactory.  Components of a

    module must have their moduleFactory the value of the module.  This is done

    If you use the on the factory's create() method, or you can assign

    later if you want.

    -Alex

  • Help with buttons to access the loaded layers

    Hi all... Using Flash CS3 and AS3 to build a learning module that loads different layers of SWFs of the buttons on the main screen.  Got this work without problems.  What I want to do is to add buttons to provide learners of features, specifically a next button, the "back" button and a check box that will keep progress automatically.  I did some massive research and so far nothing seems to work.  Seems like I am going so far is the main layer, not the new layers as they are loaded.  Here is what I tried with the back button; the next button uses nextFrame and Handler2.  It does not work.  Not even sure how to start with the check box for advance auto.  Any help would be GREATLY appreciated.

    Mark

    back_btn.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler1);

    function mouseDownHandler1(event:MouseEvent):void

    {

    MovieClip (root) .prevFrame ();

    }

    If you try to get the swf loaded in advance and not the main timeline, you need to target the loader.content, not the root, as in:

    MovieClip (loader.content) .nextFrame ();

  • How do I access the Publisher module

    Does anyone know if the Editor module is exposed to Extendscript FM (FDK)? I looked through all the news script and config files, .h and FDK info and couldn't find any references to him other than the command TPUBforFMDoc (book/DITA esc ph a shortcut). I need to start the module for publication after a few manipulations and use a STS file specified according to the manipulation.

    Thanks to Adobe engineering team in India, here is an example script shows how to call the client FMPublisher by using a predefined STS file to generate one of the Reagents HTML5, WebHelp, ePub, Kindle or CHM output:

    /***************************************************************************************** Function to set STS *************************************************************************

    Input 1:-path of meshes to determine (if the path contains slashes to the rear, each character slash must be masked with a slash)

    for example stsPath = C:\\Users\\username\\Desktop\\settings.sts*/

    function SetSts (stsPath)

    {

    var strCommand = "SetMCPSetting" + stsPath;

    var ret = CallClient ("FMPublisher", strCommand);

    return ret;

    }

    / * Function to set the LOCATION of OUTPUT of DATABASE publishing *.

    Input 1:-Base to build output path (if the path contains slashes to the rear, each character slash must be masked with a slash) * /.

    function SetBaseOutputLocation (outputPath)

    {

    var strCommand = "SetOutputLocation" + outputPath;

    var ret = CallClient ("FMPublisher", strCommand);

    return ret;

    }

    /*********************************************************************** Function to Publish *******************************************************************************

    Input 1:-Base to define output path (output parameter is one of the following values: WebHelp, Microsoft HTML Help, EPub, Kindle, Responsive HTML5) * /.

    function PublishOutput (output)

    {

    strCommand = "MCPPublish" + output;

    var ret = CallClient ("FMPublisher", strCommand);

    return ret;

    }

    function doGenerateOutput()

    {

    var stsPath = "C:\\Users\\username\\Desktop\\Settings.sts";

    outputPath = "C:\\Users\\username\\Desktop\\Output"; var

    var output = "Responsive HTML5";

    SetSts (stsPath);

    SetBaseOutputLocation (outputPath);

    PublishOutput (output);

    }

    doGenerateOutput ();

  • Satellite C50-B-13D - how do I access the memory module

    Hello

    I can't find a guide around here and said Toshiba laptop support site can have maximum of 8 GB of memory, that I bought but can't see an access panel and don't really want to go unscrewing things without knowing the exact procedure!

    Thank you

    Hello

    The Satellite C50 - * B * series doesn t contain more memory cache-location at the bottom of the device as C50 - A Satellite and others usually do.

    So it's not possible to upgrade with the RAM without voiding the warranty.
    From my point of view of the rare such upgrade must be performed by authorized engineers.

    However, if you n t care about the warranty, you can see videos from youtube showing the instruction how to remove the bottom cover (search + Toshiba Satellite Pro C50 - B disassembly +)

  • Difficulty accessing the loader program

    My lightroom was working fine 1 minute then it shut down by itself and now I can't open more. It says error reading the preview cache.

    Hi Cherished_Memories

    Greetings!

    You must remove the preview for your Lightroom Catalog Cache.

    It is located in the same folder as the catalog in Lightroom. The name of the cache an extract ends with Previews.LRDATA and should be deleted. Not to be confused with *. LRCAT, which should not be deleted. Here is a picture of what it is named as default LightroomcatalogPreviews.Lrdata.

    Location /Pictures/Lightroom on Mac and my Pictures\Lightroom on Windows Pictures/Lightroom on MAC

    Delete this folder and restart Lightroom

    Let us know if this helps

    ~ Assani

  • How to access the BPM 11 g load useful or process varibles in the workflow of ADF

    I'm trying to view/edit the data in a user interface that is linked to a database by using a foreign key, requestId. The foreign key comes from a BPM process where it is spent in the workflow, a human task. The foreign key comes process variables or values of payload. I know that I can simply load the payload in BPM with the data in the tables, but I'm looking for a better solution use the ADF business components to view and edit data directly in the user interface.

    The BPM process uses a web service to start the process. Web services takes a primary key as a parameter to reference a column in the database table. The data is pre-filled with content and a primary key reference. The first activity is an activity of the user. I want the workflow behind the user activity to accept this primary key and use to locate the line in the database, so related views of the database delimited ADF business components can work to present the data in the user interface.

    I tried two approaches to the problem. The first uses the setCurrentRowWithKeyValue operation. The other changes the SQL where clause, used by the ADFbc iterator only returns one row for the given requestId. Both of these approaches fail to work because I don't know how to access the load BPM or variable data entering the workflow. Here is the piece of code that I used to try to define the row using the value of setCurrentRowWithKey:

    public String setRequestId() {}

    FacesContext context = FacesContext.getCurrentInstance ();
    Object requestObj = context.getApplication () .evaluateExpressionGet)
    context, "#{bindings."(, Number.class) RequestId.inputValue "};
    If (requestObj is nothing)
    Returns a null value.
    RequestId number;
    requestId = (number) requestObj;

    ITR DCIteratorBinding = (DCIteratorBinding)

    getBindings () .get ("PatfRequestHdrView1");

    itr.setCurrentRowWithKeyValue (requestId.toString ());

    Returns a null value.

    I didn't get very far with the second approach, change SQL where clause, because I do not know Groovy. I think I need something like:

    adf.object.viewObj.RequestId. but it is not a viewObject associated with BPM data, so I don't know that this particular expression will not work.

    Any help you can give me is greatly appreciated.

    Kind regards
    Mark

    Try this code in your method:

    FacesContext context = FacesContext.getCurrentInstance ();
    String ctx = (String) context.getApplication () .evaluateExpressionGet (context, "#{pageFlowScope.bpmWorklistContext}", String.class);
    String tskId = (String) context.getApplication () .evaluateExpressionGet (context, "#{pageFlowScope.bpmWorklistTaskId}", String.class);
    IWorkflowServiceClient workflowSvcClient = WorkflowService.getWorkflowServiceClient ();
    ITaskQueryService wfQueryService = workflowSvcClient.getTaskQueryService ();
    IWorkflowContext wfContext = wfQueryService.getWorkflowContext (ctx);
    Task myTask = wfQueryService.getTaskDetailsById (wfContext, tskId);
    XMLElement xmlPayload = (XMLElement) myTask.getPayloadAsElement ();
    get the payload as a string simple, useful for debugging
    java.io.StringWriter writer = new java.io.StringWriter ();
    xmlPayload.print (writer);
    String payloadAsString = writer.toString ();
    extract payload values: use methods in Oracle XDK

    See also this post:

    The task of reading by program details

  • How to access the modules using the script?

    Hi can someone help me how to link to the module using script if you have ideas to share with the me...

    Thanks in advance

    (There are two ways to load the modules, 1) ModuleLoader class component ModuleManager 2).

    The ModuleLoader component's mxml, so I will not provide an example.

    The ModuleManger class is for loading modules via actionscript.

    Here is a link to resources on the loading of modules as well as the code example.

    http://help.Adobe.com/en_US/Flex/using/WS2db454920e96a9e51e63e3d11c0bf64277-7ffd.html#WS2d b454920e96a9e51e63e3d11c0bf69084 - 7 d 20

    -Darrell

  • get the Application Module during the invocation of Taskflow delimited

    Hello dear developers,

    I have a filter that maps just before the Faces Servlet and fill some attributes in the HttpSession before it proceeds with the request

    [...]

    If (_clientUser! = null & &! _clientUser.isEmpty ()) {}

    session.setAttribute (CLIENT_USER_URI_PARAM_NAME, _clientUser);

    filterChain.doFilter (servletRequest, servletResponse);

    return;

    }

    [...]

    There are some practical information for which task flow should be addressed within the URI,

    faces/ADF. Task-Flow? ADF.tfId = Task-Flow-Definition-ID & adf.tfDoc=/WEB-INF/task-flow-definition-id.xml

    After I continue the application there is a method call within the bounded workflow that is called before the display (allows to call the current view), making it default business

    [...]

    activity < default > doStuff < / default activity >

    [...]

    The method itself is in a Managed Bean PageFlowScoped, which is added to the task-flow-definition - id.xml

    This is the method that is called before the "MainPage"-view of doStuff ".

    public class {controller

    [...]

    public void doStuff {}

    FacesContext ctx = FacesContext.getCurrentInstance ();

    Card sessionMap = ctx.getExternalContext () .getSessionMap ();

    String clientUser = (String) sessionMap.get (CLIENT_USER_URI_PARAM_NAME);

    AppModImpl am = getApplicationModule();

    DBTransaction transaction = am.getDBTransaction ();

    do more things

    }

    [...]

    }

    public AppModImpl getApplicationModule() {}

    FacesContext fc = FacesContext.getCurrentInstance ();

    Application app = fc.getApplication ();

    ExpressionFactory elFactory = app.getExpressionFactory ();

    ELContext elContext = fc.getELContext ();

    {ValueExpression valueExp = elFactory.createValueExpression (elContext, "#{data.", Object.class "}") AppModDataControl.dataProvider};

    AppModImpl m = valueExp.getValue (elContext) (AppModImpl);

    am back;

    }

    Everything works well so far. But if I try to get the Module of the Application. There is not.

    This app normally isn't any what DataControl, because is just a root application which different components of blocks that have been added by ADFLibrarys, but I added a DataControl to the DataBindings.cpx and an iterator for the MainPagePageDef (just to understand a DataControl in links) but still no result.

    Do you have any tips for me how I can access the application Module? FacesServlet should have been already created the necessary FacesContext managed Bean is called at the moment or it only creates a new FacesContext time a real (jspx/jsf) Page loads?

    Yours,

    Matthias Schnell

    I got a response:

    Here is the block message that has helped me to understand.

    Andrejus Baranovskis Blog: How to fix error of initialization of the control Data with the ADF libraries

  • Using a GUI API I got on the blackberry site - error: "tried of BlackBerry to access the api secure."

    Hello
    This is so the API, I downloaded and imported into my project->
    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

    When I run it, I get "Error trying to access the api Module secure"

    It says its taken in charge for OS 4.2 and I think, so execute me on my blackberry 9900 OS 5 should work,
    I've been on these forums before and after the solutions, I ordered the signature of the key codes and signed the project as well.

    This is what appears in the signature box, just code until I run it:

    It compiles without error, but it still does not work.
    What I'm doing wrong exactly? Any help would be appreciated!
    Khalique - Amina

    Hey everybody,
    Anyone else who has this problem with these particular CBC of the advanced downloadable user interface files.
    Make sure the following is in place.

    Your JRE version is important.
    If you test on a device that is older than 7.1

    Change your JRE in a right click on the JRE and selecting the right JRE for your device. [some of you may need to download the right JRE].
    I installed the plugin for eclipse blackberry, so he automatically gave me all the available JRE. I just had to change.
    After that I changed it, I have not the reddest comments when I signed the code.
    AND
    It worked fine, no error message popping up for ' api access blocked attempts to.
    If anyone has questions and is the same problem. Please ask. I've spent hours on it, and I'd be happy to help you if I've been unclear!
    Take care!

  • Determine the width of the loaded clip

    Hi all
    Is there a way I can get and set the width and height of a loaded clip? I created a movie then loaded and empty empty a small swf file in the film with loadClip. I now want to determine the width and height of the loaded clip and it adapts to the size of my movie dimensions. Is this possible? Although the film load fine and I can position its x and y coordinates, the width and height show as zero.

    Can someone help me with this one? I use Flash Professional 8.

    Thank you
    Brayne

    You must wait until loading is completed to access the loaded SWF _width and _height. and then you'll see the _width and _height of objects on stage in the first image if you access these properties as soon as the SWF is initialized.

  • Capture mouse of a loaded module events.

    I defined a module and have had the coordinates of the mouse (through mouse events) are updating the variables that may be related, public in the module itself.

    In the parent app application (that loaded the module), I want to display the address of the loaded module as it moves.

    As I said, I'm close, where I capture and manage the move event in the module itself, I just need to access this info from parent app, etc...

    Any help is appreciated.

    -fd

    not that it matters now, but I thought about it.

    Thanks anyway...

    -fd

  • Access the current instance of request module in a java class in the model

    Hi all
    I'm trying to implement the custom story types in our application, (ModifiedById), I can read the user name of the security context, but not the username.
    I have a view object, say UserInfoVO which contains the logged in users info.
    I know, I can create a new instance of the application at the bean module and using security context information, I can go get the user ID.
                ApplicationModule am =
                      Configuration.createRootApplicationModule(amDef, config);
                    ViewObject vo = am.findViewObject("UserInfoVO1"); // view criteria applied by default
                    vo.setNamedWhereClauseParam("bUserName", user); // user from security context
                    vo.executeQuery();
    I'm trying to access the current instance of the Application module in my java class customized, that is used to return the attribute history ModifiedById.
    //referring the blog
    
    http://jobinesh.blogspot.in/2011/02/creating-custom-history-types.html
    It is, how do I access the current instance of ApplicationModule in a class as * "HistoryAwareEntityImpl" * located in project template. ?

    any help will be appreciated.

    Kind regards
    Rognard

    OK, in this case, you get the transaction of db of the base class object and this object allows you to search the module of the application

    public final DBTransaction getDBTransaction();
    ...
    DBTransaction:
    public ApplicationModule findApplicationModule(java.lang.String amName)
    

    or if you get the application root module

    public ApplicationModule getRootApplicationModule()
    

    Timo

Maybe you are looking for