Split a Main Application file

Hy, I have a question, is it possible to split a main application file into several others ?
So I have an application where I keep a few objects on my stage. Each object can do a lot of things and is linked with the others. Writing the script for each object will make my main application file hard to read. Can I somehow run the application from like 5 or 6 Flex Components or Flex Application files ? If so can you give me a little sample of code ?
I've tryed to add my objects on the stage from a component, but it doesn't work... I don't really understand them, they look like classes but they don't really act like ones...

Components or Modules, Components are much easier than modules, modules keep the main app smaller, but you do have to load them later.
What don't you get about components?
1. Create the component,
2. Register the component.
xmlns:MyCustomComponent="theDirectoryItsIn.*"
3. Use the component.
<MyCustomComponent:ComponentName/>
That's the MXML way.
If you do it in actionscript theres a bit more coding but not a whole more.
1. import your component
import theDirectoryItsIn.TheComponent;
2. Create an instance of it.
var idName:ComponentName = new ComponentName();
idName.x=10;
idName.y=10;
3. If you use FB4
this.contentGroup.addElement(idName);
if you use FB3
this.addChild(idName);

Similar Messages

  • Best Practice in regards to adding showing SkinnablePopUp from the Main application file of Mobile A

    Hello,
    I want to display a SkinnablePopUp when the user presses the back key when the current view is the first view to ask if he wants to quit.
    The logic (checking if the key pressed was the back key && the current view is the first view) is in the main application file and if those two conditions are true then the exit() method is called.
    I want to show the confirmation popup. Should I move all that in the first view mxml component or is it OK to instantiate the SkinnablePopUp in the main app file?
    Thank you.

    so do I, or did, well still do but less than before
    it seems best practice is to seperate mxml and AS3
    have a look at this
    http://tv.adobe.com/watch/max-2010-develop/flexactionscript-30-architecture-and-dependency -injection-frameworks-overview/

  • Calling a component from a the main.mxml file

    How do I call a component from a the main.mxml file?
    <mx:Button id="btnNew" label="Launch Component " click="getComponent()" />
    main.mxml (Has the button, that I would like to launch getcomponent.mxml)
    getcomponent.mxml (The file I would like to call) (This file also has the ViewStack)
    For some reasoning it's not seeing the bpVS(view stack id). I'm getting Access of undefined property bpVS error.
    <!-- Main.mxml  -->
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:components="components.*"
    width="100%"
    height="100%"
    minHeight="0"
    backgroundAlpha="0">
    <mx:Script>
      <![CDATA[                    
       private function getComponent():void{
        bpVS.selectedIndex = 1;
      ]]>
    </mx:Script>
    <!-- GetComponent.mxml -->
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:view="components.view.*">
    <mx:ViewStack  id="bpVS"
      top="69" left="180.5"
      width="100%" height="100%"
      resizeEffect="Resize"
      moveEffect="Move" showEffect="Fade"
      hideEffect="Fade">
    </mx:ViewStack>
    <mx:VBox id="vbTB" top="69" verticalGap="0">
    <mx:ToggleButtonBar
        id="payTB"
        direction="vertical"
        dataProvider="{bpVS}"
        width="180" useHandCursor="true" buttonMode="true""
        resizeEffect="Resize"
        moveEffect="Move" showEffect="Fade" hideEffect="Fade" >
      </mx:ToggleButtonBar>
        </mx:VBox>
    Thank you

    It won't see it just by creating the namespace that contains it.  There has to actually be an instance of it in the application.  So in your case, your main application file (lets call it MyApp.mxml) would look something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:components="components.*">
         <components:Main id="main"/>
         <components:GetComponent id="getComp"/>
    </mx:Application>
    Then, you can reach down (mind you this isn't best practice) into those components to access their public properties.  In a script block in MyApp.mxml, you could access the VBox with getComp.vbTB.
    I don't know the ins and outs of your application, but perhaps Main is the main application, so then you would add GetComponent as a child of it instead of both Main and GetComponent being child components of the MyApp application.  Does that clear up the confusion?

  • I don't want Adobe to open up and be selected immediately. I work with iPhoto and Ipages etc and preview which needs to be my main application for my work , but need adobe reader for other files... how can I do this please?

    I don't want Adobe to open up and be selected immediately. I work with iPhoto and Ipages etc and preview which needs to be my main application for my work , but need adobe reader for other files... how can I do this please?

    loopiloo1 wrote:
    I don't want Adobe to open up and be selected immediately.
    Sorry, I don't understand this - you don't want Adobe [Reader] not to open when doing what?  On what operating system?

  • How to split path and filename (file is on application server)

    Searching this forum I found a couple of FM's that apparently only worked for PC files.  Is there a parser function for files w/ the Unix naming convention?

    You could parse it yourself...
    DATA: filepath TYPE char255 VALUE '/usr/<sys_id>/sap/tmp/filename.txt'.
    DATA: path TYPE char255.
    DATA: file TYPE char255.
    DEFINE macro_reverse_string.
      call function 'STRING_REVERSE'
        exporting
          string  = &1
          lang    = sy-langu
        importing
          rstring = &1.
    END-OF-DEFINITION.
    macro_reverse_string filepath.
    SPLIT filepath AT '/' INTO file path.
    macro_reverse_string filepath.
    macro_reverse_string file.
    shift path right by 1 places. path(1) = '/'.
    macro_reverse_string path.
    WRITE:/ filepath.
    WRITE:/ path.
    WRITE:/ file.
    Regards,
    Rich Heilman

  • How can I put my main Application class in a package?

    Hello,
    I would like to put my main Application class for my air app inside a package. If I create a regular FLX application, this works fine. In that case I just move the application file created into a packade and change the run/debug settings. This does not work for an Air app however, when I try I first get the error:
    Adobe AIR application is missing the corresponding MyApp-app.xml
    So I move the MyApp-app.xml into the same package, then I get:
    Unknown error generating output application.xml files. Check the Eclipse error log for more details.
    Is it possible to have the man Application class reside inside a package for air applications?
    Regards,
    Mikael

    Hi Mikael,
    I ran into the same result as you so I asked around and it sounds like this might not be supported.  However, I'd recommend reposting this question over on the Flash Builder forums to see if anyone has found a workaround.
    Please let me know if you're able to resolve this.
    Thanks,
    Chris

  • How to contain a sub-component in the module instead of containing it in the main application

    Hi,
    I've 3 files
    Appln.mxml (application file)  ----  contains main application
    component.mxml (component file)  ----  contains component
    module.mxml (module file)  -----  contains module
    Generally the 'component.mxml' file will get loaded into the 'Appln.mxml' file (i.e., 'Appln.mxml' file will contain the custom component files) and whereas module file will get loaded on-demand.
    So Now instead of containing the data of 'component.mxml' file in the 'Appln.mxml',  I want to contain 'component.mxml' file data in the 'module.mxml' file itself and load the 'component.mxml' when module is loaded on-demand but not when application is loaded. So can any one please suggest me how to do it?
    Thanks in advance..

    Theo--
    You can delete software components & versions from the IR in XI 2.0.  (We're on Service Pack 5, and I've done it to clean up our IR.)
    Here is the process:
    1. Delete all configuration and/or import objects from the SCV.  Don't forget the 2 fault data types that SAP automatically creates in every namespace.
    1a.  Activate all change lists?  I don't remember for certain if this is needed here; if it won't let you save the deleted namespaces in step 2, then do this first.
    2. Double-click on the Software Component Version so that it comes up in the right pane.  Click on the change/edit button.  Delete all the namespaces from the SCV.  Save.
    3. Activate all change lists.  (It won't let you delete the SCV if you have uncommitted changes.)
    4. Open the SCV again (if it's not still open).  On the menu at the top of the right pane, go to Software Component Version...Delete.  You may or may not have to activate changes again.
    If I remember right, the software component will disappear automatically with the deletion of the last version.
    Hope this helps!
    --Dan King
    Capgemini

  • Calling a method in a component from main application

    Hi,
    I have a mxml component( menu1.mxml) . In the menu1.mxml
    there is a include for the actionscript file(menu1.as). In the main
    application page(SampleLogin.mxml) I want to call the method in the
    btnSubmit_Click() on the saveIndex() method for case 0. I am
    attaching all the code below

    case 0:
    menuOne.btnSubmit_Click( );
    break;
    Also it would probably be following best practices to used a
    custom event to pass the information in your "LoginButton_Click()"
    function to the application.

  • How to split H.264 video file then playback with FlashPlayer

    Hi all,
    I want to develope a Flash or Flex application that can stream a video file in H.264 codec.
    It's easy to do this with FMS, but it becomes difficult with my budget
    I have an idea to do the streaming (not really streamming ) via HTTP.
    My idea is: Split the large H.264 file into small pieces.
    The client can download the small files then play back in order. (MyVideo1, MyVideo2.dat.....MyVideoM.dat)
    The client first will download the metadata in XML format.
    The client is able to play/jumb to the middle stream, the client will start download from MyVideoM.dat...(1<=M<=N)
    My question is: How can i split my large Video file in H.264 codec in to smaller pieces (MyVideoN.dat) that flash player can play.
    Which is the minimum metada that i have to put into my small file so that FlashPlayer can understand my video files?
    Am i able to simply split the video file at serverside, then Client will inject the metadata into the downloaded small DAT files using Flash??
    Thanks for your support
    Binh Le

    Is there anyone out there can help me???

  • Help! - Tracks linked to application files, not my music !!

    Something very weird is going on here....
    I've got about 500 tracks that somehow are linked to application files. For example if I select "Show in Finder" it takes me to:
    Applications:iWeb.app:Contents:Frameworks:SFApplication.framework:Versions:A:Res ources:pt_PT.lproj:SFAppWarningsInspector.nib:keyedobjects.nib
    If it were just one or two tracks I'd clean it up manually, but I've got hundreds like this...
    Any ideas how to automatically relink these to the original files which still exist in my iTunes Music folder?
    Any idea how this happened in the first place? My only thought is that the library file may have been corrupted, but if so, how did the tracks wind up pointing to files inside an applications package?

    Should this be on the Flash forum?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "allprnt" <[email protected]> wrote in
    message
    news:frs2p2$gbl$[email protected]..
    > Hey,
    > I'm creating a website for a client that has a component
    scroll on the
    > main
    > stage linked to a dynamic text box with some buttons
    that when clicked
    > will
    > load an external file on Layer 1 of the main timeline in
    Flash. When I
    > tested
    > it in Flash it worked, when I previewed it in
    Dreamweaver it worked but
    > when I
    > uploaded it to the server. The main swf loads but the
    files that are
    > linked to
    > the main .swf don't
    >
    > On the first frame of the main time line I have the code
    below
    > loadMovieNum("movies/Thumbnail1_mc.swf",1);
    >
    >
    >
    > On each of th buttons I have the code below
    > on (release) {
    > loadMovieNum("Movies/Thumbnail1_mc.swf", 1);
    > }
    >
    > I have read some of the posts here but my main .swf file
    plays so its not
    > the
    > "scripts" folder in the wrong place.
    > and I'm pretty sure that it can't find the files due to
    my path to the
    > file,
    > but I'm not sure how to get the main .swf file to look
    for the Thumbnail
    > .swf
    > files on the server. Please help.
    >
    > Thank you
    >
    >
    >

  • Video Demo editing changes do not show in the main presentation file (CP7)

    A Video Demo can be edited eg splitting a clip and inserting an image.
    When this has been done you save the file and re-open your main presentation file (cptx file) and insert the Video Demo file.
    All great in theory except that all the above changes that I have made do not play in the cptx file.
    I have raked my brains to think what I could be doing wrong, even though I am new to Captivate.
    Has anyone else had this problem or could suggest what I could be doing wrong to cuase this?
    Many thanks.

    The only way that seems to work is to use the Edit Video Demo button in the Properties panel of the cpvc, when selected in the Filmstrip.
    The solution that Haridoss gave, maybe I understood your problem not well, was to save the cpvc-file with another name after editing, deleting the old cpvc-slide and inserting the new cpvc with the different name. Another workaround is to delete the cpvc file in the Video folder of the Library, previous cpvc-slide(s) will be empty, then insert again the cpvc-slide, but you also have to delete the empty slides.
    It is confirmed as a bug. Crossing my fingers that it will be solved soon.
    Lilybiri

  • Calling a function in main mxml  file from a component

    I have a main mxml file for an application.
    Within that file I have a viewStack with 3 components which
    are in separate mxml files.
    I have a function written in Action Script in the main
    application that I want to call from the 3 components.
    How is this done?
    Ta
    Mike

    Thanks for the help. I got it working using ntsiii's method
    (which is more straight forward but maybe not good practice?)
    though the line
    private var _appMain:Application = Application.application
    gave me the error message:
    1118: Implicit coercion of a value with static type Object to
    a possibly unrelated type mx.core:Application.
    So i changed it to:
    private var _appMain:* = Application.application
    Which made it work, I don't really understand why.
    Thanks
    Mike

  • App Signing Error, Number of Folios Does Not Match the Main Folio File

    Hi All;
      I have a 250 page standalone app that I am trying to compile for the Apple Store. I read through the forums and enabled "AppBuilderLoggingEnabled.cfg" in my user directory to capture the issue. Here is the snippet of the log that was created that, to me, shows why the app isn't being signed.
    46386 ERROR [main] codesign.Signer - Failure during signing
    java.lang.RuntimeException: invalid package, number of folios does not match the main folio file (Folio.xml or Issue.xml) 251-250
              at com.adobe.devtech.codesign.IPAOutputHelper.convertFolioProduceFormatToFolio(IPAOutputHelp er.java:272)
              at com.adobe.devtech.codesign.IPAOutputHelper.replacePlaceholderFolio(IPAOutputHelper.java:1 92)
              at com.adobe.devtech.codesign.IPAOutputHelper.execute(IPAOutputHelper.java:82)
              at com.adobe.devtech.codesign.Signer.sign(Signer.java:169)
              at com.adobe.devtech.codesign.Signer.processArgs(Signer.java:106)
              at com.adobe.devtech.codesign.Signer.main(Signer.java:46)
    46388 ERROR [main] codesign.Signer - Error: invalid package, number of folios does not match the main folio file (Folio.xml or Issue.xml) 251-250
    I've stripped out special characters from the article titles and re-built the app only to face the same error. I went ahead and created a new AppID in the Apple Developer Portal, created new provision files, and the error remains. I am now creating a new folio and importing the articles into the new folio to see if that will solve the "number of folios does not match" issue.
    Any help or insight would be amazing. Thank you all.
    -matt

    I created a new folio and imported all of the articles again. After hitting "Create App" for this new folio, at about 10 pages in a "PDF Export" error stopped the create app process. I went into InDesign to update the layout for the 10th page to see that the PDF export issue was stopping me from updating the layouts as well. Something in the InDesign file wasn't playing nice with the folio creation, so I created two new InDesign files, deleted the article, and built a new article from scratch. I was able to import the new layouts as a new article to the main folio and hit "Create App" again. This time there were no issues with the creation process. I synched up the provision files in App Builder and was able to code sign the application.
    I guess the moral of the story is to double and even triple check every article along the way to make sure there are no issues being introduced into the process that will ultimately cause headaches during the distribution phase of app creation!
    -matt

  • Load/Unload Component from Main Application

    I want to load in my main application 2 components. At this moment I load them with this:
    <components:loadProject id="loadPrj" visible="false" click="loadPrj_clickHandler(event)" verticalCenter="7" horizontalCenter="0"/>
    and I only set visible to true. Inside this component there is a canvas.
    But, is there any other way to do this using an AS class file? I would like to load/unload it on click, not only set true/false to visible.

    For dynamic creation and destruction of objects, you want to use ActionScript.
    So in your main app file, you might have a button that triggers a click handler that does this:
    private function myClickHandler()void {
                    var b1:CustomComponent = new CustomComponent();
                    var b2:CustomComponent = new CustomComponent();
                    /// Be sure to add them to the display list if they are visual components
                    myPanel.addElement(b1);
                    myPanel.addElement(b1);

  • Original application file Text search

    Hi DMS Gurus,
    we Have a common requirement of finding the DIR by using the word or sentence present inside the Original application file.
    can any one please let me know the complete requirement for this, is this feature inbuilt in standard DMS system using Content Server.
    I have did the basic configuration in  transaction code SKPR07).
    Enter the document class : DMS_PCD1.
    Select: Edit / Administration.
    A dialog box appears where the following data is preset,
    Document Area :  DMS
    Administration table: DMS1DIDSTA
    Class can be indexed:  X
    Set the indicator: Setup indexing.
    and MIME text type is already present for Word, Excel, Pdf, PPT file type in Standard.
    the Text search with original window appeared in CV04N but entering any text inside the Original it is unable to find the original.
    is there any other setting i have to make please let me know.
    Does this necessiates really installation of
    1) A new Trex server for this  process.
    2) can this Trex server be installed inside Content server
    points Awaiting .
    Thanks in Advance
    Kumar K

    Hi DMS Gurus and SAPIENS,
    Welcome to New Year 2009, Wish you all and your family a Very Happy Prosperous, Peacefull, and sucessfull New Year 2009.
    Like we all know any Word document in a PC or System can also be searched by giving the known Words in the file as the search criteria.
    why there is any 3rd Party software required to avail this feature, that too in DMS which mainly deals with external Documents.
    will be more happy if this can be achived with SAP-DMS standard funtionality or configuration.
    if Like the TREX server has to be Integrated with DMS Server as a stand alone server?
    will this be Completely Taken care by Basis or Functional involvement is required.
    Please Clarify.

Maybe you are looking for