EventListeners for backgroundTasks?

I'd like to attach an eventListener to a backgroundTask (Document.asynchronousExport), and I can't seem to figure out what event types, if any, get sent there.
There is a BackgroundTask.addEventListener(), so that would tend to suggest there are events. None of these events seem to fire:
"beforeQuit", "afterQuit", "beforeNew", "afterNew", "beforeOpen", "afterOpen", "beforeClose", "afterClose", "beforeSave", "afterSave", "beforeSaveAs", "afterSaveAs", "beforeSaveACopy", "afterSaveACopy", "beforeRevert", "afterRevert", "beforePrint", "afterPrint", "beforeExport", "afterExport", "beforeImport", "afterImport."
I realize I can basically get the same result from using Document.addEventListener() with eventType afterExport. That's what I will do instead..
(Or I could use an idle event. But that would be a waste.)
I guess Marijan Tompa seemed to note this in Jan in this post: Re: How To Prevent Recursive (Vicious Circle) Events.
Any solutions? Or is this in fact just unimplemented? Has it been wishformed?
Thanks!

Well, apparently there is an internal InDesign background Task called "Check Links," about which there are a bunch of weird properties.
For instance, if I run this quick hack script:
$.writeln("\n\n"+new Date());
a={}; function v(){var b=app.backgroundTasks,i,t;
  for(i=b.length-1; i>=0;i--){
       t=b[i]; a[t.id]=[t.id,t.name,t.isValid,t.percentDone,
       t.documentName,t.parent.name,t.status]; }
  return b.length; }
$.writeln("len "+v());
// for (j=0; j<1; j++) { v(); $.sleep(1)}
for (j in a) { $.writeln(a[j]); }
From the ESTK I get ~75 tasks:
len 75
2023,Check Links,true,0,,Adobe InDesign,RUNNING
2022,Check Links,true,0,,Adobe InDesign,RUNNING
2021,Check Links,true,0,,Adobe InDesign,RUNNING
2020,Check Links,true,0,,Adobe InDesign,RUNNING
2019,Check Links,true,0,,Adobe InDesign,RUNNING
2018,Check Links,true,0,,Adobe InDesign,RUNNING
2017,Check Links,true,0,,Adobe InDesign,RUNNING
2016,Check Links,true,0,,Adobe InDesign,RUNNING
2015,Check Links,true,0,,Adobe InDesign,RUNNING
2014,Check Links,true,0,,Adobe InDesign,RUNNING
2013,Check Links,true,0,,Adobe InDesign,RUNNING
2012,Check Links,true,0,,Adobe InDesign,RUNNING
And the task numbers only seem to increment when I poll -- that is, when I read the app.backgroundTasks array.
But if I run it from my javascript shell (change $.writeln to print), I get almost nothing. If I remove the commened out line and use j<1000, then I get ~10 or 20 tasks overall (All of which look like the above). And if I run it from ID's Scripts panel, I get no tasks at all. Pretty goofy.
Anyhow, to answer my own question, I submittd the following wishform bug report:
Concise problem statement:
SCRIPTING: a BackgroundTask has a .addEventListener() method, but no
events are dispatched to it.
Steps to reproduce bug:
In JavaScript, try to attach an eventListener to a background
asynchronous file export, and observe that it never runs:
(function() {
    var
        doc=app.activeDocument,
        pdfFile=new File("~/Desktop/test.pdf"),
        task = doc.asynchronousExportFile(ExportFormat.PDF_TYPE,
            pdfFile, false),
        events = ["beforeQuit", "afterQuit", "beforeNew", "afterNew",
        "beforeOpen", "afterOpen", "beforeClose", "afterClose",
        "beforeSave", "afterSave", "beforeSaveAs", "afterSaveAs",
        "beforeSaveACopy", "afterSaveACopy", "beforeRevert",
        "afterRevert", "beforePrint", "afterPrint", "beforeExport",
        "afterExport", "beforeImport", "afterImport", "afterTask" ],
        i, listeners = [];
    for (i=0; i<events.length; i++) {
        try {
            listeners.push(task.addEventListener(events[i],
                function(e) { alert("Caught "+events[i]); }));
        } catch (e) {
            $.writeln("failed to install "+events[i]+" for"+e);
Results: All published event types are successfully added, but
  none are disaptched. "afterTask" is not supported.
Expected results: There should be an event that fires on a BackgroundTask.
Otherwise the addEventListener() method is pointless. If there are multiple
exports going on, it's necessary to be able to distinguish between them,
which is not available when listening for a document's afterExport event.

Similar Messages

  • ExtendScript eventListeners (For CC Mac 9.x)

    Hello Everyone:
       Okay, okay it's probably my aged gray matter that is causing such difficulty but after six months of dealing with Javascript eventListeners I still don't get them.  Does anyone know of a good tutorial/reference that will help this poor fading programmer figure them out.
       I do not have a specific question; I only know that current documentation does a very poor job of providing a complete reference in one place if one is trying to learn about event listeners.
    R,
    John

    PM-Apple,
    Have you checked out the following web page? It is the best starting point after the shipping examples that use Apple Events with Excel. I also tried to search Google for other examples (I didn't find any others on NI's site) and I found a few free trials of software that use LabVIEW and Apple Events. Try that search and see what you find. I am very sorry that I have not been as much help as I would like to be.
    Using Apple Events and the PPC Toolbox to Communicate with LabVIEW Applications on the Macintosh
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • EventListeners for multiple remote object calls

    Hi all,
    I have a Flex component that is displaying content from multiple (specifically two) remote object calls. I can call both remote methods, get the results back, pass them off to their respective ItemRenderers, etc. with no trouble. What I need, though, is a way to determine if I get no results back from either function call, to dispatch an event to trigger the next view state, and I don't know how to do that. Something like:
    protected function ticketConfigurationStateChangeHandler(event:Event):void
                   if(getPackagePromptsResult.lastResult.length == 0 && getTicketPromptsResult.lastResult.length == 0)
                         this.dispatchEvent(new Event("ticketConfigurationStateChange"));
                protected function ticketPrompts_creationCompleteHandler(event:FlexEvent):void
                    getTicketPromptsResult.token = registrationAPI.getTicketPrompts();
                    getTicketPromptsResult.addEventListener(ResultEvent.RESULT, showTicketConfiguration);
                protected function packagePrompts_creationCompleteHandler(event:FlexEvent):void
                    getPackagePromptsResult.token = registrationAPI.getPackageCPrompts();
                    getPackagePromptsResult.addEventListener(ResultEvent.RESULT, showPackageConfiguration);
    Any suggestions would be greatly appreciated...I know I need the event listeners to be able to get lastResult.length (and have it not be null) but I don't know how to set them up so I can automatically pass the user through the component and onto the next one if there are no results returned without having the user click a button or something similar on an otherwise blank component.
    Thanks in advance!
    ~ Amanda

    Hi all,
    I have a Flex component that is displaying content from multiple (specifically two) remote object calls. I can call both remote methods, get the results back, pass them off to their respective ItemRenderers, etc. with no trouble. What I need, though, is a way to determine if I get no results back from either function call, to dispatch an event to trigger the next view state, and I don't know how to do that. Something like:
    protected function ticketConfigurationStateChangeHandler(event:Event):void
                   if(getPackagePromptsResult.lastResult.length == 0 && getTicketPromptsResult.lastResult.length == 0)
                         this.dispatchEvent(new Event("ticketConfigurationStateChange"));
                protected function ticketPrompts_creationCompleteHandler(event:FlexEvent):void
                    getTicketPromptsResult.token = registrationAPI.getTicketPrompts();
                    getTicketPromptsResult.addEventListener(ResultEvent.RESULT, showTicketConfiguration);
                protected function packagePrompts_creationCompleteHandler(event:FlexEvent):void
                    getPackagePromptsResult.token = registrationAPI.getPackageCPrompts();
                    getPackagePromptsResult.addEventListener(ResultEvent.RESULT, showPackageConfiguration);
    Any suggestions would be greatly appreciated...I know I need the event listeners to be able to get lastResult.length (and have it not be null) but I don't know how to set them up so I can automatically pass the user through the component and onto the next one if there are no results returned without having the user click a button or something similar on an otherwise blank component.
    Thanks in advance!
    ~ Amanda

  • How to create an EventListener for a specific keyboard press?

    Hello,
    I have been trying to figure out how to switch my actionscript3 from a mouse click to a keyboard press. I'm new to Flash, but the problem I keep coming to is that I need to have 3 separate keys programmed in to do three seperate outcomes. I have messed around with eventListeners for keyboard presses, but I cannot figure out how to have flash listen for a specific key press and then do an action based on that specific key press.
    Here is my actionscript. Any suggestions on how I can modify the mouse clicks to be keyboard presses, where key 's' = btn1 and triggers gotoAndPlay(2), 'g' = btn2 and triggers gotoAndPlay(3), 'k' = btn3 and triggers gotoAndPlay(4) as outline below. I also need my timer and writing to an exteral file to remain the same.
    stop();
    var startTime:Number=getTimer();
    var elapsedTime:Number;
    stream.writeUTFBytes("Item1,");
    function BTN1Action(eventObject:MouseEvent) {
         elapsedTime = getTimer() - startTime;
              stream.writeUTFBytes("Tar1,");
              stream.writeUTFBytes(elapsedTime.toString());
              stream.writeUTFBytes("\n");
              gotoAndPlay(2);
    function BTN2Action(eventObject:MouseEvent) {
              elapsedTime = getTimer() - startTime;
              stream.writeUTFBytes("Tar2,");
              stream.writeUTFBytes(elapsedTime.toString());
              stream.writeUTFBytes("\n");
              gotoAndPlay(3);
    function BTN3Action(eventObject:MouseEvent) {
              elapsedTime = getTimer() - startTime;
              stream.writeUTFBytes("Tar3,");
              stream.writeUTFBytes(elapsedTime.toString());
              stream.writeUTFBytes("\n");
              gotoAndPlay(4);
    BTN1.addEventListener(MouseEvent.CLICK, BTN1Action);
    BTN2.addEventListener(MouseEvent.CLICK, BTN2Action);
    BTN3.addEventListener(MouseEvent.CLICK, BTN3Action);
    Any assistance with this is greatly appriciated. 

    Assuming you want to monitor key press on the button BTN1, you can do following:
    // Add a key up event listener on the button (or on the source where the key press needs to be captured)
    BTN1.addEventListener(KeyPress.KEYUP, BTN1KeyUpAction);
    // BTN1KeyUpAction sample, you can modify this
    function BTN1KeyUpAction(e:KeyboardEvent):void {
        if(e.keyCode == Keyboard.S) {
        gotoAndPlay(2);

  • Populating a dynamic array with objects and managing it in runtime.

    So I'm another stuck firstyear. I'll try and make my question compact. I'm using Flash CS6 and have drawn an animated character on the stage that consists of separate parts that are animated and its head is a separate class/symbol entirely because it has not only animation, but a state switch timeline as well. This said Head extends the Main that is the character MovieClip.
    I am using a dynamic array to store and .push and .splice objects of another class that would collide with this said Head.
    I also discovered the super() function that is implicitly called as the constructor of the parent in any child class that extends the parent, in this case Head extends Main. The issue is that my collidable object array is populated within the main, within the function that spawns every next collidable object with a TimerEvent. This said function then gets called twice due to the super() call.
    I have tried putting this super() call into an impossible statement in my child class, but it doesn't change a thing, and it was said that this method is unsafe so I don't even know if it should be working.
    However what confuses me the most is when I trace() the .length of my collidable object array at the end of that function. As I said earlier, the original function both spawns an object after a period of Timer(1000) and adds it to the stage as well as adds the object onto the object array, but the super() constructor only duplicates the length call and a creates a copy of the object on the stage, but it does not add the second copy of the object onto the array. The trace() output goes on like so:
    1
    1
    2
    2
    3
    3
    4
    4
    etc.
    I wonder why and I'm really stumped by this.
    Here is the code in question:
    public class Main extends MovieClip {
                        public var nicesnowflake: fallingsnow;
                        var nicesnowflakespawntimer: Timer = new Timer(1000);
                        public var nicesnowflakearray: Array = new Array();
                        public function Main() {
                                  nicesnowflakespawntimer.addEventListener(TimerEvent.TIMER, nicesnowflakespawn);
                                  nicesnowflakespawntimer.start();
                        public function nicesnowflakespawn(event:TimerEvent) : void {
                                  nicesnowflake = new fallingsnow;
                                  nicesnowflake.x = Math.random()* stage.stageWidth;
                                  nicesnowflake.y = - stage.stageHeight + 100;
                                  nicesnowflakearray.push(nicesnowflake);
                                  stage.addChild(nicesnowflake);
                                  trace(nicesnowflakearray.length);
                                  for (var i:Number = 0; i < nicesnowflakearray.length; i++){
                                            nicesnowflakearray[i].addEventListener(Event.ENTER_FRAME, snowhit);
                        public function snowhit(event:Event) : void {
                                  if (nicesnowflakearray[0].y >= 460){
                                            if (nicesnowflakearray[0].y == stage.stageHeight) {
                                            nicesnowflakearray.splice(nicesnowflakearray.indexOf(nicesnowflake), 1);
                                  //if (this.hitTestObject(nicesnowflake)){
                                            //trace("hit");
    I am also fiddling with the collision, but I believe that it would sort itself out when I deal with the array pop and depop properly. However I'm pasting it anyway in case the issue is subtly hidden somewhere I'm not looking for it. And here is the child class:
    public class Head extends Main {
                        public function Head(){
                                  if (false){
                                            super();
                                  this.stop();
    So like what happens at the moment is that the array gets populated by the first object that spawns, but there is two objects on the stage, then when the objects reach stage.460y mark the array splices() the one object away and displays an error:
    "#1010: A term is undefined and has no properties.
              at Main/snowhit()"
    then when the next object spawns, it repeats the process. Why does it trace the array.length as "1, 1, 2, 2, 3, 3, 4, 4, 5, 5, etc" until the despawn point and then goes on to display an error and then starts from 1 again, because if the array length is more than one object at the time when the first object of the array gets spliced away, shouldn't it go on as usual, since there are other objects in the array?
    Thank you very much to whomever will read this through.

    There are multiple problems:
    1. You should add eventlisteners for your objects only once, but you add eventlisteners every time your timer runs to all of your snowflakes, again and again:
                                  for (var i:Number = 0; i < nicesnowflakearray.length; i++){
                                            nicesnowflakearray[i].addEventListener(Event.ENTER_FRAME, snowhit);
    change it to
    nicesnowflake.addEventListener(Event.ENTER_FRAME, snowhit);
    I don`t see why its even necessary to employ this snowflakearray, it would be much straight forward if you simply let the snowflakes take care of themselves.
    2. Then you have to change your enterframe function accordingly
    public function snowhit(event:Event) : void {
                                  if (e.currentTarget.y >= 460){
                                            if (e.currentTarget.y == stage.stageHeight) {
                                            e.currentTarget.removeEventlistener(Event.ENTER_FRAME, snowhit);
                                            removeChild(e.currentTarget);
    3.
                                  //if (this.hitTestObject(nicesnowflake)){
                                            //trace("hit");
    since "this" is a reference to the Main class (root) it surely won`t function as you intend it to.
                                  if (false){
                                            super();
    makes no sense to use a condition that can never be true

  • [CS3][JS] beforeClose event listener problem

    Hi all,
    I want my script to do the following: every time when a user closes a document, I wish for "Check Spelling..." dialog box to show up and after the user finishes spell-checking, the document should be closed.
    But instead, if I have one document open, I get an error: Error Number: 53762, Error String: Action is not enabled, and if more than one document open, the dialog opens in the wrong document.
    As far as I understand, the problem is that the menu action is invoked AFTER the document has already been closed – it is quite clear that opening the dialog with no documents open makes no sense – that’s why the error occurs.
    Does anybody know how to solve this? Why beforeClose event type doesn’t correspond to its name? The scripting guide states: “beforeClose – Appears after a close-document request is made but before the document is closed.”
    Here is the script:
    #targetengine "session"
    main();
    function main(){
       var myEventListener = app.addEventListener("beforeClose", myCheckSpelling, false);
    function myCheckSpelling(myEvent){
       app.menuActions.item("Check Spelling...").invoke();
    Kasyan

    Thank you Ole.
    I've been at it for about 6 months.
    I am providing 3 modules. All modules are in 1 folder. That's why the ScriptPath & Department variables.
    FYI: app.pdfPlacePreferences.pageNumber was used solved issues with InEvenScript plugin for CS2. That plugin was NOT handling a loop call. To solve it, I've used a variable to turn ON & OFF the handler. "Import" is used in the OPEN script, and that will execute the event!
    1) Startup. I trimmed it for you but I kept the orignal OPEN-Event disabled. See PrePressEVENT.
    2) PrePressTEST. It's a trimmed version of the actual PrePressOPEN. But it makes InDesign crash. FYI: PrePressOPEN works perfectly when triggered manualy (Script Panel).
    3) PrepressEVENT. Disabled in Startup, I am using this one so I can debug the EVENT and do actual work at the same time. Until it crashed of course.
    The window.add() is what makes it crash. Without it, fine. But if removed myDoc = app.activeDocument points to the wrong one!
    Thank you in advance. Hope this is clear enough.
    Module STARTUP
    =====================
    #target indesign
    #targetengine "session"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    var myScriptName = app.activeScript.fsName;
    var myScriptPath = app.activeScript.path;
    var myErrorStyle = "*****Error while Updating!"
    var myMsgStyle = "*****No UpDate! (Delete to Reset)";
    var myDept = "PrePress";
    //*** Initialize SCRIPT Variables
    app.scriptArgs.clear();
    app.scriptArgs.set("Department", "PrePress");
    app.scriptArgs.set("ErrorStyle", "*****Error while Updating!");
    app.scriptArgs.set("MsgStyle", "*****No UpDate! (Delete to Reset)");
    app.scriptArgs.set("Event_Path", myScriptPath); //***Path to InEventScript Plug-In
    app.scriptArgs.set("Event_Test", myScriptPath + "/"+myDept+"TEST.jsx"); //*** Debugging MODULE
    app.scriptArgs.set("Event_Open", myScriptPath + "/"+myDept+"OPEN.jsx");
    app.scriptArgs.set("Event_Close", myScriptPath + "/"+myDept+"CLOSE.jsx");
    app.scriptArgs.set("Event_Copy", myScriptPath + "/"+myDept+"COPY.jsx");
    app.scriptArgs.set("Event_Clean", myScriptPath + "/"+myDept+"CLEAN.jsx");
    app.scriptArgs.set("Event_Print", myScriptPath + "/"+myDept+"PRINT.jsx");
    app.scriptArgs.set("Event_App", myScriptPath + "/"+myDept+"APPPreferences.jsx");
    app.scriptArgs.set("Event_Doc", myScriptPath + "/"+myDept+"DOCPreferences.jsx");
    //*** Initialize GLOBAL Variables
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    SkipWRDS = new Array;
    //*** REMOVE all EVENTS
    app.eventListeners.everyItem().remove();
    //******************** EVENTS ********************
    //app.addEventListener("afterOpen", EventOpen, false); //STILL INDESIGN CRASH with OPEN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    var tmp = "List of Events loaded\n----------------------\n";
    var myEvents = app.eventListeners;
    for (var cpt = 0; cpt < myEvents.length; cpt++)
    tmp += "Event : " + myEvents[cpt].parent.name + "\tType: " + myEvents[cpt].eventType + "\n";
    //alert ("\tPREPRESS Area\n\t\==========\n\n"+tmp);
    alert ("\tTEST Area\n\t=======\n\n"+tmp);
    //******************** END Main ********************
    //****************** FUNCTIONS Definitions ********************
    function EventOpen (itsEvent)
    var myExeSrcFile = new File (app.scriptArgs.get("Event_Open"));
    if (myExeSrcFile.exists)
    if (app.pdfPlacePreferences.pageNumber == 99999)
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    else
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    // itsEvent.preventDefault();
    // itsEvent.stopPropagation();
    itsEvent.parent.windows.add(); //*** Doc. has no Window!!!
    myExeSrcFile.open ('r:(read)');
    app.doScript(myExeSrcFile, ScriptLanguage.javascript);
    myExeSrcFile.close();
    else
    alert ("Error! Missing File:\n\n" + myExeSrcFile.fsName);
    return;
    Module PrePressTEST
    =====================
    #target indesign
    //#include "PrePressLIBRARY.jsxinc"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    if (app.modalState) //*** Alert already displayed
    exit();
    if (app.pdfPlacePreferences.pageNumber == 99999)
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    exit();
    if (app.documents.length == 0)
    exit();
    var myDoc = app.activeDocument;
    //*** ALL DOCUMENTS PREFERENCE
    myDoc.textPreferences.showInvisibles = true;
    myDoc.viewPreferences.showRulers = true;
    myDoc.layoutWindows[0].transformReferencePoint = AnchorPoint.centerAnchor;
    alert (myDoc.name);
    //******************** END Main ********************
    Module PrePressEVENT
    =====================
    #target indesign
    #targetengine "session"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    var myEvents = app.eventListeners;
    var tmp = "\nList of Events removed\n------------------------\n";
    for (var cpt = myEvents.length-1 ; cpt >= 0 ; cpt--)
    if (myEvents[cpt].eventType == "afterOpen")
    tmp += "Event #" + cpt + "\tType: " + myEvents[cpt].eventType + "\n";
    myEvents[cpt].remove(); //*** There MAY be MORE than 1 instance.
    //******************** EVENTS ********************
    app.addEventListener("afterOpen", EventOpen, false);
    tmp += "\nList of Events loaded\n----------------------\n";
    var myEvents = app.eventListeners;
    for (var cpt = 0; cpt < myEvents.length; cpt++)
    tmp += "Event : " + myEvents[cpt].parent.name + "\tType: " + myEvents[cpt].eventType + "\n";
    alert ("\tTEST Area\n\t=======\n\n"+tmp);
    //******************** END Main ********************
    //****************** FUNCTIONS Definitions ********************
    function EventOpen (itsEvent)
    // app.scriptArgs.set("Event_Listener", itsEvent.parent.toSource()); //*** PASS Argument
    var myExeSrcFile = new File (app.scriptArgs.get("Event_Test"));
    if (myExeSrcFile.exists)
    if (app.pdfPlacePreferences.pageNumber == 99999)
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    else
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    EventInfo (itsEvent);
    itsEvent.preventDefault();
    itsEvent.stopPropagation();
    itsEvent.parent.windows.add(); //*** Doc. has no Window!!!
    myExeSrcFile.open ('r:(read)');
    app.doScript(myExeSrcFile, ScriptLanguage.javascript);
    myExeSrcFile.close();
    alert ("Executed...");
    else
    alert ("Error! Missing File:\n\n" + myExeSrcFile.fsName);
    return;
    function EventInfo (itsEvent)
    var myString = "Handling Event: " +itsEvent.eventType;
    myString += "\r\rTarget: " + itsEvent.target + " " +itsEvent.target.name;
    myString += "\rCurrent: " +itsEvent.currentTarget + " " + itsEvent.currentTarget.name;
    myString += "\r\rPhase: " + GetPhaseName(itsEvent.eventPhase );
    myString += "\rCaptures: " +itsEvent.captures;
    myString += "\rBubbles: " + itsEvent.bubbles;
    myString += "\r\rCancelable: " +itsEvent.cancelable;
    myString += "\rStopped: " +itsEvent.propagationStopped;
    myString += "\rCanceled: " +itsEvent.defaultPrevented;
    myString += "\r\rTime: " +itsEvent.timeStamp;
    alert(myString);
    function GetPhaseName(myPhase)
    switch(myPhase){
    case EventPhases.atTarget:
    myPhaseName = "At Target";
    break;
    case EventPhases.bubblingPhase:
    myPhaseName = "Bubbling";
    break;
    case EventPhases.capturingPhase:
    myPhaseName = "Capturing";
    break;
    case EventPhases.done:
    myPhaseName = "Done";
    break;
    case EventPhases.notDispatching:
    myPhaseName = "Not Dispatching";
    break;
    return myPhaseName;

  • Some images not loaded in flex Image Control.

    Hi,
        Can anybody help me. I am loading friends album image in flex Image control. Its strange that some image do not load even the path is fine and I can open in browser.  I think there is time out issue.
    Thanks in advance.

    Hi premkant81,
    Try to register the following event Listeners and try to trace out the problem...
    I hope you are using either Loader or URLLoader to load the images...Try to register the below  eventListeners for the Loader..and check
    HTTPStatusEvent.HTTP_STATUS
    SecurityErrorEvent.SECURITY_ERROR
    IOErrorEvent.IO_ERROR
    What is the size of the Image files you are loading...???
    Thanks,
    Bhasker Chari

  • Drag and drop data from datagrid to textInput with flex.

    Hi,
      Cay please help me out on this problem..
      I have a datagid with some values..I have a textInput on the UI..
    There is one "+" button on the UI..when i click on that button it will add one more TextInput box to the UI below the first TextInput..Like thiseverytime  when you click on the "+" button it will add one more TextInput to the UI just below the previous one..
    Now i want to drag the values from datagrid to Textinput boxes..User may drag two or more vlaues to each textInput upon his requirement..
    How can i drag ...could you please help me out on thi issue....
    I am not able to drag the values to TextInputs:
    Here is my code:::Could anyone please help me...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"   width="100%"  height="100%" creationComplete="init()">
    <mx:Script>
                <![CDATA[
                    import mx.containers.HBox;
                    import mx.controls.Alert;
                    import mx.managers.PopUpManager;
                //    import Components.testPopUpWindow;
                    import mx.core.UIComponent;
                    import mx.containers.TitleWindow;
                    import mx.core.DragSource;
                   // import mx.core.IUIComponent;
                    import mx.managers.DragManager;
                    import mx.events.DragEvent;
                    import mx.controls.Alert;
                    import mx.controls.Text;
                    import flash.geom.Point;
                 import mx.collections.ArrayCollection;
                 [Bindable]
                private var dpFlat:ArrayCollection = new ArrayCollection([
                                     {JobName:"A"},
                                    {JobName:"B"}, 
                                    {JobName:"C"},
                                    {JobName:"D"}, 
                                    {JobName:"E"},
                                    {JobName:"F"},
                                    {JobName:"G"}]);
                  private function box_addChild():void
                        var box:HBox = new HBox();
                           box.width=716;
                           var descriptionTextInput:TextInput = new TextInput();
                           var strButton:Button=new Button();
                          strButton.label="Submit";
                         descriptionTextInput.width=174;
                         descriptionTextInput.height=58;
                         box.addChild(descriptionTextInput);
                        /*     box.addChild(strButton); */
                        //    strButton.addEventListener(MouseEvent.CLICK,submitButtonClicked);
                         interactiveQuestionsVBoxID.addChild(box);
          public function init():void
            this.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
            this.addEventListener( DragEvent.DRAG_DROP, handleDrop );
          public function acceptDrop( dragEvent:DragEvent ):void
            if (dragEvent.dragSource.hasFormat("items"))
              DragManager.showFeedback( DragManager.COPY );
              DragManager.acceptDragDrop(TextInput(dragEvent.currentTarget));
          var pt:Point;
          public function handleDrop( dragEvent:DragEvent ):void
           // var dragInitiator:UIComponent = dragEvent.dragInitiator;
            //var dropTarget:UIComponent = dragEvent.currentTarget as UIComponent;
            var items:Array  = dragEvent.dragSource.dataForFormat("items") as Array;
            /* pt = new Point(dragEvent.localX, dragEvent.localY);
            pt = dragEvent.target.localToContent(pt);
            var img:TextInput = new TextInput();
              img.x=dragEvent.localX;   img.y=dragEvent.localY;
           // img.x=pt.x - Number(dragEvent.dragSource.dataForFormat("mouseX"));
              //img.y=pt.y - Number(dragEvent.dragSource.dataForFormat("mouseY"));
            img.width = 50;
            img.height=50;
            img.setStyle("fontSize",20);     // img.source="assets/" + items[0].id + ".png";
            img.text=items[0].JobName.toString();
             img.buttonMode = true;
             img.mouseChildren = false;
              TextInput(event.currentTarget).text=itemsArray[0].label;
             var itemsArray:Array = event.dragSource.dataForFormat("items") as Array; */
                    TextInput(dragEvent.currentTarget).text=items[0].label;
             public function beginDrag( mouseEvent:MouseEvent ):void
            var dragInitiator:TextInput = mouseEvent.currentTarget as TextInput;
            var dragSource:DragSource = new DragSource();
           // dsource.addData(this, 'node');
            dragSource.addData(this.mouseX, 'mouseX');
            dragSource.addData(this.mouseY, 'mouseY');
            //parent.addChild(dragImg);
            //dragSource.addData(mouseEvent.currentTarget.text, "txt");
            try{
                var dragProxy:TextInput=new TextInput();
                dragProxy.text = mouseEvent.currentTarget.text;
                   // Alert.show("Text isss"+dragProxy.text);
                   dragProxy.setActualSize(mouseEvent.currentTarget.width,mouseEvent.currentTarget .height)
                // ask the DragManger to begin the drag
                DragManager.doDrag( dragInitiator, dragSource, mouseEvent, dragProxy );
            catch(e){}   
                  ]]>
        </mx:Script>
    <mx:Canvas id="c1" width="100%" height="100%" y="10" x="10" >
    <mx:DataGrid id="d1" dataProvider="{dpFlat}"  x="10" y="119" dragEnabled="true"   dragMoveEnabled="true"  height="229" width="176"/>
    <!--<mx:Label id="lbl"   text="Job Name" width="195" height="28"  x="0" y="0" fontWeight="bold"/>-->
    <mx:Box id="questionLabelMode" direction="horizontal" width="270.5" height="24" y="76" x="211">
        <mx:Label name="Answer" width="173" text="Answer" fontWeight="bold"/>
        <mx:Button label="+" width="70" click="box_addChild();" fontWeight="normal"/>
        <!--<mx:Button label="-" width="71" fontWeight="bold" click="box_deleteChild();"/>-->
    </mx:Box>
    <mx:VBox id="interactiveQuestionsVBoxID" y="119"  height="100%" width="270.5" horizontalScrollPolicy="off" x="211">
                     <!--<mx:Box id="boxID" direction="horizontal" width="268" height="58">-->
                         <mx:TextInput id="t1" width="174" dragDrop="handleDrop(event)"    height="58"/>
                         <!--<mx:Button label="Submit" id="b1" />-->
                  <!--    </mx:Box>-->
    </mx:VBox>
            </mx:Canvas>
    </mx:Application>

    Hi Satya,
    I have done it for you ...please copy the below whole code and try to run the application. You can see the application working for you.
    You have done two mistakes --- you have added the event listeners on this object........but this refers to current object(i.e; your main application file but not TextInput).
    So you need to addEventListeners for your textinput "t1" but not to this...
    If you add the listeners on this then in your "acceptDrop" and "handleDrop" functions you will get the "dragEvent.currentTarget" as your main app but not TextInput(Since you have added listeners to "this "). If you addListeners on t1 then its correct.
    Also you need to add the eventListeners for the newly added textboxes as I done in "box_addChild" function in below code.
    Also in the handleDrop function the line of code where you are assigning the text is wrong ......it should be the below code...
    TextInput(dragEvent.currentTarget).text=items[0].JobName;
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"   width="100%"  height="100%" creationComplete="init()">
    <mx:Script> 
      <![CDATA[
                    import mx.containers.HBox;
                    import mx.controls.Alert;
                    import mx.managers.PopUpManager;
                //    import Components.testPopUpWindow;
                    import mx.core.UIComponent;
                    import mx.containers.TitleWindow;
                    import mx.core.DragSource;
                   // import mx.core.IUIComponent;
                    import mx.managers.DragManager;
                    import mx.events.DragEvent;
                    import mx.controls.Alert;
                    import mx.controls.Text;
                    import flash.geom.Point;
               import mx.collections.ArrayCollection;
               [Bindable]
               private var dpFlat:ArrayCollection = new ArrayCollection([
                                     {JobName:"A"},
                                    {JobName:"B"}, 
                                    {JobName:"C"},
                                    {JobName:"D"}, 
                                    {JobName:"E"},
                                    {JobName:"F"},
                                    {JobName:"G"}]);
                private function box_addChild():void
                    var box:HBox = new HBox();
                    box.width=716;
                    var descriptionTextInput:TextInput = new TextInput();
                    var strButton:Button=new Button();
                    strButton.label="Submit";
                    descriptionTextInput.width=174;
                    descriptionTextInput.height=58;
                    descriptionTextInput.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
           descriptionTextInput.addEventListener( DragEvent.DRAG_DROP, handleDrop );
                     box.addChild(descriptionTextInput);
                    /*     box.addChild(strButton); */
                    //    strButton.addEventListener(MouseEvent.CLICK,submitButtonClicked);
                     interactiveQuestionsVBoxID.addChild(box);
    public function init():void
         t1.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
         t1.addEventListener( DragEvent.DRAG_DROP, handleDrop );
          public function acceptDrop( dragEvent:DragEvent ):void
            if (dragEvent.dragSource.hasFormat("items"))
              DragManager.showFeedback( DragManager.COPY );
              DragManager.acceptDragDrop(TextInput(dragEvent.currentTarget));
          private var pt:Point;
          public function handleDrop( dragEvent:DragEvent ):void
           // var dragInitiator:UIComponent = dragEvent.dragInitiator;
            //var dropTarget:UIComponent = dragEvent.currentTarget as UIComponent;
            var items:Array  = dragEvent.dragSource.dataForFormat("items") as Array;
            /* pt = new Point(dragEvent.localX, dragEvent.localY);
            pt = dragEvent.target.localToContent(pt);
            var img:TextInput = new TextInput();
              img.x=dragEvent.localX;   img.y=dragEvent.localY;
           // img.x=pt.x - Number(dragEvent.dragSource.dataForFormat("mouseX"));
              //img.y=pt.y - Number(dragEvent.dragSource.dataForFormat("mouseY"));
            img.width = 50;
            img.height=50;
            img.setStyle("fontSize",20);     // img.source="assets/" + items[0].id + ".png";
            img.text=items[0].JobName.toString();
             img.buttonMode = true;
             img.mouseChildren = false;
              TextInput(event.currentTarget).text=itemsArray[0].label;
             var itemsArray:Array = event.dragSource.dataForFormat("items") as Array; */
              var currTarget:* = dragEvent.currentTarget;
              //interactiveQuestionsVBoxID = currTarget.getChildByName("interactiveQuestionsVBoxID");
                TextInput(dragEvent.currentTarget).text=items[0].JobName;
          public function beginDrag( mouseEvent:MouseEvent ):void
            var dragInitiator:TextInput = mouseEvent.currentTarget as TextInput;
            var dragSource:DragSource = new DragSource();
           // dsource.addData(this, 'node');
            dragSource.addData(this.mouseX, 'mouseX');
            dragSource.addData(this.mouseY, 'mouseY');
            //parent.addChild(dragImg);
            //dragSource.addData(mouseEvent.currentTarget.text, "txt");
            try{
                var dragProxy:TextInput=new TextInput();
                dragProxy.text = mouseEvent.currentTarget.text;
                   // Alert.show("Text isss"+dragProxy.text);
                   dragProxy.setActualSize(mouseEvent.currentTarget.width,mouseEvent.currentTarget .height)
                // ask the DragManger to begin the drag
                DragManager.doDrag( dragInitiator, dragSource, mouseEvent, dragProxy );
            catch(e:Error){}   
         ]]>
    </mx:Script>
        <mx:Canvas id="c1" width="100%" height="100%" y="10" x="10" >
      <mx:DataGrid id="d1" dataProvider="{dpFlat}"  x="10" y="119" dragEnabled="true"   dragMoveEnabled="true"  height="229" width="176"/>
      <mx:Box id="questionLabelMode" direction="horizontal" width="270.5" height="24" y="76" x="211">
          <mx:Label name="Answer" width="173" text="Answer" fontWeight="bold"/>
          <mx:Button label="+" width="70" click="box_addChild();" fontWeight="normal"/>
      </mx:Box>
      <mx:VBox id="interactiveQuestionsVBoxID" y="119"  height="100%" width="270.5" horizontalScrollPolicy="off" x="211">
        <mx:TextInput id="t1" width="174" dragDrop="handleDrop(event)" height="58"/>                    
      </mx:VBox>
    </mx:Canvas>
    </mx:Application>
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • Question related to FLexUnit4

    I am currently using flexUnit4 writing test cases for our flex project.Here is the problem
    i  am testing the remoteOBject service calls.I have eventListeners for the  ResultEvent and FaultEvent.What i want is the when a fault occurs in  the service call i want the test to fail,but that doesn'e happen.Here is  my code.
    [Test(async)]
            public function testGetPartyEditorSettingByPartyId():void
                var channelSet:ChannelSet;
                var testService:RemoteObject = new RemoteObject();
                var testPartyId:int = 0;
                channelSet = new ChannelSet();
                channelSet.addChannel(new AMFChannel("smbamf", "http://localhost-www/messagebroker/amf"));
                testService.destination = "snapFishService";
                model.channelSet = channelSet;
                testService.channelSet = model.channelSet;
                 model.partyToken =  "f3542fa156371192c39b1b620488bd6a539ee9600d5c1141dff7b38aa0ce01e9e97d  cd18dc714964cbd7adc8032c4151";
                testService.getPartyEditorSettingByPartyId(testPartyId, model.partyToken);
                testService.addEventListener(FaultEvent.FAULT,faultHandler);
                testService.addEventListener(ResultEvent.RESULT,getPartyEditorSetting ByPartyIdHandler);
            protected function faultHandler(event:FaultEvent):void
                Assert.fail(event.fault.faultString);
            protected function getPartyEditorSettingByPartyIdHandler(event:ResultEvent):void
                assertTrue(true);
    I don't know if i am doing something wrong or there is a bug in the framework.Any help on this?
    Thanks
    KB

    Hi Kimi,
    there is no API that allows to obtain the exact elements that will be
    replaced by a partial parsing run.
    Generally Xtext will try to minimize the region that needs to be
    reparsed if you type in the editor. Often that's not possible due to
    lookahead constraints e.g., but on average there is same potential to
    safe a few CPU cycles. OTOH parsing is usually not a bottle-neck as long
    as you don't use backtracking or large syntactic predicates.
    Best,
    Sebastian
    Looking for professional support for Xtext, Xtend or Eclipse Modeling?
    Find help at http://xtext.itemis.com or xtext(@)itemis.com
    Blog: zarnekow.blogspot.com
    Twitter: @szarnekow
    Google+: https://www.google.com/+SebastianZarnekow

  • Actionscript image gallery doesn't recognize load request

    Hi, I'm trying to create a five image gallery, and when I try to add the load request for the 3rd, 4th, and 5th images I get an error message that says it doesn't recognize that request: see code below:
    stop();
    //turn on buttonMode for mc's so mouse changes to hand
    one_mc.buttonMode=true;
    two_mc.buttonMode=true;
    three_mc.buttonMode=true;
    //four_mc.buttonMode=true;
    //five_mc.buttonMode=true;
    //--add button modes for 3-5 here
    //define rollovers (don't define rollOuts yet...will prevent flickering)
    one_mc.addEventListener(MouseEvent.ROLL_OVER, over1);
    two_mc.addEventListener(MouseEvent.ROLL_OVER, over2);
    three_mc.addEventListener(MouseEvent.ROLL_OVER, over3);
    //--add eventListeners for 3-5 here
    //define clicks
    one_mc.addEventListener(MouseEvent.CLICK, load1);
    two_mc.addEventListener(MouseEvent.CLICK, load2);
    three_mc.addEventListener(MouseEvent.CLICK, load3);
    //four_mc.addEventListener(MouseEvent.CLICK, load4);
    //five_mc.addEventListener(MouseEvent.CLICK, load5);
    //--add eventListeners for 3-5 here
    //turn off big rect
    bigRect_mc.visible=false;
    //create URL request to communicate to external file
    //NOTE: You will have to have an "images folder with "one.jpg" in order for this to work
    //title your files so they make sense
    var my1Request:URLRequest=new URLRequest("images/one.jpg");
    var my2Request:URLRequest=new URLRequest("images/two.jpg");
    var my3Request:URLRequest=new URLRequest("images/three.jpg");
    //--add requests for 3-5 here
    //create loader to bring in external file
    var my1Loader:Loader = new Loader();
    var my2Loader:Loader = new Loader();
    var my3Loader:Loader = new Loader();
    //--add requests for 3-5 here
    //move loaders to create room for nav
    my1Loader.x=125;
    my1Loader.y=12;
    my2Loader.x=125;
    my2Loader.y=12;
    my3Loader.x=125;
    my3Loader.y=12;
    //--add positioning for 3-5 here
    //add a close button. The new close is a reference to the CLASS NAME GIVEN IN THE PROPERTIES OF THE SYMBOL...very important!
    var close1_btn=new close();
    var close2_btn=new close();
    var close3_btn=new close();
    //--add close buttons for 3-5 here
    //choose location on the stage (my close button has the registration in the upper right)
    close1_btn.x=954;
    close1_btn.y=11;
    close2_btn.x=954;
    close2_btn.y=11;
    close3_btn.x=954;
    close3_btn.y=11;
    //--add close locations for 3-5 here
    //define event listeners
    function over1(evt:MouseEvent):void {
        //remove over event
        one_mc.removeEventListener(MouseEvent.ROLL_OVER, over1);
        //play one's timeline
        one_mc.gotoAndPlay("over");
        //add rollout
        one_mc.addEventListener(MouseEvent.ROLL_OUT, out1);
    function out1(evt:MouseEvent):void {
        //remove out event
        one_mc.removeEventListener(MouseEvent.ROLL_OUT, out1);
        //play one's timeline
        one_mc.gotoAndPlay("out");
        //add rollover
        one_mc.addEventListener(MouseEvent.ROLL_OVER, over1);
    function over2(evt:MouseEvent):void {
        two_mc.removeEventListener(MouseEvent.ROLL_OVER, over2);
        two_mc.gotoAndPlay("over");
        two_mc.addEventListener(MouseEvent.ROLL_OUT, out2);
    function out2(evt:MouseEvent):void {
        two_mc.removeEventListener(MouseEvent.ROLL_OUT, out2);
        two_mc.gotoAndPlay("out");
        two_mc.addEventListener(MouseEvent.ROLL_OVER, over2);
    function over3(evt:MouseEvent):void {
        three_mc.removeEventListener(MouseEvent.ROLL_OVER, over3);
        three_mc.gotoAndPlay("over");
        three_mc.addEventListener(MouseEvent.ROLL_OUT, out3);
    function out3(evt:MouseEvent):void {
        three_mc.removeEventListener(MouseEvent.ROLL_OUT, out3);
        three_mc.gotoAndPlay("out");
        three_mc.addEventListener(MouseEvent.ROLL_OVER, over3);
    //--add event listener definitions for 3-5 here
    define loadOne
    function load1(evt:MouseEvent):void {
        //remove any listeners you don't need
        one_mc.removeEventListener(MouseEvent.ROLL_OUT, out1);
        one_mc.removeEventListener(MouseEvent.CLICK, load1);
        //add listeners you do need
        one_mc.addEventListener(MouseEvent.ROLL_OVER, over1);
        //turn on big rect
        bigRect_mc.visible=true;
        //load image
        my1Loader.load(my1Request);
        //add image + close to display list
        addChild(my1Loader);
        addChild(close1_btn);
        //add event for close button click
        close1_btn.addEventListener(MouseEvent.CLICK, remove1);
    //define event function
    function remove1(evt:MouseEvent):void {
        //remove image & close button from display list
        removeChild(my1Loader);
        removeChild(close1_btn);
        //turn off big rect
        bigRect_mc.visible=false;
        //reset movieClip button
        one_mc.gotoAndStop(1);
        //add back necessary event listenters
        one_mc.addEventListener(MouseEvent.ROLL_OVER, over1);
        one_mc.addEventListener(MouseEvent.CLICK, load1);
    function load2(evt:MouseEvent):void {
        //remove any listeners you don't need
        two_mc.removeEventListener(MouseEvent.ROLL_OUT, out2);
        two_mc.removeEventListener(MouseEvent.CLICK, load2);
        //add listeners you do need
        two_mc.addEventListener(MouseEvent.ROLL_OVER, over2);
        //turn on big rect
        bigRect_mc.visible=true;
        //load image
        my2Loader.load(my2Request);
        //add image + close to display list
        addChild(my2Loader);
        addChild(close2_btn);
        //add event for close button click
        close2_btn.addEventListener(MouseEvent.CLICK, remove2);
    //define event function
    function remove2(evt:MouseEvent):void {
        //remove image & close button from display list
        removeChild(my2Loader);
        removeChild(close2_btn);
        //turn off big rect
        bigRect_mc.visible=false;
        //reset movieClip button
        two_mc.gotoAndStop(1);
        //add back necessary event listenters
        two_mc.addEventListener(MouseEvent.ROLL_OVER, over2);
        two_mc.addEventListener(MouseEvent.CLICK, load2);
    function load3(evt:MouseEvent):void {
        //remove any listeners you don't need
        three_mc.removeEventListener(MouseEvent.ROLL_OUT, out3);
        three_mc.removeEventListener(MouseEvent.CLICK, load3);
        //add listeners you do need
    three_mc.addEventListener(MouseEvent.ROLL_OVER, over3);
        //turn on big rect
        bigRect_mc.visible=true;
        load image
        my3Loader.load(my3Request);
        add image + close to display list
        addChild(my3Loader);
        addChild(close3_btn);
        add event for close button click
        close3_btn.addEventListener(MouseEvent.CLICK, remove3);
    //define event function
    function remove3(evt:MouseEvent):void {
        remove image & close button from display list
        removeChild(my3Loader);
        removeChild(close3_btn);
        //turn off big rect
        bigRect_mc.visible=false;
        reset movieClip button
        three_mc.gotoAndStop(1);
        add back necessary event listenters
        three_mc.addEventListener(MouseEvent.ROLL_OVER, over3);
        three_mc.addEventListener(MouseEvent.CLICK, load3);
    //--add other events here

    copy and paste the error message after clicking file/publish settings/flash and ticking "permit debugging".  specify the line of code with the error mentioned in the error message.

  • Button issue...new to flash

    I am just learning flash and actionscript...bear with me.
    I'm building a very basic flash website using buttons and the
    goToAndStop method, and I'm currently working on navigation between
    the various pages (frames). The site consists of a main page
    (frame1) and six other pages (frames 2-7). Frame 1 has 6 buttons
    that trigger event listeners which navigate to their respective
    frames. Frames 2-7 also have those 6 buttons, plus and additional
    button that should navigate back to frame 1.
    In testing the site, the 6 buttons (for frames 2-7) work
    properly on all frames, but the additional button (for frame 1)
    doesn't work consistently. The button appears all the proper
    frames, its mouseover and click properties work properly, but it
    doesn't navigate to frame 1 every time, only rarely and
    sporadically.
    My actionscript is as follows:
    on frame 1 I have all the functions and eventlisteners for
    buttons 2-7
    then on frame 2 (through 7) I have the function and
    eventlistener for button 1
    There are no errors reported in the actionscript.
    Why would that button only work on frame 2? If the script
    covers all the frames, it should remain functional, no? Is this a
    problem with my scripting/design, or is the Flash movie tester
    glitchy?
    Thanks

    The reason it only works sporadically is if you've hit frame
    2 before clicking that button. if you hit frame 5, the listener for
    that button never registered.
    Keep the additional "go home" button, and its listeners and
    handlers (functions) as well, all on frame 1. Just move the "go
    home" button off the stage (out of sight) on frame 1. That way you
    ensure all your listeners are registered and listening on the start
    of the movie, and that the object exists on the display list,
    albeit out of bounds.

  • Adding swf animation to Captivate Slide

    Hello Forum Members,
    I have a problem. I just used Flash (CS3 Pro) to make a small
    animation that moves a few objects
    across the stage, and has glow filters, etc. I have also
    added eventlisteners for mouse over and mouse out on this swf. The
    swf plays fine in standalone mode (in Flash Player, etc). I have an
    object that gets created via action script in this swf as well as
    objects already on the stage (design time).
    I then insert this swf file into a Captivate (3.0) slide -
    the animations do not play correctly, my object that gets created
    in the swf timeline never appears, and the rollover/out actions do
    not play. Am I not understanding the capability of Captivate to
    "play" Flash animations? I was hoping to use this flash element in
    my Captivate project.
    Thanks for a helpful forum,
    eholz1

    Thanks for your reply!  Here's a better explanation of my end goal.
    I want to create a software simulation.  I want my question to look and
    function interactively in a limited way just like the piece of software.  I
    will then ask them to do a task using this software and mark them correct if
    they finish it correctly.
    For example, if I was using MS Word I want a master slide that includes the
    menu drop downs and hover effects that would match the actual program.  I
    could use those over and over and each question just add the content unique
    for the question.
    Does that make sense?  Can Captivate do that?

  • Problem referring to on-stage movieclips from an array

    I have a movieclip on the stage in which I have some 90
    movieclips also on the stage.
    I created an array to hold the movieclips.
    But when I try to add eventlisteners to these movieclips by
    cycling through the array, I get a 1009 error ("Could not parse the
    XML. Error #1009: Cannot access a property or method of a null
    object reference.") Oddly, however, the application seems to work
    correctly, handling my listener events.
    On the other hand, if I add eventlisteners for each movieclip
    individually, all works fine--no errors are thrown.
    Can anyone please point out my error?

    I found the problem...
    I feel sheepish about this, but I misspelled one of the
    movieclip instance names in the code (there are 90 of these
    movieclips).
    That's why the error was thrown, but parts of the application
    still worked.
    Thanks to all who replied!

  • AS2 or AS3

    Hello, i'm somewhat decent in flash. I know AS2, i started
    learning AS3 today and find it to be more complicated and has so
    many extra steps in coding. Number one thing i hate is having to do
    all the code on the timeline, it will get so full of code if i have
    several buttons/movieclips that need code, no way to do code when
    you click on the button/movieclip in AS3 unlike 2.
    Would it be dumb for me to continue to use AS2 and learn more
    of it, or should i keep trying to learn AS3..... I don't do super
    complex stuff, mostly timeline navigation and animations.
    I also feel like there is way more room to make errors in 3
    because you have to type everything unlike AS2 where i was able to
    use the actions frame (use that plus tool that had the drop down
    menu).

    I'm in the same position, just starting to move from
    intermediate comfort with AS2 to a fresh beginning with AS3...not
    so easy for a guy who has so little logical thinking that I failed
    algebra in high school! I too am a bit annoyed by all the extra
    steps involved, such as having to add EventListeners for mouse
    events, when these really ought to be simplified and there by
    default, like in AS2. For example, why can't onMouseDown remain as
    a built-in behavior rather than having to take up 2 lines of code
    to insert it each and every time now?
    On the other hand, I am delighted at the way a lot of the
    inconsistencies in AS2 have been gotten rid of. No more having to
    remember when to put .x and when ._x, and so on. And now that I'm
    finally starting to learn how to use external classes, I see the
    beauty in it, and AS3 is custom-made for this. It seems that if you
    ever want to really advance in ActionScript programming, you need
    to start working with creating your own classes, and as long as
    you're going to learn those from scratch, may as well learn it in
    AS3.
    Putting AS on buttons was outdated practice years ago. It
    makes much greater sense to place all script on the timeline, with
    comments to separate it. Try programming the simplest game where
    objects are moving around and colliding, all controlled by script,
    and then a couple coded buttons control them. Bugs are inevitable,
    and debugging script when it's partly on the timeline, some is
    attached to main movie buttons, and some attached to movie clips
    inside movie clips, is a nightmare. Once you do scripting on the
    timeline, you'll never want to go back to the crude practice of
    attaching script to objects.
    Overall, it's a steeper climb than I'd have liked, to upgrade
    my knowledge from AS2 to AS3. But ultimately I think it's the best
    idea.

  • Flash Banners Click tag info wars AS2  or 3

    I do a lot of Flash banners for clients, I have a situation where I had a client send me this article
    http://www.flashclicktag.com/
    and tell me that I should not be using Flash for banners in AS3.
    I have click or clikTag info for AS2 and 3
    AS2
    on (release) {
    if (_root.clickTAG.substr(0,5) == "http:") {
    getURL(_root.clickTAG, "_blank");
    CLICK TAG AS 3.0
    myButton.addEventListener(  MouseEvent.CLICK, 
    function():void { 
    if (root.loaderInfo.parameters.clickTAG.substr(0,5)=="http:") { 
    navigateToURL( 
    new URLRequest(root.loaderInfo.parameters.clickTAG), 
    "_blank" 
    I even have the click tag code for Google Ad serve which just replaces the & with~
    ButtonName.addEventListener(MouseEvent.CLICK, functionName)
    function functionName(event:MouseEvent) : void
         if (root.loaderInfo.parameters.clickTAG.substr(0, 5) == "http:")
             Url = String(root.loaderInfo.parameters.clickTAG).split
    ("~").join("&");
             navigateToURL(new URLRequest(Url), "_blank");
         }// end if[/code]
    In an honest opinion which format should I use? as I don't need to do double the work to re do from AS3 to AS2. Obviously some as services will only allow AS2 for clickTag info.
    any help?

    I'm in the same position, just starting to move from
    intermediate comfort with AS2 to a fresh beginning with AS3...not
    so easy for a guy who has so little logical thinking that I failed
    algebra in high school! I too am a bit annoyed by all the extra
    steps involved, such as having to add EventListeners for mouse
    events, when these really ought to be simplified and there by
    default, like in AS2. For example, why can't onMouseDown remain as
    a built-in behavior rather than having to take up 2 lines of code
    to insert it each and every time now?
    On the other hand, I am delighted at the way a lot of the
    inconsistencies in AS2 have been gotten rid of. No more having to
    remember when to put .x and when ._x, and so on. And now that I'm
    finally starting to learn how to use external classes, I see the
    beauty in it, and AS3 is custom-made for this. It seems that if you
    ever want to really advance in ActionScript programming, you need
    to start working with creating your own classes, and as long as
    you're going to learn those from scratch, may as well learn it in
    AS3.
    Putting AS on buttons was outdated practice years ago. It
    makes much greater sense to place all script on the timeline, with
    comments to separate it. Try programming the simplest game where
    objects are moving around and colliding, all controlled by script,
    and then a couple coded buttons control them. Bugs are inevitable,
    and debugging script when it's partly on the timeline, some is
    attached to main movie buttons, and some attached to movie clips
    inside movie clips, is a nightmare. Once you do scripting on the
    timeline, you'll never want to go back to the crude practice of
    attaching script to objects.
    Overall, it's a steeper climb than I'd have liked, to upgrade
    my knowledge from AS2 to AS3. But ultimately I think it's the best
    idea.

Maybe you are looking for

  • How can I create a filter from a contact list?

    I have a lot of classes that I teach. I have created an email contact list for all of my individual classes, which I would like to create a single fitler for each of these list, in order to put them into a corresponding folder. It would save me a lot

  • Null pointer exception with inner class

    Hi everyone, I've written an applet that is an animation of a wheel turning. The animation is drawn on a customised JPanel which is an inner class called animateArea. The main class is called Rotary. It runs fine when I run it from JBuilder in the Ap

  • I can ot open raw photos in elements

    I have put photoshop elements 9 on a desktop and raw nef files will not open

  • Strange touch screen behaviour

    I am having trouble with the touch screen of my iPhone 3G: The bottom row of buttons is not functioning properly when typing a SMS or typing in Safari. When I try to write a new SMS message in the chat view, I can't, because the bottom of the screen

  • Prozesstypen - Data Warehouse Management - SAP Library

    To add a comment, please log in or register on the top of this page and choose Reply. Please write your comment in English. You can also go back to the SAP help page.