Access document stage instead of object stage

Hi AS3 community,
I've run into a brick wall and was hoping I could use your help. I have the following class set up:
package 
          import flash.events.MouseEvent;
          import flash.text.TextField;
          import flash.display.MovieClip;
          import flash.text.TextFormat;
          public class NPC extends MovieClip
                    public function NPC(varX:Number,varY:Number,varName:String)
                              // constructor code
                              this.x=varX;
                              this.y=varY;
                              this.addEventListener(MouseEvent.CLICK,actionWindow);
  public function actionWindow(event:MouseEvent):void
                              var format:TextFormat= new TextFormat();
                              format.size=15;
                              var dialogue:TextField=new TextField();
                              dialogue.defaultTextFormat=format;
                              dialogue.text="Welcome to Russ's Test Environment!";
                              dialogue.border=true;
                              dialogue.background=true;
                              dialogue.backgroundColor=0xE8F2FA;
                              dialogue.wordWrap=true;
                              dialogue.width=650;
                              dialogue.x=25;
                              dialogue.y=25;
                              addChild(dialogue);
And have the following on the timeline:
var compy:NPC = new NPC(400,200,"Joe");
addChild(compy);
This correctly creates my object on the stage, however when I click on it the dialogue box appears in relation to the object and not the stage itself (in this instance, x 425 y 225). What would I want to do in order to place the text box at x 25 y 25?

You can do:
dialogue.x = 25 - x;
dialogue.y = 25 - y;
However perhaps the better approach is to create the text field in the Document class (or the main timeline.)
Kenneth Kawamoto
http://www.materiaprima.co.uk/

Similar Messages

  • What are the appropriate document/stage dimensions in Flash for tablet optimized apps?

    What are the appropriate document/stage dimensions in Flash (width x height in pixels) for tablet optimized apps?
    (Dec. 2013)
    Using Flash and AIR for Android/iOS I would like to develop a educational interactive title optimized for tablet PCs, hopefully both the Android but finally also the iOS platforms. With so many tablets on the market today and with different resolutions (and even aspect ratios) I have difficulty deciding what document/stage size to set for my project/app. I have been experimenting with an Android Google Nexus 7 and Samsung Note 10 tablets and discovered that Android automatically resizes the app's stage to fully fit the screen of the tablet BUT this creates the following two issues for me:
    if the stage/document size in Flash is too small and I include bitmaps when the app's stage is enlarged to fit the tablet screen the bitmaps look pixelated.
    If I make the stage dimensions too big so that there is no bitmap pixelation because the bitmaps will be shrank instead of enlarged, I am afraid that on some older tablets with slower processors the app may be too slow to run (but I have to say that I did not experiment with very large stage dimensions yet).
    Until today I had looked at some of the most commonly used tablets on the market and their resolutions Google Nexus 7, Samsung Note, iPads etc and was inclined towards using a stage size of approximately 1280 x 720 pixels which I considered a medium solution, but now the new generation tablets came out (Nexus 7 gen 2, iPad Mini with Retina, iPad AIR etc) with much higher resolutions so I don't know what size to use now. Anybody has any suggestions?
    I would appreciate any ideas and suggestions on this matter.

    You explained your problem well enough that looking at the picture won't matter.  It looks like you found out too late that one of the first things you should do when you create a Flash file is set the movie properties, which include the dimensions and other things like background color, frame rate, publish settings, etc.  While the string that I just listed can pretty much be revised anytime, the dimensions should really be done before anything else, when possible.
    One way to go about resizing is to leave the file as is and specify the larger dimensions in the html page code.  This could end up reducing the quality of any bitmaps you might have in the file(s) since you would essentially be enlarging them, but any Flash drawn elements will resize cleanly.
    If you resize the stage, then you don't have much choice but to resize and relocate everything in it keyframe by keyframe.

  • Accessing the stage variable problems in AS 3.0

    Hi. Quick question...I'm trying to access the stage variable
    which I believe is supposed to be global and I should be able to
    access it from any class. Is this true? The compiler is complaining
    that it doesn't recognize this variable? Note that these objects
    have not been added to the stage yet but still, these are compile
    time errors, so why is that I'm getting these errors?
    Thanks,
    Sam

    Sam,
    > Actually, this doesn't have to do with that question.
    > Basically, the compiler is complaining that it doesn't
    > recognize the stage variable.
    It complains about the DisplayObject.stage property? Are you
    referencing it in conjunction with a DisplayObject instance?
    > This is weird because in my AS 3.0 book, I see that
    > the stage variable is being accessed without
    instantiating
    > it or retrieving it.
    What book is that? I might have it, then I can see what
    you're seeing.
    > I am extending Sprite in all my classes.
    Yeah, Sprite extends DisplayObject, by of InteractiveObject,
    then
    DisplayObjectContainer, so it certainly is entitled to the
    stage property.
    Let me know what book you're looking at, and if I don't have
    it (and if
    you're still interested), I'll try to recreate a simplified
    proof of concept
    on this end.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Access main stage from a symbol timeline?

    Can I access main stage  from a symbol timeline?
    Eg:
    I have a symbol called "ball" and its own time line. There is a close button at the end of ball's timeline,
    When close button pressed, I want to go back to main timeline.
    Thanks
    Phyle

    Thanks Hemanth.  I will try to explain.
    Open Edge animate. On the main stage I added a label called "home".
    I created circle, converted to symbol, renamed to "ball".
    Inside "ball" , I have a animation, at the end there is a button called "closeBt"
    When "closeBt" pressed, I want to go back to main stage "home"

  • How to access the attributes in an object using TestStand.?

    hi,
    I have a class named Status in C# that has 2 data members. There is another Class named Parameter and it has functions that return objects of type Status.
    I made the DLL of the class Parameter. Then i added that class to NI TestStand and called a fucntion and that function is returning an object of type Status.
    Is there any way by which i can access the Data Members of the returned Object in TestStand ??
    Thanx in advance
    Solved!
    Go to Solution.

    Yes, there is another alternative. If you make Status a value type (i.e. a struct in C#) then you can tell teststand to store it in a corresponding TestStand data structure rather than an object reference variable. This works even for private fields in your struct. To do this:
    1) First make Status a value type and make whatever other changes are necessary in your code to account for this (value types are copied when passed by value to another method, if this is not what you want you will need to pass them by reference - i.e. ref keyword in C#).
    2) Recompile your assembly.
    3) In the TestStand .NET module specification panel you should now see a new button next to the expression for the return value of type Status that looks like the TestStand data type icon. Push that button and it will prompt you to create a TestStand custom data type that corresponds to the .NET type. Select to save the type in MyTypes.ini type palette file. You only need to do this once. Once the type is in your MyTypes.ini type palette file it will be available from then on and you only need to update it if you change the .NET type.
    4) Create a local variable of the TestStand Custom data type instead of Object Reference. Note that you can expand it and see the properties underneath.
    5) Use this new local variable to store the Status return value. TestStand will copy/update the properties of the variable to correspond to those of the .NET struct that the method returns.
    NOTE: You can also just store the individual fields of a struct in separate variables by expanding the return value of type Status once it's a struct and specifying a separate variable for each field rather than creating a TestStand custom data type.
    Keep in mind that TestStand is making a copy when you store a struct this way so changes to the struct after this will not be reflected in the copy.
    Hope this helps,
    -Doug

  • I am not able to open a PDF file that I just created. I get an access denied message instead.

    I am not able to open a PDF file that I just created. I get an access denied message instead.

    Thanks for asking.
    I was combining different types of files into a single PDF. Some of them were excel spreadsheets and I had set the print areas in each file. When I cleared the print area the problem stopped. So I am assuming that had something to do with it. Though I am not sure.
    The strange thing was that I was able to open the excel source documents after creating the faulty PDF but some of the MS word source documents also had "access denied" status. I still cannot figure that part out.

  • Display the document currency instead display Currency in Report

    Hi Experts,
      I am having  a query in support system, in that one characteristic called document  currency is there under Unit Dimension and this Doc currency info object  having the Display currency and Document currency as Variables. Document currency Info object is in Free characteristics without related  variables (Disp.curr and Doc.curr)
    When I execute the query  defaultly Display currency will appear as a  variable in selection screen, because customer exit(cmod) has created like that
    Now user want to display the document currency instead Display currency  in the report, may I know how can I solve this problem?
    Here I am unable to get the customer exit  detatils and which program is there in CMOD, can anyone suggest me, how I will get the details?
    And one more requirement in this CR, that is user want to display the key figure amount in the report should be displayed with the document currency amount only
    May I know, want to do any settings for this?
    Thanks to All
    Regards
    Mrudula

    Hi rajesh,
    1.customer exit value you can change in CMOD,select your project and go to components  and select EXIT_SAPLRRS0_001.there go to  include zxrsru01,and change  display variable to document currency variable.
    2. if u want to display your key figure value in document currency ,,go to that key figure info object ,,,in currency ( reference) field give document currency info object.Then map the respective amount value again in transformation.load the data, now  in report document currency will be displayed along with key figure amount.
    Thank you,
    Joseph

  • Link DMS document to a finance object

    Hello,
    As anybody succeeded to create a document link to finance object?
    I am now trying to create this link, and I as already read SAP Help about this topic. As far as I understand I need to:
    "1. Program two screens for the following module pools for the SAP object that is to be linked additionally:
    – SAPLCV00
    – SAPLCVIN
    The process logic must be according to that of screen 0204 in program SAPLCV00 and must not be changed.
    2.Create the function module DOCUMENT_CHECK_XXXX (XXXX = name of the SAP object). If this object can be classified, this function module already exists in the standard system. Otherwise, copy the existing function module DOCUMENT_CHECK_EQUI (linking of equipments) and change it to suit the new object."
    First of all, in SAP IMG help, the programs mentioned are SAPLCV130 and SAPLCV140, screen 1204, instead of those above…
    So, I am now very confused and do not know what to do in order to create the necessary link…
    As anybody have some sample code?
    Can anybody help me about this problem? This problem as now become very critical for the continuity of my Project...
    Thanks in advance,
    Margarida

    Hello:
    This is what I have done to make it work in ECC6.0 using EKKO.
    In SE80, enter in Function Group CV130. Then expand the screen folder and look at the screen logic of several screens. I noticed that they're all the same except for the "field" statement, which is particular to the specific table. I copied 1208, but you can copy whichever one you want. You will need to register the object (if not already) and usually basis can help with that. I created a screen 9001. (Note: This can be overwritten with a new SAP release so be weary of that).
    I replaced the codes using the Modification assistant in the screen Flow Logic
          FIELD mcdokob-einri.
          FIELD mcdokob-falnr.
    and put in
          FIELD ekko-ebeln. I also had to remove the MCDOKOB variables from the screen Element List and replace it with EKKO-EBELN.
    Then in config (following the standard help guidelines) I added the object link with my new screen. I see it. I hope any of you do as well.

  • SOCO, when PO creation "No authorization to access document BBP_PD_PO"

    Hello,
    I am in SOCO transaction trying to creta a PO from two SC.
    I have this error "No authorization to access document BBP_PD_PO"
    Someone know who to resolve it?
    Cheers,
    Marta

    Hi
    Seems like Z roles created in the PFCG transaction by BASIS team is having problems.
    For time being, to verify this, Try giving SAP_ALL access to the user to confirm the same. Ask BASIS guys to help you out.
    In Transaction SU53 -> you can get the detailed Authorization object missing in the user's profile.
    Try executing the same transaction in SRM GUI and then you will be able to get to know that which Authorization object is missing.
    Regards
    - Atul
    After attaching the missing object in the user's profile, the problem will be solved.

  • Where to find out Text for document storage for HR Objects in E-Recruitment

    Hi,
    In E-Recruitment
    1.For table HRP5121,there are some fields which store numeric values but points to a text in the document storage for HR Objects. Where can we find out the description for the text ?
    2.Similarly for Resume attachment is there any way where we can find out where the resume or other documents are stored
    For pt 1 Requirement is to create a report

    If i am not wrong, resume attached would be stored in tables TOAHR and SDOKCONT1, and attached document can be accessed through PB30 --> Extras

  • Access 9i OLAP from Business objects

    can anybody help me to access 9i OLAP from Business objects, by any document or demo or step by step instructions , as i'm new in this field
    thank you

    For testing and POC purposes you can access the bridge software here:
    ftp://ftp.businessobjects.com/pub/incoming/UBSetup_For_Ora_10104.zip (please type the entire path including the file name, you cannot navigate through this location)
    For users who are using the BO 6.5.1 in particular, they need to install the following patch, otherwise the created universe won't work:
    ftp://ftp.businessobjects.com/pub/incoming/patch_bobj_651_HF_497.zip (necessary for BO 6.5.1 ONLY, do not install this patch for other BO versions )

  • When I create a New Folder (on the desktop or in Finder), the system uses the Generic Document Icon instead of the Generic Folder Icon. How can I change this back?

    When I create a New Folder (on the desktop or in Finder), the system uses the Generic Document Icon instead of the Generic Folder Icon. How can I change this back?
    All of a sudden I noticed that most of the folders on my computer were no longer using the folder icon, but the generic document icon. I had to manually change back the icon being used by opening Get Info for each folder and copying and pasting the generic folder icon from some folders that remained unchanged. Now whenever I create a New Folder (right click -> "New Folder"), the icon that shows up is the generic document icon (white page with top right corner turned down). And I have to manually change it so it shows up as a folder in Finder or on my desktop. I don't know why or how this switch happened. All of the folders now on my computer look ok, but I need to change the default so when I create a New Folder it uses the correct icon.
    I have also Forced Relaunch of my Finder and rebooted the system. I downloaded Candybar but am not sure what will fix anything, so I haven't proceeded.
    Anyone know how I can do this? Thanks.

    Anyone?

  • How to write the folder path in standard webi report - Most Accessed Documents

    How to write the folder path in standard webi report - Most Accessed Documents
    All
       -> Public Folders
                      -> Auditor
                      -> ABCD
    I want to give path of folder 'ABCD' and all the reports/ subfolders under it?
    Prompt - 'Enter the Folder Path(Add % at the end to include Sub Folders)' ?
    Give me exact path syntax

    Hi Daniel,
    But when I give my URL as
    http://serverA:80/irj/portal??NavigationTarget=ROLES://portal_content/crm-practice/14-Feb/Test_Page
    I am able to access the iview but the thing is I am getting TLN,Toolarea,Masthead,etc.
    I will tell my requirement,
    ServerA (EP 7.0) has some iviews,pages...
    I need to access these iviews from serverB(EP 6.0)....
    In ServerB only the iviews has to be displayed in the content area but not TLN,Toolarea,etc.
    Kindly help me in this regard.
    Thanks and regards,
    Purushothaman.
    Message was edited by: Purushothaman Vyasarao

  • Document date instead of the BP Ref. No.

    Hi All,
    In Aging Reports:
      On Either  customer and vendor aging reports:
      For the detailed again report printout, i need to see the document date instead of the BP Ref. No.
    will you pls guide me how to do this?
    thanks,
    philip

    Hi, hope still not late to solve your issue, you may this link to get the aging report in XLR
    https://websmp209.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000654469&_SCENARIO=01100035870000000183&_ADDINC=&_OBJECT=011000358700001172792006E.htm
    , under Supporting Materials >> Sample Reports XL Reporter 2005..
    Cheers

  • How to disable the 'Read Only' notification on an Access document when it is opened from within a document library (SP 2010)

    Hello, 
    OK, so I am currently having issues with opening MS Access documents from SP 2010. I have taken an existing database and uploaded it into a document library. Now, when I open this document I get the prompt to open it in either 'Read Only' or 'Edit'. 
    When I select 'Read Only' I can view the document, however I get the 'Read Only - Save As' notification when the document opens up. I have configured the document both from the source (on the original file) and from within SP to disable notifications - (from
    within the Trusted Options selection) 
    Deleted the document and uploaded it again, and the 'yellow bar' notification is still appearing. 
    I want to disable the 'Save As' function, or even hide this when the document is opened. Is this at all possible?? 

    Hi Terry,
    According to your description, my understanding is that you don’t want the yollow bar notification to display when you open Access documents.
    This issue seems to be about the client application. Please compare the followings with the things that you did:
     1.Open the documents
     2.Click File->Options->Trust Center->Trust Center Settings
     3.Click Protected View, unselect ‘Enable Protected View for originating from the Internet’
     4.Click Message Bar, select ‘Never show information about blocked content’
     5.Click Macro Settings, select ‘Disable all macros without notification’
    In addition, as this issue is about Office, I commend you create a new thread in Office forum, more experts will assist you with this issue.
    Office forum:
    http://social.technet.microsoft.com/Forums/en-US/home?category=officeitpro
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

Maybe you are looking for