problem of scope function AS2 classes

The problem I have is the scope. XML as part of my code cannot call methods encoded in my class. His "' is not my class, but the object XML itself. I have the same problem when I use other objects like flash (setInterval...), I don't know that I need to learn something. I tried with Delegate.create but even that cannot reach it.

How can I call the function say() off function of loading xml mu?

found here http://osflash.org/flashcoders/as2

Tags: Adobe Animate

Similar Questions

  • problem of scope within the class with delivery

    Hello.. I have a class in which there are properties (IE - _myColor).

    Now suppose in my class, I have a defined delivery function...

    IE

    targetMc.myBtn.onPress = function (): Void {}
    trace ("the value is:" + _myColor);
    }

    Now obviously this won't work because it is out of reach.

    What is the right way to access the property of said of the delivery which resides IN the class file as well?

    Thank you!

    You can use a local reference to the current object or use the delegate class. See examples attached.

  • Problem in calling function AM

    Hi team,

    I created the function of class AM and I wanted to update the column in a table.

    Here's the code for it

    ' public void updateEmployee (int count, int empid)
    {
    DBTransaction trans = getDBTransaction();
    CallableStatement statement = null;
    int lines = 0;

    String updateSql = "start."
    + "UPDATE EMPLOYEES".
    + "' SET checkcount = checkcount +? '"
    + "' WHERE employe_id =?; '"
    + "END;";
    Statement = trans.createCallableStatement (updateSql, 2);

    Try
    {
    statement.setInt (1, count);
    statement.setInt (2, EmpId);
    lines = statement.executeUpdate ();


    System.out.println ("value of line is" + lines);

    } catch (SQLException s)
    {
    throw new Aexception.getLocalizedMessage (s);
    }
    {Finally
    try {}
    If (declaration! = null)
    Statement.Close ();
    } catch (SQLException s)
    {/ * ignore * /}
    }

    This statement is "System.out.println ("value of line is"+ lines);" gives the result that "the value of line is 1.



    I am the appellant through a managed bean code is pasted below

    BindingContainer links = getBindings();
    OperationBinding oprBndng = bindings.getOperationBinding ("updateEmployee");

    oprBndng.getParamsMap () .put ("deptId", v_empId);
    oprBndng.getParamsMap () .put ('count', v_count);
    Object result = oprBndng.execute ();

    System.out.println ("result =" + result);

    If (! oprBndng.getErrors () .isEmpty ()) {}
    Returns a null value.
    }

    I run in debug mode and it is haltering to "oppose result = oprBndng.execute ();" statement.

    The problem is when I call you this bean managed on a button click, I am able to navigate to the next page, but the column is not updated.
    This SOP line displays System.out.println ("result =" + result); NULL in the result variable.


    Can you guide me please I do it the correct way or how can I check what stage I am failing.

    The pointers will be appreciated.

    Thank you
    Ajay

    You have a mismatch between the implemented method (which returns int) and the client interface (which has the old signature where the method return void).
    To solve this open the module of the application, go to the client interface and the remove method of the selected list (right). You my find the method two times in the selected list, be sure to remove both.
    Close the module the application and rebuild the model project (better do a before cleaning). If you see no errors, you can open the module of the application again and add the method to the client interface. Recompile again and it should work.

    Timo

  • Is this a problem of scope of quiz?

    I did a lot research forum on Captivate quizzes, including the large lilybiri workarounds.

    I think that if so many workarounds are needed to reach basic design options, Captivate quiz needs some TLC from Adobe and I presented a few enhancement requests to this effect. However, I digress...

    I would like to know if it is a question of importance quiz:

    I have six review questions in my class. They are not marked, unpublished. They are just interspersed with control.

    I have a test at the end of race that has the possibility of review allowed. To the best of my knowledge (having considered advanced interaction), the first object to report, measurable is the first issue of the test in the test.

    When the test is finished, when I click on review, it takes me to the first issue, not the first question on the test. I think that review should not take me to a question which is out of reach of the fact are not reported or marked.

    Is this correct?

    I don't know what else on the issue of the magazine puts at your fingertips.

    Similarly, all test questions are included in the number of test question, but I suppose that, being out of reach, that they are not.

    This seems more difficult than it should be. Given the number of questions on the forum, it's confusing and a little stiff without a bunch of custom coding.

    You are right that it is a problem of scope of quiz.  Captivate cordially a quiz question as within quiz regardless of if you had unchecked it under Reporting.  What this box is not answers report, that is, answers to the question was one that the user selected.  The slide of the question itself is always included in the scope of quiz.

    In this case, it seems the developers Adobe did not initially consider the many and various ways course developers would use the question slides.  They did not allow the fact that you have the question slides in your project that were NOT part of the quiz.  You aren't the first person to notice this omission. Please do not hesitate to sign a request for improvement for review 6 Captivate and add your voice to those hoping wore quiz will be changed in the next version of Cp.  You never know your luck in the big city...

  • help - problem with a function

    There's a good scenario Kasyan here he prepared for one of my tasks / a special workflow:

    Imagine that you have a document with a hundred pages and all pages contain an image and a text box with individual photo credit / description.

    The script is paste each image text box in the description of the images via the bridge - great, fast xmp and I have never seen anything like this elsewhere

    Now, there's a problem: the script removes all forms of breakts hard/new line the credit, but I need sometimes.

    I'd like to get rid of the ReturnWithSpace function, but it seems that it is a bit more complex.

    Here is the complex function...

    function ReplaceReturnWithSpace (myString) {}
    myString = myString.replace (/ \n/g, "");
    myString = myString.replace (/ \r/g, "");
    return myString;
    }

    Here's the complete script - maybe someone can help you:

    indesign #target

    myDoc var = app.activeDocument;
    mySelection var = app.selection;

    If (mySelection.length == 0) {}
    ProcessPages();
    }
    Else if (mySelection.length == 1) {}
    Alert ("a picture and a textframe must be selected.");
    Exit();
    }
    Else if (mySelection.length == 2) {}
    try {}
    If (. constructor.name mySelection [0] == 'TextFrame' & &. images.length mySelection [1] == 1) {}
    var myTextFrame = mySelection [0];
    var myImage = .images mySelection [1] [0];
    var myCaption = ReplaceReturnWithSpace (myTextFrame.contents);
    var myPath is new file (myImage.itemLink.filePath) .absoluteURI;.
    }
    ElseIf (. constructor.name mySelection [1] == 'TextFrame' & &. images.length mySelection [0] == 1) {}
    var myTextFrame = mySelection [1];
    var myImage = mySelection .images [0] [0];
    var myCaption = ReplaceReturnWithSpace (myTextFrame.contents);
    var myPath is new file (myImage.itemLink.filePath) .absoluteURI;.
    }
    }
    {catch (e)}
    Alert ("something wrong with your selection. ("\nError:" + e.message);
    Exit();
    }

    CreateBridgeTalkMessage (myCaption, myPath);
    }
    ElseIf (mySelection.length > 2) {}
    Alert ("a picture and a textframe must be selected.");
    Exit();
    }

    UpdateAllOutdatedLinks();
    myDoc.save ();
    Alert ("All done.");

    //+++++++++++++++++++ FUNCTIONS ++++++++++++++++++++++

    function CreateBridgeTalkMessage (myCaption, myPath) {}
    var bt = new BridgeTalk();
    BT. Target = "bridge."
    var myScript = WriteCaption.toString () + "\r";
    myScript += ' WriteCaption (\ "" + myCaption + ' \ ", \"' myPath + "\"); ";
    BT. Body = myScript;
    BT. Send();
    }

    function WriteCaption (myCaption, myPath) {}
    If (xmpLib == undefined) {}
    If (Folder.fs == "Windows") {}
    var pathToLib = "/ C/Program Files/Adobe/Adobe Bridge CS3/AdobeXMPScript.dll";
    }
    else {}
    var pathToLib = "/ Applications/Adobe Bridge CS3/Bridge CS3.app/Contents/MacOS/AdobeXMPScript.framework";
    }
    libfile var = new file (pathToLib);
    var xmpLib = new ExternalObject ("lib:" + pathToLib);
    }
    var thumb = new thumbnail (file (myPath));

    If {(thumb.hasMetadata)
    var md = thumb.synchronousMetadata;
    var = new XMPMeta XMP (md.serialize ());
    xmp.deleteProperty (XMPConst.NS_XMP, "Description");
    xmp.setProperty (XMPConst.NS_XMP, "Description", myCaption);
    var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER |) XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
    Thumb.Metadata = new Metadata (updatedPacket);
    }
    }

    function ProcessPages() {}
    myPages var = myDoc.pages;
    for (i = 0; i < myPages.length; i ++) {}
    var myPage = myPages [i];
    If (myPage.textFrames.length == 1 & & myPage.rectangles.length == 1) {}
    If (myPage.rectangles [0].graphics.length == 1) {}
    var a = myPage.rectangles [0];
    var myImage = myPage.rectangles [0] .graphics [0];
    var myPath is new file (myImage.itemLink.filePath) .absoluteURI;.
    var myTextFrame = myPage.textFrames [0];
    var myCaption = ReplaceReturnWithSpace (myTextFrame.contents);
    CreateBridgeTalkMessage (myCaption, myPath);
    }
    }
    }
    }

    function ReplaceReturnWithSpace (myString) {}
    myString = myString.replace (/ \n/g, "");
    myString = myString.replace (/ \r/g, "");
    return myString;
    }

    function UpdateAllOutdatedLinks() {}
    for (var myCounter = myDoc.links.length - 1; myCounter > = 0; myCounter-) {}
    myLink var = myDoc.links [myCounter];
    If (myLink.status == LinkStatus.linkOutOfDate) {}
    myLink.update ();
    }
    }
    }

    If I can make a comment, the XMPScript API is separate from the bridge DOM, if your script could avoid to call bridge.

    InDesign is able to load the required library - new ExternalObject('lib:AdobeXMPScript') - and to deal directly with the XMP data.

    Then we can really simplify the code. Try this:

    TextFrame.prototype.getCaption = function()
    // Here you can customize the caption written in XMP
    {
    // old behavior :
    // return this.contents.replace( /[\n\r]/g , " " );
    
    // contents as it (keeping newlines) :
    return this.contents;
    }
    
    Document.prototype.getScope = function()
    { // return the array of {txf,img} objects to process
    var scope = [], pages = this.pages;
    for ( var pg, p = pages.length-1 ; p >= 0 ; p-- )
         {
        pg = pages[p];
         if ( pg.textFrames.length != 1 ) continue;
         if ( pg.rectangles.length != 1 ) continue;
         if ( pg.rectangles[0].images.length != 1 ) continue;
         scope.push({txf: pg.textFrames[0],img: pg.rectangles[0].images[0]});
        }
    return(scope);
    }
    
    Application.prototype.main = function()
    {
    if ( this.documents.length<=0 )
         {alert("Think to open a document!");return;}
    
    var scope, sel = this.selection;
    switch(sel.length)
         {
         case 0 :
              scope = this.activeDocument.getScope();
              break;
         case 2 :
              scope = ( function()
                   {
                   var t = (sel[0].constructor == TextFrame) ? 0 :
                        ( (sel[1].constructor == TextFrame) ? 1 : false );
                   if (t===false) return(null);
                   if ( sel[1-t].images.length != 1 ) return(null);
                   return [{txf: sel[t], img: sel[1-t].images[0]}];
                   } )();
              if (scope) break;
         default :
              alert("One image and one textframe should be selected.");
              return;
         }
    
    if (ExternalObject.AdobeXMPScript == undefined)
         {
         try {ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');}
         catch(ex) {alert("Unable to load the AdobeXMPScript library"); return;}
         };
    
    var txfImg, iLink, iFile, xmpFile, xmp;
    var err=0, cpt=0;
    while (txfImg=scope.pop())
         {
         iLink = txfImg.img.itemLink;
         try {iFile = new File(iLink.filePath);}
         catch(ex) {err++;continue;}
    
         xmpFile = new XMPFile(iFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
    
         xmp = xmpFile.getXMP();
         xmp.deleteProperty(XMPConst.NS_XMP, "Description");
         xmp.setProperty(XMPConst.NS_XMP, "Description", txfImg.txf.getCaption());
    
         if (xmpFile.canPutXMP(xmp)) { xmpFile.putXMP(xmp); cpt++;} else err++;
         xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
    
         if (iLink.status == LinkStatus.linkOutOfDate) iLink.update();
         }
    
    alert(''+cpt+" image descriptions updated -- "+err+" errors.");
    
    try{this.activeDocument.save();}
    catch(ex){}
    }
    
    app.main();
    
  • Kalonline-works until I get the anti-piracy icon so stop saying: there is a problem with the function of anti-hacking

    I play kalonline (RPG game), when to start the game it works up until I get the anti-piracy icon so stop saying: there is a problem with the function of anti-hacking. the program stops. I am the admin of it say kal computer run it in administrator mode and I did and I delete and reinstall the game. Solve the problem in win 7 by a right click and run as administrator, they wanted to work in win xp it all fits on how to solve this problem. These are the things, I was told to do to fix it.
    Hello

    It comes to KalOnline.

    Your error message can be corrected by following these steps:

    1. run KalOnline in Administrator Mode.

    2 uninstall KalOnline d_lete the entire Inixsoft folder, then reinstall the game.
    I did it and and it has not worked. then I was told that this was causing the problem

    Please check your computer system.

    This problem has occurred by a kind of problem of piracy.

    And if you have used a kind of memory-editing program, it could be happen too.

    So if your receipt similar to, then please remove it.
    I have none of these things on my computer. All I know is that people who have not updated windows xp can play the game and people who win 7 can play the game if they right click icon and run as administrator, that I still say side here but no way to prove it.

    Hello

    I suggest you to get in touch with the manufacturer of games and see if there are any other fix for this problem.

  • Having the problem with the function on SG300 Dhcp / 500?

    Having the problem with the function on SG300 Dhcp / 500? now I can use the dhcp server on the two model, but have a problem.

    My problem is when I create

    VLAN 1: 192.168.0.1/24 dhcp pool 192.168.0.10 - 250

    VLAN 10: 192.168.10.10 - 250 192.168.10.1/24 dhcp pool

    case 1

    I plug the pc to vlan 1 can I get ip 192.168.0.11. But when I change this pc to a new port in vlan 2 I always get the same ip address. why I can not get IP of vlan2.

    case 1

    I plug the pc to vlan 2 I can get ip 192.168.10.11. But when I change this pc to a new port in the vlan 1 I always get the same ip address. why I can not get IP of vlan1.

    but when I have access to the switch and remove the link after that that i will get correct IP.

    I think this is the bug of this firmware. Could you help this case.

    This is a known bug that is the setting of Cisco

    Sent by Cisco Support technique iPad App

  • Scope of a class

    What the scope of a class is created in Flash?  If you create a class in the main scenario, can you use it anywhere in your project?  If you use your class in a clip, you can use this class outside the clip?

    a class can be created in a class file, a stand-alone .as file, and it must have a specific structure and name.  Check the flash help files or a tutorial for more details.

  • Problem with counting function, passing VARs between functions.

    Hi guys, I have a problem with this section of code...

    Could anyone suggest how to fix the function at the bottom so that when the button forward_btn with label "go to next Point training" when you click on recalculate the fields created in the function fileLoaded

    var xmlData:XML = new XML ();
    var theURL_ur:URLRequest = new URLRequest ("xml.xml");
    var loader_ul:URLLoader = new URLLoader (theURL_ur);
    var more: RegExp = / \ + / g;
    var t:Number = 0;
    var tmax:Number = 0;

    loader_ul.addEventListener ("complete", fileLoaded);

    function fileLoaded(e:Event):void {}
    xmlData = XML (loader_ul.data);
    Tmax = xmlData.Record.length ();
    trace (tmax);

    trace (unescape (xmlData));
    trace (xmlData.Record.length ());


    var title_tp:String = unescape(xmlData.Record.TP.Title[t]).replace (, "");
    Title_TP_txt. Text = title_tp;

    var intro_tp:String = unescape(xmlData.Record.TP.Introduction[t]).replace (, "");
    Intro_TP_txt. Text = intro_tp;

    static_tp_intro.y = Title_TP_txt.y + Title_TP_txt.textHeight + 10;
    Intro_TP_txt.y = sta_tp_intro.y + sta_tp_intro.textHeight + 5;

    Title_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    Intro_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    }

    forward_btn.label = "go to the next Point training";
    forward_btn.addEventListener (MouseEvent.CLICK, next_if);

    function next_if (me: MouseEvent): void {}


    If (t == tmax) {play();  }


    else {t = t + 1;
    fileLoaded () ;}
    }

    I don't see where you have a question from vars between functions because you do not pass everything.  Maybe that's your problem.  The function fileLoaded expects an argument, but you are not providing one.  To get around that you should provide any argument being sent in the first function...

    function fileLoaded(e:Event=null):void {}

    Another option would be to separate features and put a quick end to the function fileLoaded and create another function that holds the rest of the code...

    function fileLoaded(e:Event):void {}
    xmlData = XML (loader_ul.data);
    Tmax = xmlData.Record.length ();

    processXMLData();

    }

    function processXMLData (): void {}
    trace (tmax);

    trace (unescape (xmlData));
    trace (xmlData.Record.length ());

    var title_tp:String = unescape(xmlData.Record.TP.Title[t]).replace (, "");
    Title_TP_txt. Text = title_tp;

    var intro_tp:String = unescape(xmlData.Record.TP.Introduction[t]).replace (, "");
    Intro_TP_txt. Text = intro_tp;
      
    static_tp_intro.y = Title_TP_txt.y + Title_TP_txt.textHeight + 10;
    Intro_TP_txt.y = sta_tp_intro.y + sta_tp_intro.textHeight + 5;
      
    Title_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    Intro_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    }

    forward_btn.label = "go to the next Point training";
    forward_btn.addEventListener (MouseEvent.CLICK, next_if);

    function next_if (me: MouseEvent): void {}

    If (t == tmax) {}

    Play();

    } else {}

    t = t + 1;
    processXMLData();

    }
    }

  • CS4 is no longer recognising the AS2 classes

    Question: I designed a site in CS4 via AS2 and external AS2 classes. Everything worked fine until about a week ago. Now when I go back and try to change these files, classes are loaded is more and the site breaks.

    I've not edited code, some graphics.

    I even tested some files that use classes outside and those out now as well. (I keep daily backups of my progress.) Published two weeks ago: fine; publish the same file today: broken.)

    I went into preferences AS2.0 and they are put in the way they have always been:

    • .
    • $(UserConfig) / Classes
    • $(LocalData) / Classes

    Since the publication of these working files, the only thing I do is a bunch of tutorials on Lynda AS3. I've not edited any AS of the libraries or settings or preferences, so I can't understand what is happening.

    A confused got Flash? How can I get these reconnected? Thank you.

    your class file should also reflect that he's in Classes.com.skin.Scrubber.

  • Function in class call

    How to call a function in classes?

    I have a primary class ("ChordLib.as") that contains a function that manages the options for the TileList component, which includes the prescription of a custom cell renderer class, "MyRenderer".  I want to be able to call a function in the primary "ChordLib.as" class of the class 'MyRenderer.as '.  Here's the function "ChordLib" that refers to the class "MyRenderer". There may be a way here to pass the reference of the primary class in "MyRenderer"?

    // SET CHORD LIST  //////////////////////////////////////////

    public void setChordList(song:int):void {}

    var dpChords:DataProvider = new DataProvider();

    var i: uint;

    determine the set of rope

    If (song ==-1) {}

    activeChords = allChords;

    } else {}

    activeChords = songChordSets [song];

    }

    fill with dataProvider

    for (i = 0; i < activeChords.length; i ++) {}

    var TT = activeChords [i];

    dpChords.addItem ({label: tt, source: ChordBar, data:, scaleContent:true});})

    }

    chordList.dataProvider = dpChords;

    chordList.columnWidth = 70;

    chordList.rowHeight = 30;

    chordList.direction = ScrollBarDirection.VERTICAL;

    chordList.setStyle ("contentPadding", 5);

    chordList.setRendererStyle ("imagePadding", 0);

    chordList.scrollPolicy = ScrollPolicy.ON;

    Set style for labels

    chordList.setRendererStyle ("textFormat", textFormat1);

    set the background skin

    chordList.setStyle ("skin", lightBackground);

    define cell converter

    chordList.setStyle ("cellRenderer", MyRenderer);

    }

    This last line ("chordList.setStyle ("cellRenderer", MyRenderer)'); refers to this custom class, which includes event listeners:

    package {}

    Import fl.controls.listClasses.ICellRenderer;

    Import fl.controls.listClasses.ImageCell;

    import flash.events. *;

    public class that extends myrenderer ImageCell implements ICellRenderer {}

         

    public void MyRenderer() {}

              

    this.buttonMode = true;

              

    Drop skin condition skin even static background

    setStyle ("upSkin", lightBackground);

    setStyle ("downSkin", lightBackground);

    setStyle ("overSkin", lightBackground);

              

    setStyle ("selectedUpSkin", lightBackground);

    setStyle ("selectedDownSkin", lightBackground);

    setStyle ("selectedOverSkin", lightBackground);

    turn off background of text by setting to 0

    setStyle ("textOverlayAlpha", 0);

    setStyle ("textPadding", 7);

              

    / / event listeners

    this.addEventListener (MouseEvent.CLICK, clickHandler);

    this.addEventListener (MouseEvent.MOUSE_OVER, mouseOverHandler);

    this.addEventListener (MouseEvent.MOUSE_OUT, mouseOutHandler);

         }

         

    / / EVENTS

    private void clickHandler(event:MouseEvent):void {}

         }

    private void mouseOverHandler(event:MouseEvent):void {}

         }

    private void mouseOutHandler(event:MouseEvent):void {}

         }

    }

    }

    I want to insert calls to functions that are in the main class (which contains the first feature listed here), "ChordLib.as".

    How can I do this?

    For classified call a function from another ClassB (or instance of it) he should be aware of two facts: 1) that ClassB exists and 2) that ClassB has a special function.

    Another approach might be to establish a communication between classes by the events.

    You explanation, it is not clear what you want to accomplish. Do you need to call a function on the class itself or by an instance of this class?

    So old - you must create a static function and just call it:

    inside ClassB:

    public static void classBFunction()

    ClassA can call it:

    ClassB.classBFunction)

    If you call the function on an instance - you, of course, need to instantiate the class and then call the function.

    Say you have inside ClassB

    public void classBAnotherFunction() - Note that there is no static Word

    There is an other fork here: either you instantiate the ClassB inside the ClassA or you pass a reference to the instance of ClassB in ClassA

  • Problem of scope in the shooting game

    Hi I am trying to create a simple shooting game where a ship hit several asteroids without using classes and tables. I have

    get problems with the scope of variables--in this case error: asteroid asteroid of the undefined property. Can someone offers

    a tweek that I could use to solve this problem?

    Thanks for looking

    import of important flash libraries.
    import flash.events.KeyboardEvent;
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.display.Sprite;

    var speed: Number = 10;
    Initializes the variables.
    var key_left:Boolean = false;
    var key_right:Boolean = false;
    var key_up:Boolean = false;
    var key_down:Boolean = false;
    var key_space:Boolean = false;
    var shootLimiter:Number = 0;
    Checks if the player presses a button.

    var: timer = new Timer(2000, 10);
    timer.addEventListener (TimerEvent.TIMER, AddAsteroid);
    Timer.Start ();

    stage.addEventListener (KeyboardEvent.KEY_DOWN, KeyDown);
    stage.addEventListener (KeyboardEvent.KEY_UP, KeyUp);

    var sprite: MovieClip = new Sprite()
    var backgr:MovieClip = new Background();

    backgr.x = 0;
    backgr.y = 45;
    addChild (backgr);
    addChild (sprite);

    function AddAsteroid(e:TimerEvent):void
    {

    var asteroid: MovieClip = new Asteroid();
    addChild (asteroid);
    Asteroid.x = 800;
    Asteroid.y = Math.round (Math.random () * 700);
    asteroid.addEventListener (Event.ENTER_FRAME, asteroidmove);


    function asteroidmove(e:Event):void
    {
    Asteroid.x-

    }
    }
    addEventListener (Event.ENTER_FRAME, backgroundmove);

    function backgroundmove(e:Event):void
    {
    backgr.x-= 1;

    If (backgr.x <-2110)
    {
    backgr.x = 0;
    }

    }



    Allows the main function play each image.
    addEventListener (Event.ENTER_FRAME, Main);

    Create the main function.
    main function (event: Event) {}
    CheckKeys();
    }

    Create the function KeyDown.
    function KeyDown(event:KeyboardEvent) {}
    if(Event.keycode == 37) {//checks if left arrowkey is pressed.
    key_left = true;
    }
    if(Event.keycode == 39) {//checks if right arrowkey is pressed.
    key_right = true;
    }
    if(Event.keycode == 38) {//checks if some arrowkey is pressed.}
    key_up = true;
    }
    if(Event.keycode == 40) {//checks if the arrowkey is pressed.
    Key_Down = true;
    }
    if(Event.keycode == 32) {//checks if the arrowkey is pressed.
    key_space = true;

    }
    }

    function KeyUp(event:KeyboardEvent) {}
    if(Event.keycode == 37) {//checks if left arrowkey is released.
    key_left = false;
    }
    if(Event.keycode == 39) {//checks if right arrowkey is released.
    key_right = false;
    }
    if(Event.keycode == 38) {//checks if some arrowkey is released.}
    key_up = false;
    }
    if(Event.keycode == 40) {//checks if the arrowkey is released.
    Key_Down = false;
    }
    if(Event.keycode == 32) {//checks if the arrowkey is released.
    key_space = false;
    }
    }

    function CheckKeys()
    {
    shootLimiter += 1;

    If (key_left)
    {
    setDirection (1);
    Sprite.x-= 5;
    }
    If (key_right)
    {
    setDirection (0);
    Sprite.x += 5;

    }
    {if (key_up)}
    Sprite.y-= 5;
    }
    {if (Key_Down)}
    Sprite.y += 5;
    }

    If ((key_space) & & (shootLimiter > 8))
    {
    shootLimiter = 0;
    var b = new Bullet();
    addChild (b);
    b.x = sprite.x + 50;
    b.y = sprite.y + 3;
    addEventListener (Event.ENTER_FRAME, moveBullet);
    }



    function moveBullet(e:Event):void
    {
    b.x += 10;

    If (b.x > 600)
    {
    If (Contains (b))
    {
    removeChild (b);
    }
    removeEventListener (Event.ENTER_FRAME, moveBullet);

    }

    If (b.hitTestObject (Asteroid))
    {
    removeChild (asteroid);
    removeChild (b);
    removeEventListener (Event.ENTER_FRAME, moveBullet);
    }
    }
    }
    function setDirection (param) {}
    If (param == 0) {}

    sprite.scaleX = 1;
    } else {}
    sprite.scaleX = - 1;
    }

    }

    You seem to be stating your asteroid inside a function, but try to access outside this function elsewhere.  When you declare an instance inside a function, he only carried within this function.

    You will probably also coax wrath of the compiler with a line like the following...

    var sprite: MovieClip = new Sprite();

  • Helps the function of class of SMTP with authentication

    My server no longer supports the php mail() feature.  I need to use the SMTP class with the authentication function in my php code, and they suggested this to replace it: on-with-authentication-in-php-code http://www.yrhostsupport.com/index.php?/Knowledgebase/Article/View/101/2/smtp-class-functi

    So, I tried, but cannot make it work. This is my test form:

    < are method = "post" action = "forms/sendmail - test2.php" onsubmit = "return checkEmail (this);" >

    < script type = "text/javascript" language = "JavaScript" >

    < /script >

    < fieldset > < legend > news < / legend >

    < Label > name < / label >

    < input type = "text".

    name = "name" size = "30" maxlength = "40" / > < br / >

    < label > < span class = 'redText' > * </span > Email < / label >

    < input name = "email" type = "text" size = "30" maxlength = "40" / >

    < br / >

    < label > < span class = 'redText' > * </span > Message < / label >

    < textarea cols = "40" rows = "5" name = "message" type = "text" / > < / textarea > < br / >

    < / fieldset >

    < input type = "reset" value = "Reset" / >

    < input type = value = "submit" / >

    < / fieldset >

    < / make >

    It's sendmail - test2.php where going to the form. It will not be sent unless I have comment on the first 10 lines.

    <? PHP

    include ('Mail.php');

    //$to = " [email protected] "; "

    $name = $_REQUEST ['name'];

    $email = $_REQUEST ['email'];

    $message = $_REQUEST ['name'];

    $headers = "from: $email";

    $subject = "price quote";

    $fields = array();

    $fields {'name'} = 'Name ';

    $fields {'email'} = 'Email ';

    $fields {'message'} = 'Message ';

    $recipients = ' [email protected] '; //CHANGE

    $headers ['from'] = ' [email protected] '; //CHANGE

    ["to"] = $headers ' [email protected] '; //CHANGE

    $headers ['subject'] = 'Test Message';

    $body = "test message";

    Set the SMTP settings

    $params ['host'] = "levy.dnsbox25.com";

    $params ['port'] = '25';

    $params ["auth"] = "PLAIN";

    $params ["username"] = ' [email protected] '; //CHANGE

    $params ["password"] = "xxxxxx"; CHANGE

    / Next option allows the SMTP debug and will print the SMTP Protocol

    conversation on the page, it will help only with authentication problems. */

    $params ['debug'] = 'true ';

    Create the mail object using the Mail::factory method

    $mail_object = & Mail::factory ('smtp', $params);

    Print the parameters you use for the page

    {foreach ($params as $p)

    echo "$p < br / > ';

    }

    Send the message

    $mail_object-> send ($recipients, $headers, $body);

    ? >

    It used to work well when I used

    $send = mail ($ $subject, $body, $headers);

    $send2 = mail ($from, $subject2, $autoreply, $headers2);

    But they said I can't use it anymore. I'm good with HTML and CSS, but I don't know much about php. Thanks for any help integrating one of in this new code!

    It is to be expected. When you assign a value to a variable that was already assigned, you replace the previous value. You must add. Try this

    $body = "name:". "." $name. "\r\n". "e-mail:". "."  $email. "\r\n". $message

  • problem with XML within a class

    Ok. It is a set accessor function in one of my classes. It's supposed to load an xml document in a table when I called with the address of the xml document. When I debug I get the picture but there is no data in there.

    I'm sure I'm doing something really stupid is probably very easy to spot... Sorry - I'm new on this!

    Thank you very much!

    (I've included the code and the xml file in the code so you can see what I'm aiming to...)

    In the call from the bottom of the managers, members of the class are out of reach. You can solve this problem in several ways. In the code that you have posted, you can use a local reference to the class (the current object). In other cases, you can use the delegate class.

  • Problem of scope for the event Manager

    Hello. I am fairly new to the ACE and I'm having some trouble presentation event handler of the scope. I tried searching the forums, but it doesn't seem to be any discussions on this particular problem. I'm trying to dynamically define event handlers onRelease for video clips created in an onLoad handler attached to an XML object. Unfortunately, when the onRelease functions are called, the variables seem to have passed out of range (I get "" as value). I have attached the code below. If anyone has any suggestions, it would be greatly appreciated.

    Thank you!
    -------

    ["NavMviClp" + i] nameNavClip has no way to know that it is the i - th movieclip, unless you store a value from somewhere I (what is salvageable) before the loop increments for.

    Try:

Maybe you are looking for