Flash AS3 OOP = Can 1 objects class find and change another objects xy properties?

What I have is a game with a Level object, inside the Level is a Player object, and they don't have instance names given, what I'm trying to figure out is how to do is make it so that the player can change the x or y properties of the Level object.
To be more precise, I'm making it so that when the player moves in a certain direction, he either moves accross the stage, or he starts moving the Level object around the stage, it'd be in an Event kind of function, now I can easily make the Player move, but I don't know how to make the Level object move which the player is inside of.
Is anyone able to help me on this please?

I tried a simple getter setter idea, but it doesn't seem to work
public class Mover
  private var _moveValue:Number = 5;
public function Mover()
  Player.shift = _moveValue;
public class Player
private var _vx = 0;
public static function set shift (_move:number):void
  _vx = _move;
public function Player
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void
x += _vx;
Thats with my limited imagination and knowledge of AS3 here so far... is that going completely wrong? If so are there any good examples or tutorials I could check out to get a better idea of what I'm trying to do?

Similar Messages

  • My external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive. Same thing has happened with Final Cut Express.

    My new LaCie external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive.
    The same thing happened recently between Final Cut Express and my other LaCie external hard drive used as the Scratch disk. It fixed itself.
    I've run out of ideas. Help would be very much appreciated. Thanks.

    have you done some searches on FCPx and time machine? Is there a known issue with using a TM drive with FCPx? dunno but ...wait...I'll take 60 sec for you cause I'm just that kind of guy....   google...." fcpx time machine problem"  Frist page link 
    http://www.premiumbeat.com/blog/fcpx-bug-best-practices-for-using-external-hard- drives-and-final-cut-pro-x/
           You cannot have time machine backups on your hard drive if you intend to use it in FCPX.
    booya!

  • How can I hide what I write in a find and change list

    I've written a find and change script, I prepared to offer it for anyone to use, but I don't want to anyone to read what I write in the find and change list.
    How Can I hide it?

    OK, my be offer it for someone to use it, I mean in house coworker, no any virus in it.
    How can hide the find and change list, or change it to another format, not just .txt.
    mybe change it to .doc or .vb or .js, and the script still can run well.

  • In Edge Code can i do a find and replace?

    In Edge Code can i do a find and replace on multiple lines of code or just a single line?

    You can't do it on just one type of file. However, you can do find and replace in selected files. Ctrl-click to select the targeted files in the Files panel, and then choose Selected Files in Site from the Find In drop-down.

  • Interactive Report - is there a way to find and change if necessary the unique column.

    While creating an interactive report I accidently entered the wrong "unique column" on the sql query page.  Is this a big deal and how can I find and change if necessary.
    Query Builder
    Link to Single Row View
    Yes
    No
    Uniquely Identify Rows by
    ROWID
    Unique Column
    Unique Column

    33ac2d45-960f-45af-acba-507f01d18e08 wrote:
    Please update your forum profile with a real handle instead of "33ac2d45-960f-45af-acba-507f01d18e08".
    While creating an interactive report I accidently entered the wrong "unique column" on the sql query page.  Is this a big deal and how can I find and change if necessary.
    Query Builder
    Link to Single Row View
    Yes
    No
    Uniquely Identify Rows by
    ROWID
    Unique Column
    Unique Column
    Yes. You can change this using the Uniquely Identify Rows by/Unique Column properties in the Link Column section on the Report Attributes tab of the interactive report definition.

  • How can i use this sript and loade another movie?

    Hi there, i used the following script to load a movie from the server;
    var request:URLRequest = new URLRequest("url string");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    How can i use this sript and loade another movie? Can someone help me please?
    [edited by moderator]

    Sir, I changed it from:
    var request:URLRequest = new URLRequest("http://agusandelsur.gov.ph/downloads/pdrrmo/agusan_del_sur/StaJosefa/Movies/Dir.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    to
    var request:URLRequest = new URLRequest("http://agusandelsur.gov.ph/downloads/pdrrmo/agusan_del_sur/StaJosefa/Movies/Warning.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    When i expord the movie i get the following error.....
    Scene 1, Layer 'Layer 3', Frame 1, Line 6    1151: A conflict exists with definition request in namespace internal.

  • Possible bug in inDesign CS5 with find and change

    This could be a problem with my script or it may be a bug, not sure.
    The script is used for finding a double space in a fragment of text and changing it to single space.
    It works only once when it is executed.
    To make it work again you have to close and reopen inDesign.
    Here's the code:
    app.findTextPreferences.findWhat = "  ";
    app.changeTextPreferences.changeTo = " ";
    app.documents[0].changeText();

    This one worked, Harbs also works but I think I'll go the unicode grep route for find and change on this one.
    I like the use of the positive lookbehind GREP character. (?<=) 
    thank you

  • How to modify Find and Change indicator?

    I use Find and Change in Applewors 6. At present, this operation finds what is specified but the indicator is colored green and is open, and hard to locate on a page when looking for a single letter. I changed it from its original pale orange to what it is now but now I would like to change it back to something easier to find. But I forgot how I did it and did not make a note. Would appreciate info on how to change this indicator. Thanks

    Neil--
    Thanks for info. I found it under System preferences>Personal>Appearance. You get a lot of choices in color and intensity. I was hoping to change the Find and Change indicator to solid but maybe this is not possible.

  • My Ipod Touch Was dropped and screen is broken. How can I get It Fixed? I cannot Unlock the Ipod Touch, all I can do is play Music and Change Songs.

    I Dropped My Ipod Gen 4 on a Granite Floor and it Spider webbed. Now all I can do is Play songs and change songs from the lock screen. I cannot unlock the Ipod or do anything else. Is there any way for me to get it fixed Cheap???

    Apple will exchange your iPod for a refurbished one for $199 for 64 GB 4G and $99 for the other 4Gs. They do not fix yours.
    Apple - iPod Repair price
    You can do it at an Apple store by making an appointment:
    Apple Retail Store - Genius Bar
    or send it in to Apple. See:     
    Service Answer Center - iPod
    A third-party place like the following maybe less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens         
    Replace the screen yourself if you are up to it
    iPod Touch Repair – iFixit                  

  • HT1918 how can i remove my billing and change it into a free apple id user?

    how can i remove my billing and change it into a free apple id user?

    iTunes Store: Changing Account Information
              http://support.apple.com/kb/HT1918
    Select None under your payment method.

  • Capitalization doesn't work as described. One can start with lower case and change to upper, but changing from upper case to any of the other options doesn't work. Is there a way around this or is this just a glitch that needs fixing?

    In Pages capitalization doesn't work as described. One can start with lower case and change to upper, but changing from upper case to any of the other options doesn't work. Is there a way around this or is this just a glitch that needs fixing?

    I think it does work as described, but the description is not very complete. Capitalization does not change any of the characters that you type; what it does is allow some of the lower case characters to display as capitals. If you copy the result and paste it as plain text, you'll see that the lower case characters are still there. It doesn't actually say anywhere that it can make capitals display as lower case, and it can't.
    The obvious way around this is to actually type what you want.
    The more powerful way is to install WordService from Devon Technologies which adds the functionality of Pages' capitalization menu as well a lot of other ones. WordService actually changes the character to the one displayed, and it works in most of the applications on your Mac.

  • How can I perform a find and replace against all embedded links?

    Hi -
    We have a project which links to another project. The URL for the linked to project has changed, and now all hyperlinks fail when clicked.
    Yes - I can edit each and every link, but the person who set this up has literally hundreds of links in this project which now need to be changed. Please save my sanity and tell me there is a way to update all links programatically (replace infomoto.mot.com/robo/projects/iccs-bcs with infomoto.mot.com/iccs) in all places it is referenced.
    Thanks much,
    Anahid

    In theory you can use the built in Multi File Find and Replace as the string should be on one line. Personally I would use FAR from http://www.helpware.net/FAR and search using Start With / End With and Must Contain to ensure the string will be found even if it is split over two lines. You could also use BKReplaceEm which is free.
    Backup up your project before you start. Tools like this can fix issues in seconds, they can also wreck your project in seconds.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • Can I do a find and replace on .cfm files only and not search .html or .txt?

    Hi.  I'm using Dreamweaver CS4.  I would like to do a find and replace through my site with Dreamweaver but I only want it to search through .cfm files.  Currently it is searching through .html and .txt files along with .cfm.  Is there a way to do a find and replace on just .cfm files?
    - Tom

    You can't do it on just one type of file. However, you can do find and replace in selected files. Ctrl-click to select the targeted files in the Files panel, and then choose Selected Files in Site from the Find In drop-down.

  • Text find and change problem in CS3 and CS4 script

    I use the script below to find some text and change into others.
    There is one thing the script can't do it for me.
    Example:
    (g) Management
    (1) that no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (2) that the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    Example:(END)
    I got a lot of topics or points in the passage. And I want to change the space between '(g)' and 'Management' into a tab character. So I revised the plain text file 1text.
    PS: 1text.txt is filled with what to change.
    text {findWhat:"^p(^?) "} {changeTo:"^p(^?)^t"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an en dash.
    The result is:
    (^?)^tManagement
    (^?)^tthat no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (^?)^tthat the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    PS: ^t is a tab character.
    result (END)
    This is not what I want.
    It should be '(g)^tManagement'.
    PS: ^t is a tab character.
    Please someboady help me out to revised the script below to change the text into what I want. Thanks so much.
    Here is the script.
    //FindChangeByList.jsx
    //An InDesign CS4 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 2.0.0.0 10-January-2008
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.
    //More complex example:
    //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
    var myObject;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    if(app.documents.length > 0){
      if(app.selection.length > 0){
       switch(app.selection[0].constructor.name){
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
        case "Text":
        case "Cell":
        case "Column":
        case "Row":
        case "Table":
         myDisplayDialog();
         break;
        default:
         //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
      else{
       //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       with(dialogColumns.add()){
        staticTexts.add({staticLabel:"Search Range:"});
       var myRangeButtons = radiobuttonGroups.add();
       with(myRangeButtons){
        radiobuttonControls.add({staticLabel:"Document", checkedState:true});
        radiobuttonControls.add({staticLabel:"Selected Story"});
        if(app.selection[0].contents != ""){
         radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(myRangeButtons.selectedButton){
       case 0:
        myObject = app.documents.item(0);
        break;
       case 1:
        myObject = app.selection[0].parentStory;
        break;
       case 2:
        myObject = app.selection[0];
        break;
      myDialog.destroy();
      myFindChangeByList(myObject);
    else{
      myDialog.destroy();
    function myFindChangeByList(myObject){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/1test.txt")
    if(myFindChangeFile != null){
      myFindChangeFile = File(myFindChangeFile);
      var myResult = myFindChangeFile.open("r", undefined, undefined);
      if(myResult == true){
       //Loop through the find/change operations.
       do{
        myLine = myFindChangeFile.readln();
        //Ignore comment lines and blank lines.
        if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")||(myLine.substring(0, 5)=="glyph")){
         myFindChangeArray = myLine.split("\t");
         //The first field in the line is the findType string.
         myFindType = myFindChangeArray[0];
         //The second field in the line is the FindPreferences string.
         myFindPreferences = myFindChangeArray[1];
         //The second field in the line is the ChangePreferences string.
         myChangePreferences = myFindChangeArray[2];
         //The fourth field is the range--used only by text find/change.
         myFindChangeOptions = myFindChangeArray[3];
         switch(myFindType){
          case "text":
           myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "grep":
           myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "glyph":
           myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    myFoundItems = myObject.changeText();
    //Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep();
    //Reset the find/change grep preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph();
    //Reset the find/change glyph preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File(myScriptFile);
    var myScriptFolder = myScriptFile.path;
    myFilePath = myScriptFolder + myFilePath;
    if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog("Choose the file containing your find/change list");
    return myFilePath;
    function myGetScriptPath(){
    try{
      myFile = app.activeScript;
    catch(myError){
      myFile = myError.fileName;
    return myFile;

    It takes me a lof of time to comprehend the sentence you write. Cause I am a Chinese. My poor English.
    I have to say "you are genius". I used to use the indesign CS2. There is no GREP function in CS2. When I get the new script, I do not know how to use it. Just when I saw the
    'grep {findWhat:"  +"} {changeTo:" "} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.'
    Being confused.
    Thanks so much. It seems I have to relearn the advanced Indesign.

  • Finding and changing ownership of files by uid

    In migrating to a laptop to allow the primary account to be a mobile user on a server, I deleted the user account. Since this user was also the admin for the machine, I now have a series of applications and files on the box which show 501:501 as the owner and group. I can use find to find the files. What I am searching for is the command that would allow me to pipe that to chown so I can modify all these files. Yes I do have a back-up.
    Is it something like:
    sudo find / -uid 501 | chown admin:admin
    And then I could repeat to get the remaining 501 group with:
    sudo find / -gid 501 | chown :admin
    Thanks!

    I suggest using xargs. Use -print0 on 'find' and -0 with xargs (those are zeros).
    Something like:
    find / -uid 501 -print0 | xargs -0 chown admin:admin
    (I didn't fully test it -- ran with 'echo' instead of chown )

Maybe you are looking for

  • Acrobat opens instead of Reader from links in MS Office

    Hello, we've installed Adobe Acrobat 9.4.5 and Adobe Reader 10.1.3 on our terminal servers (Windows server 2008 R2) and given the users separate permissions based on two security groups in AD. Everyone has access to Reader, but only some users have a

  • MSI K8D Master PCI-X Question

    Hi, I was just wandering if anyone could tell me if the MSI K8D Master is compatible with any PCI-X 16 video cards. Any information would be appreciated.

  • Downloading user report data question

    I am trying to download report data from the User report section however the "Time Taken" section comes out in a different format.  For example: On the Connect server it looks like this:  00:00:23 - on the top of the section it says the format is hh:

  • Having trouble with forms6i

    Hi, I succefully installed my Oracle Forms and Reports server. It generates this document which requires me to do some configuration for my TNS listner. If any one has seen this before, can you tell me which listner i am required to configure and how

  • Activity Monitor not working correctly / not listing processes

    When I open Activity Monitor, it does not display a list of processes. The CPU usage works in the bottom of the window as does the disk usage. None of the other graphs display any graphing/data. I have rebooted, relaunched AM and I selected "all proc