How to separate embedded ActionScript from MXML

Hi all,
I need to separate the embedded ActionScript codes located in
between <mx:Application> tags (inside MXML). I need to
do this, becuse it will help me to simplify my job.
The embedded ActionScript code looks like this:
<mx:Script>
<![CDATA[
private var services:RemoteObject;
public function initApplication():void
services = new RemoteObject("GenericDestination");
services.source="com.mydomain.Services";
services.authorizeAccessTicket.addEventListener(ResultEvent.RESULT,
loginResultHandler);
]]>
</mx:Script>
Once I taked the whole codes, and placed inside a class
called Main.as and refere this class inside <mx:Application>
as following:
<mx:Script source="Main.as" />
I got the following error: 1037: Packages cannot be nested.
Main class looks like this:
package
import mx.rpc.remoting.RemoteObject;
public class Main
private var currentUser:User;
private var currentAccessTicket:AccessTicket;
private var services:RemoteObject;
public function Test()
services = new RemoteObject("GenericDestination");
services.source="com.mydomain.Services";
services.addEventListener(FaultEvent.FAULT, faultHandler);
services.authorizeAccessTicket.addEventListener(ResultEvent.RESULT,
loginResultHandler);
What I have to do in this case?

You made your included file a class. Instead, you want to put
into your included AS files EXACTLY what appears in the
<mx:Script> block (without the CDATA). From your example, the
external AS file would start with private var services:RemoteObject
and not with package and class information.

Similar Messages

  • How to separate perticular column from multidimensionl array

    dear all,
    i am just reading CAN bus message, problem is that it is accomodated in a 11X7 array which includes frame time stamp, ID, byte length etc but i am interested in CAN data. can anybody tell me how to separate that column from all. i want to read a column of 5 with all rows. how it is possible.

    Hello Sanjay,
    If your requirement is simply to obtain a single column from a 11x7 array, I would suggest you should do the following:
    1. Use Transpose 2D array to obtain a transposed array
    2. Use Index Array function to retrieve invidual row (which is actually the column of non-transposed array).
    Use index value of 4 (zero indexed), and the output would be a 1D array containing all elements of column 4 (zero indexed) of the original array.
    I hope this helps.
    Regards,
    Navjodh

  • How to separate content area from the image area in cs6

    how to separate content area from the image area in cs6? looks just fine in design view but when opened up in explorer my text /content area is over the image area. the content is suppose to be below the image not over it. How do I move it down? Everything I have tried has not worked ;(

    Is your image in the CSS (background) or the HTML (foreground)? 
    Try copying and pasting this code into a new, blank document.  Change placehold.it images to your own.  Save and preview in browsers.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with CSS 2-Col Layout</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <![endif]-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <style>
    /**CSS Reset**/
        padding: 0;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    img {
        width: 100%;
        vertical-align: baseline;
    /**Layout**/
    body {
        padding: 0;
        width: 90%; /**adjust width in px or % as desired**/
        margin: 0 auto; /**this is centered**/
        background: #CFF;
        color: #505050;
        font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
        font-size: 100%;
        box-shadow: 2px 2px 4px #333;
    header {
        margin: 0;
        padding: 0 1%;
        width: 100%;
        background: #B00202;
        color: #FFF;
    /**top menu**/
    nav {
        background: #EAEAEA;
        font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 14px;
        font-weight: bold
    nav ul {
        margin: 0;
        padding: 0;
    nav li {
        list-style: none;
        display: inline-block;
        margin: 0 3% 0 5%;
    /**menu link styles**/
    nav li a {
        color: #666;
        text-decoration: none;
        line-height: 2.5em;
        padding: 6px;
        border: 1px solid #CCC;
    /**on select or mouseover**/
    nav li a:hover, nav li a:active, nav li a:focus {
        background: #CCC;
        color: #505050;
    #wrapper {
        background: #EAEAEA;
        overflow: hidden; /**float contaiment**/
    /**main content**/
    article {
        padding: 0 2%;
        background: #FFF;
        float: left;
        width: 70%;
    figure {
        width: 80%;
        margin: 4% auto 4% auto;
        text-align: center;
    /**right sidebar**/
    aside {
        padding: 0 2%;
        float: left;
        width: 30%;
    footer {
        clear: both;
        background: #B00202;
        color: #FFF;
        text-align: center;
        margin: 0;
    /**typography**/
    header h1, header h2 {
        display: inline;
        color: #F5DD83;
        padding: 0 1%;
    h3 {
        color: #2294AE;
        margin-bottom: 0
    p { margin: 0 0 1em 0 }
    figcaption {
        text-align: center;
        font-style: oblique;
        font-size: small;
        color: #2294AE;
    </style>
    </head>
    <body>
    <!--begin header-->
    <header> <h1>Sitename</h1>
    <h2>|  Responsive CSS Layout</h2>
    </header>
    <!--begin navigation-->
    <nav>
    <ul>
    <li><a href="#">Menu Item1</a></li>
    <li><a href="#">Menu Item1</a></li>
    <li><a href="#">Menu Item1</a></li>
    <li><a href="#">Menu Item1</a></li>
    <li><a href="#">Menu Item1</a></li>
    </ul>
    </nav>
    <div id="wrapper">
    <!--begin main content-->
    <img class="banner" src="http://placehold.it/1056x100/198EBA/FFFFFF&text=Banner.jpg" alt="banner" />
    <article> <h3>Article</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Mauris vitae libero lacus, vel hendrerit nisi!  Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus.  Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius. Quisque varius scelerisque nunc eget rhoncus.  Aenean tristique enim ut ante dignissim. </p>
    <figure> <img src="http://placehold.it/500x325" alt="placeholder">
    <figcaption>Figure 2 Caption</figcaption>
    </figure>
    </article>
    <!--begin right sidebar-->
    <aside> <h3>Aside</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Mauris vitae libero lacus, vel hendrerit nisi!  Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus. </p>
    <hr>
    <p>Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius. Quisque varius scelerisque nunc eget rhoncus.  Aenean tristique enim ut ante dignissim. </p>
    <hr>
    <p>Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius. Quisque varius scelerisque nunc eget rhoncus.  Aenean tristique enim ut ante dignissim. </p>
    </aside>
    <!--end wrapper--></div>
    <!--begin footer-->
    <footer> <small>© 2014 Your Site Name. All rights reserved</small> </footer>
    </body>
    </html>
    Nancy O.

  • How to separate BPM 11g from ADF

    Hi all,
    we are facing with a huge issue about how to separate BPM 11g ADF Task page components from SOA/BPM to a new non-soa ADF managed server.
    We are ready to move on pre-production server from development enironment and the new environment has two different servers, one for Soa/Bpm and the second for a non-soa ADF server.
    We have deployed all and it seems work fine but...when we call:
            SecurityContext securityContext =  ADFContext.getCurrent().getSecurityContext();
            String username = securityContext.getUserName();
    got: username  = anonymous.
    Tried with this also:
                 String userName = "";            
                //read name from security context
                ADFContext adfCtx = ADFContext.getCurrent();
                SecurityContext secCntx = adfCtx.getSecurityContext();
                userName = secCntx.getUserName();      
                //read name from bpmWorklistContext context
                FacesContext context = FacesContext.getCurrentInstance();
                String ctx = (String)context.getApplication().evaluateExpressionGet(context, "#{pageFlowScope.bpmWorklistContext}", String.class);
                IWorkflowServiceClient workflowSvcClient = ADFWorklistBeanUtil.getWorkflowServiceClient();
                ITaskQueryService wfQueryService = workflowSvcClient.getTaskQueryService();
                IWorkflowContext wfContext;           
                try {
                    wfContext = wfQueryService.getWorkflowContext(ctx);
                    userName = wfContext.getUser();
                    logger.info("UserName from Oracle:" + userName);
                } catch (WorkflowException e) {
                    logger.info(e.getMessage());
                    e.printStackTrace();
                return userName;
    And received this error:
    "Oracle | Invalid Token Error in Verification Service.
    Invalid Token Error in Verification Service. Received invalid token in .
    Verify that correct token is passed."
    I have followed this blogs but no luck:
    Onkar's SOA, BPM and ADF Blog: How to separate BPM 11g ADF Task page components from SOA/BPM to a new ADF managed server
    http://blog.dreamix.eu/oracle-2/ultimate-guide-separating-bpm-adf
    Notes about Oracle: How to configure local integrated WebLogic non-SOA domain to access BPM worklist on separate SOA-ena…
    I do not understand where the error is. Why the SecurityContext is getting lost.
    Can you help me? Any suggestions will be welcome.
    Thanks.
    Fairlie

    Ok, these are the lines of code you can use to create a method that returns the authenticated user name:
    try {
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    } catch (Exception e) {
    e.printStackTrace();
    And you can add it to the backing bean of your page (a Java Class that you can declare to handle ADF Page components). Let me know if this helps.
    Jorge

  • How to separate users account from team agent in ios developer account?

    Hi everyone,
    I have bought ios developer program for individual (99$).
    But I didn't remember that my apple id still was registered with another team agent. So I want to separate my account from team agent, but I can't. I try to delete my apple id from team agent, then I can't log in itunesconnect.apple.com. It says "Apple ID does not have permission to access iTunes Connect."
    So what should I do now?
    Is there some how to fix this problem or change apple id in ios billing info or refund the billing?
    Please help me!
    Sorry for my bad English!

    Go to the Mail page at http://icloud.com and create a new Mailbox. The click on the cogwheel icon at top right and choose 'Rules'. Create a Rule to move all messages addressed to the alias to the new Mailbox. This Mailbox will appear on your devices and you can select it to see the messages to the alias.

  • HOW TO separate CSS,JS from psp

    HI,everyone
    I'm reading the <<Learning Oracle PL/SQL>>,hava a question,I want to separate CSS,JS from HTML.
    like others use 'import' or 'include' or <script src="test.js"/> etc.
    I don't know where to put external file(css,js),procedure can access,please advise!Thanks!!
    Best regards:mengzhihai
    My Work environment is follows:
    Oracle 9i Database
    Apache HTTP Server
    Mod_PLSQL Apache Plug-in

    This looks like an apache configuration question. First, locate the apache configuration file 'httpd.conf', which is usually under 'ORACLE_HOME/apache/apache/conf/'.
    Method 1: Create a 'scripts' directory under your document root; put the static JS files in there, and reference it using the url '/scripts/myfile.js'. To locate your document root, search for the keyword 'DocumentRoot' in the 'httpd.conf' file. My one reads :-
    -- BEGIN SNIPPET --
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "C:\Oracle\Ora92\Apache\Apache/htdocs"
    -- END SNIPPET --
    Create a directory c:\oracle\ora92\apache\apache\htdocs\scripts\.
    Place your script 'myfile.js' in that directory.
    Reference it like this :-
    <SCRIPT LANGUAGE="JavaScript" SRC="/scripts/myfile.js"></SCRIPT>
    Method 2: If you do not want to put your application scripts in the document root, you can configure apache to map a virtual url (such as '/scripts/') to a physical directory somewhere else, like this :-
    Alias /scripts/ "D:\mycompany\myapplication\scripts/"
    You need to make sure apache has os file permissions to access the files.
    Tak

  • HT201320 How to separate my business from personal emails?

    I want to separate my business from personal emails. I want to set up another email address. In Linkedin I couldn't use the one I have to set up a company page because it's already associated with my personal Linkedin accoung. Can I create a second email address with my business name? Linkedin wouldn't excepted the .mac.com address. Thanks for your help!

    Any new iCloud account will be assigned an @icloud.com address at this point.  If LinkedIn will accept this, you can create a second iCloud account on your device by going to Settings>Mail,Contacts,Calendars>Add Account>iCloud.  However, mail synced with a "secondary" iCloud account like this will only be fetch, as push is only supported in the primary account.
    Otherwise, you'll have to set it up using another email provider like Gmail.

  • Urgent- How to separate bad records from load and put into a separate table

    We have an error handling requirement in ODI 11g from the client that whenever a bad record is encountered the execution flow shud not stop rather it shud separate those records into an error table so that at the end of the load we shud be left with all the records (except bad records) in the target table and those bad records shud be there in a separate error table.
    The definition of the bad records may include the size of a column or datatype mismatch between source and target table. How to implement this error handling strategy in ODI or is there any out of box solution that we can leverage Please Help.
    Thanks & Regards,
    SBV
    Edited by: user13133733 on Dec 23, 2011 4:45 AM

    Hi SBV,
    Please find my responses below,
    I have tried the steps suggested, however i have some doubts:
    1. What all data exceptions (e.g. primary key constraint violation etc.) are covered in this mechanism?Yes you can handle PK,FK, Check constraints violations etc., using CKM.
    2. If there is a column size mismatch between source and target table will this work? (I think not because i tried it and it'll give error before populating the I$ table, because I$ is created according to the source).
    You are right column size mismatches will not be captured as a part of default CKM property.
    Also i am getting an error in the creation of SNP_CHECK_TAB step. In my case ODI is by default making a query like "create table .SNP_CHECK_TAB" , now this dot (.) before SNP_CHECK_TAB is making it an invalid table name and hence this step is a warning (not an error), but in the next step (delete previous checksum) it is throwing an error as this step is also looking for .SNP_CHECK_TAB table which is not there.
    Please help me where the issue lies. I have NO idea why it is making that query by default I have freshly impoted the CKM Oracle and used it.
    This is coz there is no DEFAULT physical schema not defined at your target data server.
    Go to, Topology Manager-> Phy architecture -> <Your Technology>-> <Your target data server>-> expand, open up your physical schema and check DEAFULT.
    Thanks,
    Guru

  • SoundBlaster Omni - How to separate Line In from Mic Array in Win 8.1?

    In Windows 8.1, in Control Panel, under Sounds, the Line In is disabled when the Mic Array/Mic In is enabled. So, apparently, for some strange reason, I can't have the mic work and play things from the Line in. If you look at the Omni Utility in the system tray and go to the Mixer, the Mixer combines Line in/Mic In/Mic Array with no option to separate them out. THIS means I can't use the Line In without it also playing everything heard from the mic. Directions say to listen to your line-in by changing settings via the mixer, but the directions are WRONG, because there is no way to separate out the Mic.
    What I am trying to do, which I've done successfully using the on-board crappy Realtek sound from the motherboards of various PCs over the past dozen or more years, is have sound from my SECOND PC go to the Line IN on my MAIN PC, so I can have sound from both PCs play out of my main system's speakers or headphones - and still use my Mic (I play WoW/Use Ventrilo and Mumble).
    Color me surprised that this is apparently something that I cannot do with an $80 SoundBlaster Omni USB sound card. Then, when I DO set it to just the Line in (which won't work for me when I need to use Ventrilo or Mumble), the sound quality is utter garbage compared to using the Realtek sound on my main PC. Really? How does this USB sound card offer LESS functionality with WORSE sound than the on-board sound from PCs I've owned?
    Is there some magic workaround for this, because otherwise, it's going back to the store and I doubt I'll ever trust another Creative product.

    Hi kittykatmax,
    Do you see these settings in the mixer tab of the Sound Blaster Omni Surround 5.1 control panel:
    Mixer1.jpg

  • How to separate date fields from t:calender ip?

    Hi All,
    I am using tomahawk calender in my jsf page.
    <t:inputCalendar id="startDate" value="#{bean.startDate}" renderAsPopup="true" popupDateFormat="MM/dd/yyyy" forceId="true" />
    Inside bean , I have
    Date startDate= new Date();
    when I print this startDate, I get
    Tue Apr 24 00:00:00 IST 2007
    I want to get date and month separately..how to do this?
    because in Date class getDate() method is deprecated...
    Thanks in advance...

    I do not have 2008, but you should be able to edit the subreport and run it seperate of the main report.
    add a formula to the sub to return the dates that are comming from the main report.
    Check the links to the sub-report.
    You should have two links, one for mindate one for max
    Check to see if you have a checkbox above a section that says
    Select data in subreport based on field.
    This advice may be way off for 2008.  but is valid in CRXI

  • How to separate single photos from that have been put into an album

    I always import and categorize my photos into albums immediately. But I've accidentally imported photos without putting them into an album so they don't appear in the 'events' section. They do however appear in the 'all photos' section along with thousands of other photos. Is there a way to separate photos that are already in an album from those that are not yet in one so I can easily see which ones I haven't organized and sort them from there?

    IN Photos?
    File -> New Smart Album
    Album > is not -> Any

  • How to separate multiple outputs from a TPC

    I am using a TCPactive to receive information from a separate program and have that working fine, I just need to know if there is a way to separate the information I receive back to Labview into different text boxes. As of right now, I can call for lets say frequency and amplitude, but they return into the same text box. Is there a way to recognize a call word and put it into a certain output box, or even sequentially separate them, like, if I call them in order every time, to put the first output into one box etc...
    Patrick

    Hello,
    Take a look at the LabVIEW shipping example titled 'Simple Data Client' under the 'Networking' category. This VI should do what you're describing.
    Regards,
    National Instruments
    Applications Engineer

  • How to separate my adornments from effects applied to page item?

    Hi All,
    I have my own graphical page item. And I also draw special border and, the most important, my special label if my object is bigger than its frame. (Text frame behaviour is the example for me).
    I tried to draw adornments in MyShape::DrawPageItemAdornments reimplemented method. I also tried to draw my adornments in the way of FrameLabel SDK sample adding my IAdornmentShape implementation.
    But in all these cases my adornments have drop shadow and all other effects applied to the item.
    Is there any possibility to separate adornments from the effects like drop shadow?
    I need your help very much!
    Thank you in advance.
    Sofia

    Any new iCloud account will be assigned an @icloud.com address at this point.  If LinkedIn will accept this, you can create a second iCloud account on your device by going to Settings>Mail,Contacts,Calendars>Add Account>iCloud.  However, mail synced with a "secondary" iCloud account like this will only be fetch, as push is only supported in the primary account.
    Otherwise, you'll have to set it up using another email provider like Gmail.

  • How to separate events fired from multiple JComboBox instances

    Hi everybody,
    I have built a form with 2 JComboBox instances: each for separated options.
    String[] items = {"Red", "Blue"};
            JComboBox comboBox1 = new JComboBox(items); // For water color
            JComboBox comboBox2 = new JComboBox(items); // For mountain color
            comboBox1.addActionListener(aListener);
            comboBox2.addActionListener(aListener);
            contentArea.add(comboBox1);
            contentArea.add(comboBox2);How can I distinguish which event is fired from comboBox1 and which event comes from comboBox2. I tried to implement actionPerformed method as follows:
    public void actionPerformed(ActionEvent event) {
            Object eventSource = event.getSource();
            if (eventSource instanceof JComboBox) {
                JComboBox cb = (JComboBox)event.getSource();           
                System.out.println("From JCom "+cb);
                if (cb == comboBox1) {
                    System.out.println("From comboBox1");
        }but it does not work. Java Compiler said: cannot find symbol comboBox1.
    How can I resolve this problem?
    Thanks in advance

    Move the declarations for the comboboxes into class scope so they can be seen from within the "actionPerformed" method.
    class SomeClass
        // instance variable declarations
        // these variables have class scope
        JComboBox comboBox1;
        JComboBox comboBox2;
        void aMethod()
            String[] items = {"Red", "Blue"};
            comboBox1 = new JComboBox(items); // For water color
            comboBox2 = new JComboBox(items); // For mountain color
        }Or you could use the "getActionCommand" and "setActionCommand" (JComboBox) methods to send along a string with the event.
    Another option is to use the Component methods "setName" and "getName" to identify the sender of the event. Or you could use the JComponent "putClientProperty" and "getClientProperty" methods.

  • Merged gradient - how to separate the gradient from the background

    I created a new layer and filled a colour. Then I created another layer and made a circular gradient in black with multiply option. Now i can move the gradient to any position. Then I flattened all the layers. I saved it as jpg. Now i want to bring back those two layers with multiply option from that saved jpg.  how to make it?

    If you could create the gradient again in perfect alignment with what you did before, you *might* be able to recover some of the original image data, but in general you're not going to be able to get an acceptable image back as the data will be degraded - possibly badly.  You might be best off just to start over with a new image and gradient.
    But I may have misunderstood...  Is there an actual photo at all involved in this anywhere, or do you just have a solid color with a gradient?
    -Noel

Maybe you are looking for

  • Option missing to open images as layers in Photoshop.

    The option to edit in Photoshop CS4 from Lightroom 4 and return is just fine. However, the option to Open images as layers in Photoshop is grayed out as well as the option to open as Smart Object or Merge.

  • Default LaunchDaemons and open ports?

    I recently have written a port scanner for a project at my university and after running it, I discovered that a large portion of my Macbooks' well known ports was open. These were 21 (ftp), 22 (ssh), 23 (telnet), 53 (domain), 79 (finger)!!, 88 (kerbe

  • Acrobat 3D fails in comparison to DWF writer or eDrawings

    I like Acrobat but Im no expert. I think our customers will benefit from our use of it. Ive been an advocate for some time here and have been tasked with evaluating the most advanced version. Our department prides itself on being up-to-date in our pr

  • Printing issue of grn document

    Hi,     all the setting for print out of grn had been done ,spool request is also generating, but in mb90   after entering required data i.e out type,t med,s order-01,p mode-1,mat doc yr-2009, system give green message-no messages for initial process

  • Upgrading from Windows 2000 to XP

    Help! I have my iPod installed on my work computer and my office is getting ready to upgrade my computer from Windows 2000 to Windows XP. Our IT department won't transfer personal music files. I don't want to lose the music in iTunes, what can I do?