EventListener not working - AS2

I have been tearing my hair out on this one.
I found some code on a FAQ site that seems like it should work, but I can't get it to function. I have put an .flv video into my scene, it plays fine, but then I need the program to move to the next scene.
Here is the code:
onClipEvent (enterFrame) {
     var listenerObject:Object = new Object();
     listenerObject.complete = function(eventObject:Object):Void {
          stopAllSounds();
          trace ("Event Fired");
          _root.gotoAndPlay("First Time User",1);
     this.addEventListener("complete",listenerObject);
I added in the trace to see if the function was firing at all, and I actually get the message in my output 12 times!
I'd really appreciate any help with this.
TIA,
Jason

again, delete the code you are using.  there are so many problems with that code, it is not salvageable.
click on logoFLV and cut the contentPath string from the properties panel.
attached to the frame that contains logoFLV, what trace output do you see when you copy and paste the following code.  change nothing except to assign the path/name for your flv and allow to run until your video ends.
stop();
     var listenerObject:Object = new Object();
     listenerObject.complete = function(eventObject:Object):Void {
          stopAllSounds();
          trace ("Event Fired");
clearInterval(traceI);
         // _root.gotoAndPlay("First Time User",1);
_root.gotoAndPlay("First Time User");  // don't use scenes in navigation with as2.  use frame labels only.
logoFLV.addEventListener("complete",listenerObject);
logoFLV.contentPath = "path/filename.flv";   // paste the contentPath string you cut from the properties panel.
var tl:MovieClip=this;
trace(logoFLV,this,this._currentframe);
clearInterval(traceI);
traceI=setInterval(traceF,3000);
function traceF():Void{
trace(tl._currentframe);

Similar Messages

  • Captivate 4 AS2 Text Entry Box not working with Flash Player 11

    I am having issues with text entry boxes not working at all in flash 11. I am using Captivate 4 and exporting an AS2 swf. When you get to the slide you can type but you cannot see anything nor does the button or keystroke to move on. Also there is no cursor. Any ideas?

    You said it is not working with Flash 11, so does that mean you tested with previous version and that worked?
    While publishing choose Flash player as 9 and publish that, verify if that plays in a compatible web browser.
    AS 2 is a legacy scripting, it has been said not too be supported with even Flash Player 10 --
    http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html
    I believe if you switch back to version 9 while publish your project, it should work.
    Thanks,
    Anjaneai

  • As2 fscommand not working

    Basically I want to use fscommand to write a local file. I think there may be some issues -- 
    variable = "1235";
    path = "file.txt";
    fscommand ("save", path);
    textbox1.text = "HI"; //just so i know it is getting to this point.
    One, does this work on vista? I am running vista so that may be why its not working.
    Two, I also heard rumors about it not working in IE7 or higher, is that true?
    Three, I also have read that it only works when running the swf file in flash projector, is that true?

    If I understand you correctly, I think the 'shared object' might be what you need.
    The AS2 Language Reference in F8 starts off like this:
    "The SharedObject class is used to read and store limited amounts of data on a user's computer. Shared objects offer real-time data sharing between objects that are persistent on the user's computer. Local shared objects are similar to browser cookies. ....."
    hope that helps.

  • AS2 button actions not working

    I've created a dropdown menu movie clip, and I want the various buttons in the dropdowns to link to various Scenes.
    When I test the movie the dropdown menus perform as intended, and the buttons appear to have rollover states, but they do not link to my additional Scenes.
    I have gone into the movie clip containing the buttons, and given the buttons instace names, and then added the following AS2 script to go to the next scene, but it does not work:
    displayB_btn.onRelease=function() {
        gotoAndStop("Scene 2",1);
    In a nutshell, I cannot move beyond Scene 1.
    I have tried making the instances movie clips rather than buttons, but that has created its own problems.
    Hope someone can help.
    Thanks in advance.

    in as2, do not use scenes for navigation and do not use the goto functions.
    use frame labels and use the goto methods:
    _root.gotoAndStop("scene2_frame1");

  • Flash, AS2 fscommand not working

    hi,
    I have a flash application working fine in a html page. i want to add javascript interaction.
    I see that i have to use fscommand . when i compile and execute my flash application inside flash CS4 and test it directly from the generation directory (D:\dev\flash\myApp), it work find.
    If i copy my project directory in another directory (D:\dev\flash\release\myApp), it's not working.
    I don't understand why !
    I never reach the javascript code.
    Thanks for your help.

    If I understand you correctly, I think the 'shared object' might be what you need.
    The AS2 Language Reference in F8 starts off like this:
    "The SharedObject class is used to read and store limited amounts of data on a user's computer. Shared objects offer real-time data sharing between objects that are persistent on the user's computer. Local shared objects are similar to browser cookies. ....."
    hope that helps.

  • [as2] Class is not working

    Hi.
    I have two levels one for "movie1.swf" the other "movie2.swf",
    movie1 is on level 0, movie2 is on level 1.
    I made a class "MySound", a class that extends the Sound class.
    The problem is that I tried to use MySound class on movie2 and is not working.
    It only works when I use MySound class on level 0.
    Why?
    Other thing.
    The Sound class constructor function has a parameter "target" use to
    point to a object. I think it is use to setVolume and other things.
    How can I use the same method?
    I´ve tried to setVolume with my class ("MySound"), once for each
    sound and it worked for both, I mean, example, I have sounds "s1"
    and "s2", I tried to set the volume of s1 to 50 and s2 to 0 like this:
    s1.setVolume(50)
    s2.setVolume(0)
    But, both sounds volume were setted to 0.
    How can I use the same method of targeting an object so the setVolume
    works properly in MySound class?
    Note:
    MySound class has no constructor function declared, so I thought it could
    work the same as Sound class.
    How can I use setVolume method in MySound class?
    The main reason I´m making a MySound class is because in MySound class I have methods that pauses and resumes the current sound object.
    I know I can make it directly through script with Sound class, but with MySound class it gets better to write script to work with sounds.
    So I can just use s1.pause() s1.resume(), instead of creating a variable each time for each sound object.
    Any help?
    Thanks

    hi
    I had put auto-start=true in server.xml .then also it is not working.
    when I redeploy my ear,the startup class is invoked,but when i restart the
    server it does'nt
    gaj

  • Flash 8 AS2 coding not working

    We have an application that creates a page turner type of
    documents. We have a player to put it all together but one of our
    client wants to import this in Presenter.
    We created a "loader" type of swf to load the application and
    kept the rest of the player, trimmed down, but we have issue with
    the "flipping page" feature. It use the flash.display.BitmapData
    package that comes in Flash 8, but it looks like it is not working.
    The content is not redrawn to the curve, the image is tiled in the
    area it is supposed to fill. We had this problem once when the
    player we had was compiled in Flash 7.
    Is it possible that the flash version that Presenter use is
    not 8? Even if the documentation say that Flash 8 is the minimum to
    view the content. Is there a workaround or update to F8 in the
    pipes?

    Your not the only one who is having troble with flash. I here
    to find help with the same situation. My friend has installed
    version 9 and can't view anything on the internet that uses flash.
    But the other account user can. Whats up. All internet options are
    the same...

  • As2 form not working within action scripts

    this script is working on online but when i put this code within my project action scripts, its not working,,,
    stop();
    System.useCodepage = true;
    send_btn.onRelease = function() {
        my_vars = new LoadVars();
        my_vars.sender = email_box.text;
        my_vars.subject = subject_box.text;
        my_vars.message = message_box.text;
        if (my_vars.sender != "" and my_vars.subject != "" and my_vars.message != "") {
            my_vars.sendAndLoad("mailer.php", my_vars, "POST");
            gotoAndStop(72);
        } else {
            error_clip.gotoAndPlay(72);
        my_vars.onLoad = function() {
            gotoAndStop(73);
    email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function () {
        if (error_clip._currentframe != 1) {
            error_clip.gotoAndPlay(6);

    Are you testing on a server?  If not, do you have PHP installed to support trying to call upon a PHP file?

  • Barcode report is not working in linux

    hi,
    i am running the report using the barcode, which is running perfectly in the windows server - i meant in the report builder.
    but when i try run the same report in linux server through application, i am getting the below mentioned error:
    Terminated with error:
    REP-1401: 'beforereport': Fatal PL/SQL error occurred. ORA-39565: Message 39565 not found; product=RDBMS; facility=ORA
    below mentioned is the code written in beforereport trigger:
    globals.barcode_to_use := BarCodeConstants.BAR_CODE_128;
    globals.bcobj := barcodemaker.new();
    i have include the jar file path /ora/u01/oracle/v101/ds1/reports/jlib/oraclebarcode.jar both in class path and report_path, but still its not working.
    any one had solve this issue?...pls help me out
    for you info:
    CLASSPATH=/ora/u01/oracle/v101/ds1/j2ee/OC4J_BI_Forms/applications/formsapp/formsweb/WEB-INF/lib/frmsrv.jar:/ora/u01/oracle/v101/ds1/jlib/repository.jar:/ora/u01/oracle/v101/ds1/jlib/ldapjclnt10.jar:/ora/u01/oracle/v101/ds1/jlib/debugger.jar:/ora/u01/oracle/v101/ds1/jlib/ewt3.jar:/ora/u01/oracle/v101/ds1/jlib/share.jar:/ora/u01/oracle/v101/ds1/jlib/utj.jar:/ora/u01/oracle/v101/ds1/jlib/zrclient.jar:/ora/u01/oracle/v101/ds1/reports/jlib/rwrun.jar:/ora/u01/oracle/v101/ds1/forms/java/frmwebutil.jar:/ora/u01/oracle/v101/ds1/reports/jlib/oraclebarcode.jar
    RW=$ORACLE_HOME/reports; export RW
    REPORTS_PATH=$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo:$ORACLE_HOME/reports/integ:$ORACLE_HOME/reports/printers:${REPORTS_PATH}; export REPORTS_PATH
    REPORTS_TMP=/tmp; export REPORTS_TMP
    REPORTS_NO_DUMMY_PRINTER=TRUE; export REPORTS_NO_DUMMY_PRINTER
    REPORTS_TAGLIB_URI=/WEB-INF/lib/reports_tld.jar; export REPORTS_TAGLIB_URI
    REPORTS_CLASSPATH=$ORACLE_HOME/reports/jlib/rwbuilder.jar:$ORACLE_HOME/reports/jlib/rwrun.jar:$ORACLE_HOME/jlib/zrclient.jar:$ORACLE_HOME/j2ee/home/oc4j.jar:$ORACLE_HOME/j2ee/home/lib/ojsp.jar:$ORACLE_HOME/reports/jlib/oraclebarcode.jar; export REPORTS_CLASSPATH
    repserver.conf file setting:
    <engine id="rwEng" class="oracle.reports.engine.EngineImpl" initEngine="1" maxEngine="1" minEngine="0" engLife="50" maxIdle="30" callbackTimeOut="90000" jvmOptions="-Xms512m -Xmx512m" classPath="/ora/u01/oracle/v101/ds1/reports/jlib/oraclebarcode.jar">
    <property name="sourceDir" value="/ora/u02/oraadmin/config/as2/app_qits_run"/>
    <property name="tempDir" value="/ora/u02/oraadmin/config/as2/app_qits_tmp"/>
    </engine>
    <engine id="rwURLEng" class="oracle.reports.urlengine.URLEngineImpl" initEngine="1" maxEngine="1" minEngine="0" engLife="50" maxIdle="30" callbackTimeOut="60000" classPath="/ora/u01/oracle/v101/ds1/reports/jlib/oraclebarcode.jar"/>
    thanks
    renjish

    Hello,
    The first step if to find the PL/SQL line causing the error in 'cf_1formula':
    create a procedure Trace in your Reports : (modify the line trace_file := Text_IO.Fopen('d:\temp\rep_trace.txt', 'A'); to adapt the filename to your system)
    PROCEDURE Trace (trace_string in varchar2) IS
    trace_file Text_IO.File_Type;
    BEGIN
    trace_file := Text_IO.Fopen('d:\temp\rep_trace.txt', 'A');
    Text_IO.Put_Line(trace_file, trace_string);
    Text_IO.Fclose (trace_file);
    END;
    Then, add some calls to this procedure in the program unit 'cf_1formula'
    trace('Before line 1';
    <PL/SQL code of line 1>
    trace('Before line 2';
    <PL/SQL code of line 2>
    trace('Before line 3';
    <PL/SQL code of line 3>
    Excecute the Reports and find in the file 'd:\temp\rep_trace.txt' the last line executed.
    Regards

  • Simple button script not working

    I am using AS2 and need help figuring out why this simple button script is not working:
    stop();
    buttonWS1.onRelease = function(){
                        gotoAndStop("Stage1and2_Boss",4);
    buttonWS2.onRelease = function(){
                        nextFrame();
    //end
    My buttons are the square letter-puzzles below. They are images that I converted to "symbols" (specifically, buttons). I put their names as above (buttonWS1, buttonWS2, etc.) in the "instance names" boxes.
    I have no idea what is going on. Please help!

    Hi -
    1. Yes, buttonWS2 is the instance name
    2. The only code attached to it is the code I pasted above.
    3. onRelease does not execute because my trace statement does not appear in the output
    Here is the modified code for buttonWS2:
    buttonWS2.onRelease = function(){
                        trace("clicked!");
                        nextFrame();
    Question: It shouldn't matter if I have commented-out code within that set of codes should it?:
    buttonWS2.onRelease = function(){
              //if (puzzleschosenarray[0] == 2 || puzzleschosenarray[1] == 2) {
              // cannot be chosen -- make button non-functional
              //else{
                        //puzzleschosenarray[roundnumber-1] = 2;
                        trace("clicked!");
                        nextFrame();

  • In some pc ActionScript not working even after running the .SWF or .EXE, what may be the problem ?

    In my flash project i am using ActionScript to get FULLScreen and mouse hide action. I hv already used the AS3 in Adobe Flash CC and AS2 in Adobe Flash CS6.  All my files are working well, both .SWF and .EXE (projector..) . But the client is saying in his pc the Full SCREEN and Mouse hide is not working. I instructed to update the flash player plugins, still they are getting the same issue. What is the matter pls any one guide us. My code is in the first frame of Flash file which is mention below.
    /*AS2 code*/
    fscommand("fullscreen","true");
    Mouse.hide();
    /*AS3 code*/
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    stage.scaleMode = StageScaleMode.SHOW_ALL;
    Mouse.hide();

    Hi all, few days ago the client told , one of the project file (.SWF and .EXE) showing full screen. Again day before yesterday the client again said, all the project files working Full Screen and Mouse hide action. Still i do know such happens ? if any technical issue is behind its problem than anyone pls inform me. However it is running well in their PC now.

  • "open file" Not working with Photoshop CS2

    System
    MAc Pro Dual Quad 3Ghz, OS X 10.5.2
    I have a script that I wrote a while ago to take a series of individual bitmaps and compile them into a strip for access inanothe application. Script used to work well....
    I tried to use the script today but ran into a brick wall when trying to open files from within the script.
    below is an example of a script that will not work at all,
    tell application "Adobe Photoshop CS2"
    open file "AV:logo:rot0001.png"
    end tell
    I normally pass the function a variable for the filenames...but the above script should work fine.. but flatly refuses to !
    Below is the Error returned.
    Adobe Photoshop CS2 got an error: General Photoshop error occurred.
    - The object “current document” is not currently available.
    Arghhhh Help !!
    Rgds
    Chris

    Hello
    Perhaps your script used to work under pre-OSX10.5 (AppleScript 1.x) but now fails under OSX10.5 (AppleScript 2.x)?
    If so, the most likely cause is the drastic change in internal text handling between them. In AS2.x, internal text is Unicode only, which might prevent PSCS2 from resolving 'file path_string' descriptor (when path_string is assumed to be plain 'string', not Unicode text).
    Try the following code instead -
    tell application "Adobe Photoshop CS2"
    open ("AV:logo:rot0001.png" as alias)
    end tell
    Or -
    set a to "AV:logo:rot0001.png" as alias
    tell application "Adobe Photoshop CS2"
    open a
    end tell
    Hope this may help,
    H

  • Animated drop down buttons not working in movie clip

    Hi,
    I am working on this site: (AS2)
    http://www.steamandclean.com/Index_w_1.html
    I have two types of drop down menu. One under Commercial and one under Technical
    The buttons are movie clips. The drop downs are also movie clips that start in frame 2 and are triggered on rollover.
    The child buttons are buttons living on the drop down movie clips. They are set to getURL
    As you see they are not willing to neither link to any url or will they run their move clip animation. One is a button and one is a movie clip.
    The left movie clip has a mask, but it makes no difference if I remove the mask . It also has a emboss filter and no difference is I take that away either.
    All of it is in one flash movie right now, but I will be splitting it up in a master navigation movie and individual swf's soon.
    Right now I have the main movie, then the button MC then the dropdown MC and in the drop down MC I have placed either a animated (button) MC or a button. So it nested in nested in.......
    In both cases I scripting the child buttons like this:
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay(6);
    on (release) {
    getURL("http://steamandclean.com");
    I have also tried to use
    _parent.getURL and _root.getURL in stead of just get URL, but it does not work.
    The drop down buttons seem to be buried. In the left side the whole drop down panel seems to act like a link?
    What am I doing wrong?
    Can you help?
    ggaarde

    Hi Ned
    Thank you for your reply again.
    I figured it out.
    Your reply prompted me to have my main button on rollover to go to a frame number on the main time line and then move the content of the drop down movie clip to that frame.
    The drop down panel now work and the child buttons animation now work as well. I just had to find a way to make the drop down panel disappear on rollout. Since I could not script the actual drop down panel I created three skinny invisible buttons and placed them on the right, left and button of the drop down panel. I scripted them to go back to frame 1 on both rollover and rollout. Done.
    See the result there:
    http://www.steamandclean.com/Index_w_1.html
    (Left side only)
    Thank you for your help.
    ggaarde

  • ComboBox not working correctly

    Hi there,
    I am developing a small Flash (AS2) application, using Flash
    CS3, and have run into a problem with the ComboBox componet.
    I am loading another movie into the main movie with the
    following code:
    var container = _level0.createEmptyMovieClip("ui_slider",
    _level0.getNextHighestDepth());
    trace("On last frame");
    container.loadMovie("ui-sliderv2.swf");
    ui_slider._x = 60;
    ui_slider._y = -382
    everything works fine, but none of the comboBoxes are
    working. I can see the first item that can be selected, but the
    pull-down selection is not working. Nothing happens when I click
    it.
    the ui-sliderv2.swf movie works as expected when run on its
    own.
    Here are the links to the SWF.
    http://www.rmp-consulting.com/chomonicx/Chomonicx.html
    The menu SWF on it's own:
    http://www.rmp-consulting.com/chomonicx/ui-sliderv2.html
    Any suggestions?

    apply _lockroot = true to the movie clip that the SWF is
    loaded into.

  • Preloader not working !!!

    Hi All,
    I used 2 preloaders code, but both are not working !!!, what problem with this code ?
    script 1
    stop();
    this.addEventListener(Event.ENTER_FRAME, loading);
    function loading(e:Event):void
              var total:Number = this.stage.loaderInfo.bytesTotal;
              var loaded:Number = this.stage.loaderInfo.bytesLoaded;
              loader.kolam.loadTxt.text = Math.floor((loaded/total)*100);
              if (total == loaded)
                        this.removeEventListener(Event.ENTER_FRAME, loading);
                        loader.nextFrame()
    script 2
    var preLoaderPercent:Number;
    this.loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
    this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
    function loadComplete(e:Event)
              this.loaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
              this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
         loader.nextFrame();
    function loadProgress(e:ProgressEvent):void
              preLoaderPercent = e.bytesLoaded / e.bytesTotal;    
         loader.kolam.loadTxt.text = preLoaderPercent;

    You could say as3 is fixed for expected behavior. Why should an ENTER_FRAME event fire off before the document is even loaded?
    A preloader is always a good idea. Give it a try. Being there's no more as2 nonsense about using _root to gain access to movieclips and code, a preloader won't screw up your code anymore by being what we used to think of as "_root".
    Try building the stub as I mentioned and use the Loader class to load that SWF. Here's a tutorial.
    e.g.
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.ProgressEvent;
    // init a new loader
    var preload:Loader = new Loader();
    // listen for loading complete
    preload.contentLoaderInfo.addEventListener(Event.COMPLETE, preloadCompleteHandler);
    // listen for errors
    preload.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, preloadErrorHandler);
    // listen for progress!
    preload.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preloadProgressHandler);
    // load my content
    preload.load(new URLRequest("myContent.swf"));
    // handlers
    // handle complete
    function preloadCompleteHandler(e:Event):void
         // load complete! add to display list, remove preloader visuals, etc
         addChild(preload); // a loader is a display object, you can add it directly
    // handle error
    function preloadErrorHandler(e:IOErrorEvent):void
         // do what you wish if there is an error loading the SWF
         trace(e);
    // progress handler
    function preloadProgressHandler(e:ProgressEvent):void
         // display the progress in some way
         var bytesLoaded:int = e.bytesLoaded;  // current bytes loaded
         var bytesTotal:int = e.bytesTotal;         // total bytes to load
         // now do what you want, like ver a percent loaded
         var percent:Number = bytesLoaded / bytesTotal * 100;
         trace(percent + " loaded");

Maybe you are looking for