Modal popup pure AS3

I couldn't find any ready made solutions, so I had to work it out on my own.
I borrowed ideas from developers, books, and Adobe documentation.
Pure AS3, Flash Professional CS5.5, no Flex, no nothing.
Two classes, Sprite based.
Behaviour seemingly (but not really) modal.
I don't see how to upload the zip here, so email me
g_g_a_r_c_i_a_a at g_m_a_i_l dot c_o_m
remove all _s
Regards.

I am offering a working solution for free.
Ned: thanks for your remark. I realize that my post was misleading.
I don't have any troubles with this particular code.
I'm just offering the solution I worked out, one that is fairly acceptable for me, at least for starters.
Should anyone be willing to give it a try, just email me, and I will send the files.

Similar Messages

  • Problem with JavaScript code in Page Attributes, modal popup...

    Hello all!
    I'm encountering a problem with a modal popup I wrote in JavaScript.
    h3.
    The situation*
    A user sees an interactive report with rows that are clickable, so these rows are links. Upon clicking the name of something in a row, some items get a certain value and a modal popup shows on the screen. In this modal popup, there are details regarding that particular row the user has clicked, but the problem_ here is...
    The modal popup closes itself only seconds after it has been opened.
    This must be because I've probably made a mistake somewhere in my code, but I just can't figure out where... It also appears that when I click on a row link, the popup shows, but the progress bar of my toolbar seems to show a loading bar (as if I refreshed the page).
    h3.
    My code*
    This code is located in the _"Function and Global Variable Declaration"_ part, under the _"JavaScript"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    function showhide(x){
    $x('REGION1').style.display = ( x == 'REGION1') ? 'block' : 'none';
    $x('REGION2').style.display = ( x == 'REGION2') ? 'block' : 'none';
    $x('REGION3').style.display = ( x == 'REGION3') ? 'block' : 'none';
    $( function(){
      $('#ModalForm').dialog(
         modal: true,
         autoOpen: false,
         width: 500,
         height: 350,
         buttons:{ Close: function(){closeForm();}        
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        $('#ModalForm').dialog('close');
        $(document).ready(function() {
            $('a.temppop').click(function() {
                openForm();
        });This code is located in the _"Header Text"_ part, under the _"Header"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>This code is located in the _"Column Link"_ part, you get there by going to the _"Report Attributes"_ of the region called _"Template overview"_ on page 24. This region is an interactive report.
    Link Text: #FOODTEMPLATENAME#
    Link Attributes: class="temppop"
    Target: Page in this Application
    Page: 24
    Item 1, name: P24_MEALID; item 1, value: #MEALTYPEID#
    Item 2, name: P24_TEMPLATEID; item 2, value: #FOODTEMPLATEID#So basically I call the function to open the modal popup by the class name. When a link with that class name in it is clicked, it opens the popup.
    To remind you of the problem, the modal popup closes seconds after it has been opened. How do I fix this?
    Thanks in advance.
    (APEX version 4.1.1.00.23)

    Come on guys... I really need to know this. :(

  • Skillbuilders modal popup v2. - popup does not open, can't figure out why..

    Hi, I am using APEX v4.1 and have used skillbuilders modal popup v2 successfully in the past. For some reason, it is working on one page (calling page 700 to pull up popup page 360) but not working on another page (calling page 900 to pull up popup page 920).
    Both modal popup pages are called from HTML buttons using dynamic actions.
    Does anyone have ideas for debugging.
    thanks, Karen
    ps. when I run the console debug, I receive the following on loading the page. I am completely new to javascript and have no idea what this means....it does not happen on p700, only on page 900
    SCRIPT5007: Unable to get value of the property 'length': object is null or undefined
    apex_4_1.min.js, line 18 character 88940
    function initTabForm(a,b,d,h,g){
    var f="#init_row_"+a;
    gErrItems=g;
    gChangedItems=new Array();
    gNumRows=h;
    gNewRows=0;
    gTabFormRegionID=a;
    gTabFormReportID="report_"+a;
    gTabForm=apex.jQuery(f).parent();
    gTabFormDefaultBG=apex.jQuery(f).children("td").css("background-color");
    gTabFormInitRow=b+apex.jQuery(f).html()+d;
    apex.jQuery(f).remove();
    var c=$x_FormItems($x(gTabFormReportID));
    for(var e=0;
    e<c.length;
    e++){
    apex.jQuery(c[e]).attr("autocomplete","off");
    if(c[e].name!="X01"){
    gTabFormData[e]=c[e].value
    else{
    gTabFormData[e]="0"
    apex.jQuery(".row-selector").click(function(){
    highlightRow(gTabFormRegionID,this,apex.jQuery(".row-selector").index(this))
    apex.jQuery(document).bind("apexbeforepagesubmit",function(){
    apex.jQuery("input[name$=NOSUBMIT]",apex.jQuery("#"+a)[0]).each(function(){
    $x_disableItem(this,true)
    apex.jQuery(f).remove()
    Edited by: KarenH on Sep 28, 2012 10:39 AM

    Thanks Pete.
    This is a large application, and I have had difficulty posting to apex in the past because the schema is too large and cannot be exported...but at least it gives you an idea.
    I am trying to rewrite p900 as it is much too complicated, and thought the modal popup would help in terms of adding new rows and validating, rather than using collections. This code was inherited, so I am a bit confused myself...but hoping to make progress.
    The button in question is called TRIPHEADER (add/edit trip header).
    https://apex.oracle.com/pls/apex/f?p=4550:1:33303433963:::::
    workspace: KEH813
    user: guest
    pwd: fish
    if you have trouble with that, access my development site:
    http://warsaw-grouper.accsp.org:7777/pls/safisd_11/f?p=4550:1:0:::::
    workspace: SAFIS
    user: guest
    pwd: fish
    you will need to run application 200 and logon as MDFISHER/SHARKBAIT
    go to FAVORITES (p900) and press ADD/EDIT TRIP HEADER....nothing happens.
    if you go to menu-->FISHER INFO and press ADD/EDIT EMAIL, you will see the modal successfully appear.
    thanks again. Karen

  • Skillbuilders Modal Popup does not open correctly

    Hi,
    i installed the modal popup from skillbuilders but i'm having trouble using it. I've gone through the online tutorial and the forum but i don't know what i am doing wrong.
    The modal page opens but very quickly a larger window shows that reduces in size to a smaller one which display no regions or items from the page i have selected to be a popup modal. I have created a demo which has the same effect
    http://apex.oracle.com/pls/apex/f?p=35329:1
    (usr,pwd: modal, modal)
    I'm not sure what page type should be used, i have tried a blank page, form, classic report but all have the same result. I'm using Apex 4.2.3
    Teo

    Try Page Template = 'Popup' for your modal page.
    If you provide access to your workspace, it might be easier to track what's wrong.

  • Upgrade from 4.1 to 4.2.1 - skillbuilder modal popup 2.0 stopped working.

    Hi Everyone. We are in the process of upgrading our applications from 4.1 to 4.2.1. I have a large applications which uses the fabulous skillbuilders modal popup in many places.
    The popups have stopped working, as have several other dynamic actions. Nothing else has changed, but the apex version. I use theme 13. I have read a few blogs and some suggested checking browser security....but I am not exactly certain what to look for.
    any help would be appreciated. thanks! Karen

    How exactly did they stop working? Do they pop up at all, but with empty content?
    As for browser security: verify "Embed in frames" is set to "Allow" or "Allow from same origin" under Application properties > Security > Browser Security > Embed in frames.

  • Exporting/Using SWC in pure AS3 project

    Hi,
    I have multiple movieclips, each with 5 image-movieclips inside, which allows me to manipulate which image-movieclip is displayed in an animation. So, if image-mc1.alpha = 0, then image-mc2, next in the 5 layers, which has a default alpha of 1 is displayed. 5 image-mc's, so can use alpha to show whichever is needed.
    There are 37 of these image-mc's in the project.
    Instead of a FLA based project, I would like to try a pure-AS3 version, maybe compile using Flex/AIR SDK. One way to re-use these complex mc's would be a create a SWC for each (not sure one SWC with all 37 can be created in CS6, or how each would be called in the script?).
    When I try this, using one multi-mc/multi-layer mc exported as a SWC and try to reference its internal mc's re: alpha setting, doesn't work.
    image1.imagea1.alpha = 0;//image1 is the instantiated version of the SWC's mc done as addChild(image1)
    In the FLA version, this script would cause the second mc, imageb1, which has a default alpha of 1, to display. But this is not happening in the AS3 version. Instead, image1.imagea1 still displays, no alpha effect.
    Any way to get this to work?

    Again, thank you.
    I guess what I'm not clear about is how to add/call each in the script. For example, the mc's are p1...p37. (As mentioned, each of these has 5 subordinate mc's inside with images.)
    So, if I create all 37 as class P, how would I instantiate each one of the 37 separately?:
    var p1:P=new P();
    addChild(P.p1);
    //and
    var p2:P=new P();
    addChild(P.p2);
    //etc...
    var p37:P=new P();
    addChild(P.p37);
    Then
    displayF("p37.imagea1");
    I'm not sure how to reference/script these.

  • TIP: Building Modal Popup Windows

    Build Modal Popup Pages
    Introduction
    The following is based on the 'How To Document' - 'Build Custom Popup Pages'.
    This How To will show the developer how to create Modal Popup windows with the ability to pass information back to the parent window.
    Example Scenario
    The example described in this how to adds a custom modal popup LOV to a form on the SCOTT.EMP table. Clicking the popup LOV link on the form page will popup a Modal LOV page that allows users to search by ENAME, JOB, and SAL. Selecting a value from this LOV page will close that popup LOV page and populate the ENAME, JOB, and SAL fields on the form page with the selected values. Additionally, had the user entered some data into the ENAME, JOB, and/or SAL fields on the form page, that data would be used in the initial search when the popup LOV page is first shown.
    Step 1 - Create a simple form page on SCOTT.EMP
    To create the form page, simply step through the HTML DB "Form on a Table or View" wizard against the EMP table accepting the defaults. For this example, create the form with a page number of one, and make sure to allow the ename, job, and sal fields to be editable. When the wizard completes, page 1 of the application should have the items P1_ENAME, P1_JOB, and P1_SAL on it as text fields.
    Step 2 - Create a popup page with search fields
    Next, create a page that's to be used as the popup window: Page 2. Ultimately, this page will have javascript, a report region, and some buttons. For now, though, just create a page 2 with the items P2_ENAME, P2_JOB, and P2_SAL on it as text fields.
    Step 3 - Set Modal popup page header requirements
    A) Modal windows by default cache the information they display. When creating a popup window which displays different information each time it is called or to allow searching the caching default must be switched off.
    Add the following meta-tag to the "HTML Header" field of the page-level attributes screen for page 2 to accomplish this:
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    B) Modal windows by default open a new window when running any redirect calls. When creating a modal popup which passes back parameters to the parent window. The modal window has to be forced to fire redirect calls within its own window rather than open a new window for the redirect.
    Add the following tag to the "HTML Header" field of the page-level attributes screen for page 2 to accomplish this:
    <base target="_self">
    Step 4 - Add Javascript call to the popup page
    Because the popup page should filter its result set based on any values that the user might have entered onto the form page, you need to add a javascript function that would pass those values off. Add the following function to the "HTML Header" field of the page-level attributes screen for page 1 to accomplish this:
    <script language="JavaScript" type="text/javascript">
      function callMyPopup (formItem1,formItem2,formItem3) {
        var formVal1 = document.getElementById(formItem1).value;
        var formVal2 = document.getElementById(formItem2).value;
        var formVal3 = document.getElementById(formItem3).value;
        var url;
      url = 'f?p=&APP_ID.:2:&APP_SESSION.::::P2_ENAME,P2_JOB,P2_SAL:' + formVal1 + ',' + formVal2 + ',' + formVal3 ;
      // IE Browsers modal popup window
      if (window.showModalDialog) {
        w = showModalDialog(url, window.self,"status:0; scroll:1; resizable:1; dialogWidth:25; dialogHeight:43");
        // w is an array returned from the modal popup containing the passback values
        if (w) {
          document.getElementById("P1_ENAME").value = w[0];
          document.getElementById("P1_JOB").value = w[1];
          document.getElementById("P1_SAL").value = w[2];
          document.getElementById("P1_SAL").focus();
      else {
      // mozilla based browsers modal popup window
      w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600", modal="yes");
      if (w.opener == null)
        w.opener = self;
      w.focus();
    </script>Though you don't need to know how to read javascript for this example, it helps to understand that this function only does one important thing: it opens a modal popup window of page two in our application while passing values to P2_ENAME, P2_JOB, and P2_SAL. It gathers those values to pass from the names of the HTML DB items provided to it. The call to this function will be added in the next step below.
    Step 5 - Add a popup link next to the P1_SAL field on the form page
    Add a link to the form page that will call the callMyPopup function above and pass it the values it needs. To do so, place the following HTML in the "Post Element Text" field attribute of the P1_SAL item:
    <~a href="javascript:callMyPopup('P1_ENAME','P1_JOB','P1_SAL');">Click for LOV<~/a>NB. remove ~ from above when deploying
    Step 6 - Add the LOV report to the popup page
    The next step is to create a report on the popup page based on the values passed from the form on page one. The tricky part of this report is providing a means for the selected values to be passed back to the form page. This can be achieved by having a column of the report render as a javascript link that would close the popup window and pass the ename, job and sal values for that row back. Start by adding a simple report region to our Modal popup page that uses a query such as:
          select ename, job, sal , 'placeholder' the_link
            from emp
           where ename like '%'||:P2_ENAME||'%'
             and (job = :P2_JOB or :P2_JOB is null)
             and (sal = :P2_SAL or :P2_SAL is null)Note that the last column in this query is just a placeholder. once the region is created, turn that placeholder into a link by doing the following:
    Navigate to the Page Definition for page 2
    Next to the name of the report region created in step 6, Click Q
    Next to the column THE_LINK, click the edit icon
    In the "Link Text" field enter the string "select"
    In the URL field enter: javascript:passBack('#ENAME#','#JOB#','#SAL#'); Click the "Apply Changes" button
    Step 7 - Add the javascript function to the Modal popup page to pass selected values to the (parent) form page.
    In the previous step you added a call to a javascript function, passBack. Now add that function to the top of Modal popup page 2. In the same manner as step 4 above, add that passBack function to the page 2 by putting it in the "HTML Header" field of the page-level attributes screen. The function should look similar to the following:
    <script language="JavaScript">
       function passBack(passVal1, passVal2, passVal3)
         // IE Browser return the passback values in an array
         if (window.showModalDialog) {
           var retVal = new Array(passVal1, passVal2, passVal3);
           window.returnValue = retVal;
           window.close();
         // Mozilla based browsers right the passback values directly into the parent window
         else {
           opener.document.getElementById("P1_ENAME").value = passVal1;
           opener.document.getElementById("P1_JOB").value = passVal2;
           opener.document.getElementById("P1_SAL").value = passVal3;
           opener.document.getElementById("P1_SAL").focus();
           close();
    </script>This function simply sets the values of P1_ENAME, P1_JOB, and P1_SAL with the values of the whatever's stored to the three HTML DB item names passed to it. It also closes the current window and puts the cursor back into the P1_SAL field.
    Step 8 - Polishing
    The basic functionality of this custom modal popup window has been created in steps 1 though 7. To make its usage a little more friendly, it's advisable to add Cancel and Search buttons to the popup window page. The Search button should just be added as a regular button that branches back to the page 2. Adding this button allows users to re-query for LOV options without having to return to our form page. The Cancel button should be created with an "Action" of "Redirect to URL". The "URL Target" of the button should be javascript:window.close(). As the code suggests, the Cancel button would just close the popup window (with no values returned).
    Hope this is of use....

    Everything said above is working fine but in Mozilla small popup is coming in top left corner of browser..
    so please help me so that it is opened in proper width and height in mozilla.

  • For pure AS3 development do we still need to overlay the FLEX SDK?

    Hi Guys
    I've found this whole SDK overlay business a mess and very confusing. I've found this document
    http://www.adobe.com/devnet/air/articles/ane-android-devices.html
    which states
    "The distribution of the AIR SDK with ASC 2.0 is for pure ActionScript development only. It should not be combined with an existing Flex SDK.
    To support Flex application development with newer versions of the AIR SDK, an AIR SDK overlay distribution that does not include ASC 2.0 needs to be overlaid over the Flex SDK bundled with Flash Builder 4.7."
    So if we are doing pure AS3 development there is no longer any need to do any 'overlaying' of one SDK Folder onto another.  We just need to get the latest AIR SDK with complier ( http://www.adobe.com/devnet/air/air-sdk-download.html )
    We should then update the AIR SDK if using Flash Builder via (  http://helpx.adobe.com/flash-builder/kb/overlay-air-sdk-flash-builder. html ) (Note it still uses the term 'overlay' but you are not really overlaying but replacing).
    Is this conclusion correct.  Do we just need the SDK with the new compilier and nothing else ?
    Can someone from Adobe confirm please ?
    Thanks
    PS - I've asked this question on the Flash Builder Forom but there's been no response.

    Yes, that's correct, for pure AS3 development you need not use the Flex SDK overlay. For this you should use asc2 compiler available at http://www.adobe.com/devnet/air/air-sdk-download.html . Also below are step to overlay your AIR SDK with Flash builder 4.7
    1. Exit Flash Builder. 
    2. Back up the AIR SDK availabe at Application/FB4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/ by copying the entire directory and rename it to something AIRSDKversion. Now, you have two folder AIRSDK(default one) and AIRSDKversion(copied one).
    3. Download the appropriate AIR SDK file for your operating system e.g. http://www.adobe.com/devnet/air/air-sdk-download.html unzip and save it on your MAC OS X.
    4. On Terminal, run the below command
    sudo ditto /path/air3-8_sdk_sa_mac /Applications/Adobe\ Flash\ Builder\ 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK
    /path/air3-8_sdk_sa_mac -> path where you downloaded the AIR SDK
    /Applications/Adobe\ Flash\ Builder\ 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK -> path where you overlay the new AIR SDK
    5. (Optional) To access the new AIR 3.8 APIs, update your application descriptor file to the 3.8 namespace.
    To update the namespace, change the xmlns attribute in your application descriptor to: <application xmlns="http://ns.adobe.com/air/application/3.8">
    6. (Optional) To ensure that the output SWF file targets SWF version 21, pass an additional compiler argument: -swf-version=21.
    Hope this will help.
    Regards,
    Nimit

  • Modal popup window refresh the parent (calling) window/view

    I have a modal popup window that is adding detail records.  When this window is closed via the Hide method in my controller I would like to refresh the parent (calling) window/view.
    What is the best way to do this?
    Regards,
    Diane

    Here's my process.....
    2-windows & 3 views
    Window 1 - Selection View and Detail View
    Window 2 - Add View (used as a modal popup window called by a button click on the detail view)
    Selection View has all the options for obtaining a list of data for the detail view.  The detail view has an Add button.  Component controller has the hide method and access to the other components that do the update/query methods. On the detail view the user can click Add and a popup modal window shows.  User enters data and clicks either the add or cancel button.  The Detail view needs to refresh to show the additional data that has been added by the modal window.  There are calcuated values in the detail view from a supply function.  This function is not running and the values are not changed.
    What should be put in the hide method that will cause the detail view to obtain new data and supply the calculated values?  If I was using the Add view as part of the same window as the detail/selection views I'd just put in a navigation link between the detail and add views and fire the plug.  I like the idea of the popup window so I'd like to get this to work.
    I put the wdContext.initialize() in the hide method - which yes - caused the detail view to run - however the context lost all the key values so I received a data not found.  I then tried to initialize those nodes that did not contain the key values but the detail view did not display new values.
    Thanks for any ideas.....Diane
    Edited by: Diane Fuller on Jan 8, 2009 6:48 AM

  • Showing non-modal popup in overlay of browser.xul - on Windows

    Hi. I've got a custom Firefox add-on in plain Javascript. It to overlays Firefox's browser.xul (via chrome.manifest) by an XUL file, where I would like to show a non-modal popup (or some kind of non-intrusive notification).
    I've tried following three options from https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Alerts_and_Notifications:
    1.
    Components.classes['@mozilla.org/alerts-service;1'].
    getService(Components.interfaces.nsIAlertsService).
    showAlertNotification(null, 'Some title', 'Some message', false, '', null);
    2.
    var win = Components.classes['@mozilla.org/embedcomp/window-watcher;1'].
    getService(Components.interfaces.nsIWindowWatcher).
    openWindow(null, 'chrome://global/content/alerts/alert.xul',
    '_blank', 'chrome,titlebar=no,popup=yes', null);
    win.arguments = [null, 'Some title', 'Some message', false, ''];
    3.
    var message = 'Another pop-up blocked';
    var nb = gBrowser.getNotificationBox();
    var n = nb.getNotificationWithValue('popup-blocked');
    if(n) {
    n.label = message;
    } else {
    var buttons = [{
    label: 'Button',
    accessKey: 'B',
    popup: 'blockedPopupOptions',
    callback: null
    Neither of them works on Windows. The first two work on Linux (Fedora 20 x64). Neither of them generates any error either.
    Please, suggest how/where to do that, or how to 'schedule it' (as an even handler to a system event, I suppose) from my overlay of browser.xul.

    I think you would have a better chance of getting comments from experienced add-on developers on one of these sites:
    * http://forums.addons.mozilla.org/
    * http://forums.mozillazine.org/viewforum.php?f=19

  • Non-Modal Popup in WebDynpro 4 ABAP?

    Hey,
    i tried to create a non-modal popup but by opening the popup the following error is raised:
    System Tried to Create Amodal Window. This Is Currently Not Possible
    Below you can see how i created the popup:
    CALL METHOD cl_wd_popup_factory=>popup
      EXPORTING
        component           = com
    *    used_component_name =
        view_name           = 'VTEST'
    *    create_only         = ABAP_FALSE
        modal               = ABAP_FALSE
    *    window_title        =
        close_button        = abap_true
    *    button_kind         =
    *    message_type        = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
    *    close_in_any_case   = ABAP_TRUE
    *  IMPORTING
    *    popup_window        =
    *    component_usage     =
    * CATCH cx_wd_runtime_repository .
    *ENDTRY.
    Is there any possibility to create a non-modal popup anyway?
    Thanks in advance

    why are you using the factory method, instead you can use the
    the interface if_wd_window_manager , method create_window
    data:l_window1 type ref to if_wd_window_manager,
         popup type ref to if_wd_window,
         l_cmp_api type ref to if_wd_component,
         l_view_api       type ref to if_wd_view_controller.
         l_cmp_api = wd_comp_controller->wd_get_api( ).
         l_window1 = l_cmp_api->get_window_manager( ).
         popup = l_window1->create_window(
    *          MODAL                = ABAP_TRUE
              window_name          =  'WINDOW1'
    *          TITLE                = TITLE
    *          CLOSE_BUTTON         = ABAP_TRUE
    *          BUTTON_KIND          = BUTTON_KIND
    *          MESSAGE_TYPE         = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
    *          CLOSE_IN_ANY_CASE    = ABAP_TRUE
    *          MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
    *          DEFAULT_BUTTON       = DEFAULT_BUTTON
    popup->open( ).

  • Pure AS3 self-preloader

    My project originally had everything on the timeline, but I have since moved all the code to the document class, but some of my assets are still in the library and some of them are embedded. I'm trying to make a self-preloader that doesn't use any external files, but I can't seem to find a good tutorial that doesn't involve using the timeline. Can anyone point me to a pure AS3 self-preloader tutorial or tell me where I'm supposed to put everything?

    If you mean by "self-preloader" a pure Standalone as3 preloader:
    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    //this line has to be adapted to the name of your document class
    l.load(new URLRequest("main.swf"));
    function loop(e:ProgressEvent):void
        var kBytesLoaded:int = Math.round(e.bytesLoaded/1024);
        var kBytesTotal:int = Math.round(e.bytesTotal/1024);
        var perc:Number = kBytesLoaded / kBytesTotal;
        trace("PERCENT:"+perc);
    function done(e:Event):void
        //this line for the stuff you might need to visually communicate the loading process and want to remove when loading is done
        removeChildAt(0);
        addChild(l);

  • How to use TestRunnerBase in pure AS3 / no MXML

    Hi,
    is there a way to use the testRunnerBase GUI for a pure AS3 project, without a mxml?
    Thank you

    Hi, the testRunnerBase is a Flex application, so you can't use it in a pure AS3 environment without including all of the Flex dependencies.

  • Brain Fart on pure AS3 Project

    I Generally hang out in Flex Land, but by no means would be considered a new guy to the world of AS3.  I am currently creating a pure AS3 app and I can't get the darn thing to get a BG color. I  have the following:
    package
    import flash.display.Sprite;
    [SWF(width='800',height='600',backgroundColor='0xff0000',frameRate='24')]
    public class Surprise extends Sprite{
    public function Surprise(){
    this.graphics.beginFill( 0xff00ff, .5 );
    this.graphics.drawCircle( 0, 0, 10 );
    And all I see is that little purple circle, no Red BG. I hope I am missing something foolish, for i feel quite foolish posting such a stupid question on line. 
    Thanks.
    -Andrew

    Turns out the code was fine, I looked at the HTML that was being generated to render the AS3 file, and that was crap.  Deleted the bin-debug folder and it created new html for me and works great.    

  • Scrolling Mobile List in Pure AS3?

    I'd like to use a scrolling list in one of my AS3 mobile projects. I like the one built for Flex, but I do not wish to use flex as that would be overkill and I already have the project written in AS3.
    Does anyone know of any pure AS3 scrolling list components for mobile?
    thanks,
    Jack

    That's the flex component I wish to immitate. But since I am not using Flex, I cannot use the spark component. (I wish I could use spark components, but Adobe built them in such a way that is nearly impossibnle to use in a non-flex project.)
    I am hoping there is a pre-built nonFlex, pure AS3 equilevent. 

Maybe you are looking for

  • Problems finishing startup after login

    Hi everyone, Looking for some advice in getting my dad's MacBook functioning properly. There's something wrong with... something. I've attached a thorough log, complete with everything from Console, detailing our endeavors over the course of a few ho

  • Aperture 2.1 does not show edits from Photoshop Elements 6 on a PPC

    I am trying the Aperture 2.1 trial - and, so far I like it. However, when I use it with Photoshop Elements 6 as an external editor in Aperture on my iMac G5 PPC it seems to create another copy (as it should) but when I try to save the edited version

  • Creating ODBC Connections to SQL Server

    I have posted a Question to two Forums about a problem I'm having connecting to SQL Server using an ODBC Connection.  Suddenly we can connect using on the IP Address of the virtual server not its name.  So we can connect using 192.168.16.122\GEMSQLSR

  • Reprogram

    How to reprogram my blackberry 8520 since it wont start/open?

  • Override databse connection in CR Server 11

    Post Author: NickT CA Forum: Data Connectivity and SQL We have a report which calls a stored procedure with parmaters using SLQ Server 2000. One of the parameters is an indicator for an update. The stored procedure is structured as follows UpdateYN a