The scope of this in AS3

Hi
I am just trying to understand the scope of this in AS3 for
example in AS2
basicM_btn.onRelease = function() {
this._visible = false;
Would have made the button invisible
In AS3 I was expecting to write the same thing as this
function clickHandler(event:MouseEvent):void {
this.visible = false;
menuA_btn.addEventListener(MouseEvent.CLICK, clickHandler);
However this sets all of the content on the stage to visible
= false
Is there a difference in the way that this works in AS3
Thanks for your help

You want the event's target - not this...
try this:
function clickHandler(event:MouseEvent):void {
event.target.visible = false;
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Similar Messages

  • Concerned about the scope of this project, do I need an LMS?

    Good afternoon,
    I have been scouring the forums today as I try to wrap my head around captivate as this is a new piece of software to me.  I wanted to build a decent understanding of how my project should be structured before actually building anything and along the way I discovered LMS while I was examining the quizzing features.
    First id like to give an idea to the community of what I'm trying accomplish with this project.  I have a few relatively simple training programs that I would like to automate online for new employee's coming in to the company.  Each "class" will be roughly 30 minutes followed up with a quiz.  So I'm curious if I would need an LMS to handle the quizzing since there's no compliance issues here, I just want to be assured that they paid attention and completed the training.  Since it's all internal, can I just build out the training programs in captivate, publish to our site and collect the quiz results via e-mail or some other deliver?  Or is there always a need for an LMS?
    Thanks for any advice, this is a little bit more than I anticipated when I dreamed up the idea (isn't it always).
    Aaron

    LMSs are typically very expensive and clunky. Though there is at least one
    'free' LMS, but if you don't have web development and database skills, you
    could find that 'free' is anything but.
    If you simply want to do a test and capture the scores, Captivate does come
    with a basic feature that allows to you 'roll your own' tracking via a web
    server, some scripting and a database. If you have web skills, this could
    be an easy option.
    If you find even that daunting, you could build your lessons in Captivate,
    then utilize online quizzing and survey tools to do your own free or very
    cheap quizzes. I've not looked at using them for this purpose, but for
    instance SurveyMonkey and Zoomerang are popular options that have
    comprehensive reporting features.
    Steve

  • Error with the Scope parameter for component

    Hi, I am using JSF2.0 in my web. In the home page (index.xhtml) i have an album gallery with session scope. However the gallery is available to all the users, what should be the scope for this component? After setting session scope, a session key is generated which is appended with the URL and because of this (perhaps) other links are not opening. i mean whenever i clicks on any link (about.xhtml), it displays nothing. Removing the bean from session scope makes everything fine except gallery (gallery doesn't rendered).

    That version of the package has been built with apache 2.2.x. Be sure to use that version of apache too, as 2.0 won't work with that specific package.

  • Scope of this forum???

    The sticky post at the top of this forum is kind of useless.  It doesn't actually specify what the scope of this forum is. It just makes general references to what the scope of OTHER forums are.
    I was expecting to see a sentence something like this: "Please use this forum to discuss issues relating to ...",  or "This forum is meant as a place to discuss the following issues ..."
    The only way I can see to determine the scope of this forum is by its title "Visual C++", which of course is pretty vague.

    On the left-hand side, click [view all] next to Forums. In the dialog that opens, mouse over individual forums on the left, and see the description on the right. For this forum, it reads:
    Visual C++
    Discuss and ask questions about the Visual C++ IDE, libraries, samples, tools, setup, and Windows programming using MFC and ATL.
     Note that the sticky post is dated 2005. Once upon a time, there was a fine-grained hierarchy of forums dedicated to C++ (you can still see some of them in that All Forums dialog, under Archived Forums V). Then a Grand Consolidation happened, and most
    of them got deprecated. Only two remain - this one, and
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vclanguage
    C++ Standards, Extensions, and Interop
    Issues regarding the C++ language, compiler, and linker. This forum covers all standardized languages, extensions, and interop technologies supported by Visual C++.
    Igor Tandetnik

  • Is this the best way to write this in AS3

    I have converted my old AS2 to As3. It now appears to work the same as before but being new to AS3 I have a few questions.
    In this example I click on a button which takes me to a keyframe that plays a MC. There is another btn that takes me back to the original page.
    In AS2 it is written like this.
    // Go to keyFrame btn
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Scul_mc");
    //End Behavior
    // Play Movie
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Movie");
    //End Behavior
    //load Movie Behavior
    if(this.mcContentHolder == Number(this.mcContentHolder)){
    loadMovieNum("PL_Japan_Scul.swf",this.mcContentHolder);
    } else {
    this.mcContentHolder.loadMovie("PL_Japan_Scul.swf");
    //End Behavior
    // Return key
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Intro");
    //End Behavior
    In AS3 it is written like this.
    // Play Movie
    var myrequest_Jpn:URLRequest=new URLRequest("PL_Japan_Scul.swf");
    var myloader_Jpn:Loader=new Loader();
    myloader_Jpn.load(myrequest_Jpn);
    function movieLoaded_Jpn(myevent_Jpn:Event):void {
    stage.addChild(myloader_Jpn);
    var mycontent:MovieClip=myevent_Jpn.target.content;
    mycontent.x=20;
    mycontent.y=20;
    //unload method - Return to keyframe
    function Rtn_Jpn_Intro_(e:Event):void {
    gotoAndStop("Japan_Intro");
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    function removeMovie_Jpn(myevent_Jpn:MouseEvent):void {
    myloader_Jpn.unload();
    myloader_Jpn.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded_Jpn);
    Rtn_Jpn_Intro_btn.addEventListener("click",Rtn_Jpn_Intro_);
    // Go to keyFrame btn
    function Scul_Play(e:Event):void {
    gotoAndStop("Jpn_Scul_mc");
    Jpn_Scul_btn.addEventListener("click",Scul_Play);
    1. Is there a better, more efficient way to achieve this in AS3?
    2. I have used an //unload method in the AS3 script which does remove the MC from the scene but I notice in the output tab my variable code is still being counted for the last MC played.
    Is this normal?

    Hi Andrei, I have started a new project and taken your advice to construct it with a different architecture with all the code in one place.
    I have two questions regarding your last code update.
    var myrequest_Jpn:URLRequest;
    var myloader_Jpn:Loader;
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    Jpn_Scul_btn.addEventListener(MouseEvent.CLICK, Scul_Play);
    function Scul_Play(e:MouseEvent):void {
         myrequest_Jpn = new URLRequest("PL_Japan_Scul.swf");
         myloader_Jpn = new Loader();
         myloader_Jpn.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded_Jpn);
         myloader_Jpn.load(myrequest_Jpn);
    function movieLoaded_Jpn(e:Event):void {
         // remove listener
         myevent_Jpn.target.removeEventListener(Event.COMPLETE, movieLoaded_Jpn);
         this.addChild(myloader_Jpn);
         myloader_Jpn.x = 20;
         myloader_Jpn.y = 20;
         // remove objects that are in "Japan_Intro" frame
    function removeMovie_Jpn(e:MouseEvent):void {
         // add back objects that are in "Japan_Intro" frame
         // remove from display list
         this.removeChild(myloader_Jpn);
         myloader_Jpn.unload();
         myloader_Jpn = null;
         // this moved from Rtn_Jpn_Intro_ function
         //gotoAndStop("Japan_Intro");
    Its all works great except for the line to remove event..
    1.
    myevent_Jpn.target.removeEventListener(Event.COMPLETE, movieLoaded_Jpn);
    I get an error:   1120: Access of undefined property myevent_Jpn.
    Removing this statement allows the code to work but that is not a solution.
    2.
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    I would like this button to remove more than one movie. Is this possible.
    Thanks for the help todate.

  • What is the scope of implicit loop variables?

    Hi,
    I'm facing some strange error from the ABSL editor (syntax checker).
    In ABSL the loop variables are implicit and don't have to be declared in the head section of the script.
    My question now is simple: How is the scope/visibility of such loop variables specified ?
    There's a complete code snippet below.
    In line no.9, there's the first time use of implicit loop variable 'task_inst'.
    Because of type inference, it will be typed as MasterDataWanneBe/Tasks (which is my own BO type).
    In line no.20, I want to use the same variable name in a different loop, outside the parenthesis/scope of the first first use.
    Now the ABSL syntax checker complains about incompatible types (see code snippet)
    Thus the type inference should result in the, (lets say 'local') type Project/Task, which is the one I was querying for.
    To me it looks like, that loop variables implicitly get a global scope (hopefully bound to this ABSL file only).
    I would like to see the scope/visibility of loop variables restricted to the parenthesis.
    In other words only inside the loop.
    Hint
    I heard (from little sparrows), that local variable scoping is not possible because of underlying
    generated ABAP code. If so, than it would be helpful to print warnings, in case of types are compatible
    but used in different scopes. Think about the unintended side effects.
    import ABSL;
    import AP.ProjectManagement.Global;
    var query_tasks;
    var query_tasks_param;
    var query_tasks_result;
    foreach (empl_inst in this.Employees) {
         foreach (task_inst in empl_inst.Tasks) {
             //   ^^^^^^^^^  first time use
              task_inst.Delete();
    // ===========================================================================
    query_tasks = Project.Task.QueryByResponsibleEmployee;
    query_tasks_param = query_tasks.CreateSelectionParams();
    query_tasks_result = query_tasks.Execute(query_tasks_param);
    foreach (task_inst in query_tasks_result) {
          // ^^^^^^^^^ Error: 4
          // The foreach loop variable is already inferred to an incompatible type:
          // Node(MasterDataWanneBe/Tasks). Expected Node(Project/Task)

    Yes, variable declarations in ByD Scripting Language indeed have (snippet) global visibility. In the FP 3.0 release the variables can be declared anywhere in the snippet (not only in the beginning, as with FP 2.6), however still not within code blocks, i.e. within curly braces ({}). Therefore variable name shadowing is still not supported and because of the global visibility of variables they cannot be reused for a different type, later in the same snippet. This is because of the statically typed nature of ByD Script, despite the type inference convenience.
    Kind regards,
    Andreas Mueller

  • PLease Help: Does anyone know how to retain the Scope in the Header Tag when converting a table in

    I am trying to convert aa Word Document with Tables containing Data and Header Columns to retain the Scope="col" when it is converted to PDF.
    After the PDF is created, I check my Header Tags and everything looks fine however the Scope is null and I need to somehow retain scope=columes in order to certify this report is 508 compliant.
    For those who are interested; the html should be:
    <th scope="col"> Color </th>
    My html is coming across the PDF distiller is only <th >     </th>
    Maybe there is another piece of software that does this correctly? I tried OpenOffice - the same problem occurs.
    Thank you
    Mark

    Please post in the Acrobat forum. This forum is for the Adobe Distiller SERVER product. Your question does not involve Distiller Server.

  • How to close the scopes / preview window

    I guess I have the opposite problem that most people have (I did try to do a search on this one). I would like to close or disable the scopes/preview window. Is there anyway to do this?
    I am running 1 large monitor and would love to just have the main color interface fill the entire screen. (I have read that color is designed for 2 monitors.. but it's easier to fit one large (28") monitor on my desk rather than 2 smaller ones) In single display mode, I can minimize the scopes window, but I can't seem to maximize the main color window. If I do dual monitor mode, I can minimize the scopes window, but when I hit play, it pops up and jumps in front of my main window. I have a kona for my external monitor and I have an external scope.
    Is there anything I can do? Did Apple just not give us many ways to customize the interface (Can't re-size the main color window)? I am running color 1.0.4 on OS X 10.4.11 (on a G5), and have the ATI X800 XT.
    Thanks so much,
    Peter

    +Then the scopes screen jumps in front of my main grading window.+
    Don't know why this is happening to you. Under window set for a single display and restart Color. If your doing DVD/TV work the only monitor that going to be any help is a grading TV monitor. A second computer monitor would be a waste and useless.
    I have a two screen setup. I mainly do work for internet delivery. I have Color set up for single display. My main monitor (calibrated as close as I can get it) is better than my second monitor. And that's were I view my Quicktime videos. The second monitor is only used for programs tools/pallets. When I do something for TV I set up a second TV monitor.

  • "this" in as3

    How would I do this in AS3? I want to call a function and run
    it with specific properties depending on which button is clicked.
    So how do the "_this" statement work in as3? in as2 I would write
    something like this and "this" would stand for the instance
    name:

    You just call the same function when you set up your event
    listener - and
    then use the target property of the event to get which button
    was clicked.
    For instance, say you have two buttons on stage - instance
    names a and b:
    a.addEventListener(MouseEvent.CLICK, btnPressed);
    b.addEventListener(MouseEvent.CLICK, btnPressed);
    function btnPressed(e:MouseEvent){
    trace(e.target.name);
    e.target.y -= 10;
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How can I prevent the flushing of the buffer until the playing is finished in AS3?

    How can I prevent the flushing of the buffer until the playing is finished in AS3?
    Is it possible?
    The buffer is emptied and flushed 10-11 seconds before the real end of the flv file.
    The file is locally saved and I stream it though crtmp server.
    I cannot seek the last 10 seconds because of empty buffer. How can I stop flash from flushing the buffer at end?

    i used the same code and i got it working correctly...
    thanx a lot fot it...
    now i have one more problem with it.
    Actually i created a new class 'ErrorDialog' and the function showErrorDialog() inside it.
    now i want the option YES_NO_OPTION and the function sayshowMsgDialog() returning int value indicating the option selected from the dialog box.
    I tried it with following code
    public
    static
    int
    confirmDialog( String message_in, Component parent_in, String title_in,
    int messageType_in )
    try
    JOptionPane pane = new JOptionPane( message_in, messageType_in,
    JOptionPane.YES_NO_OPTION );
    JDialog dialog = pane.createDialog( parent_in, title_in );
    dialog.setResizable( false );
    dialog.show();
    int optionType = -1;
    try
    optionType = ( ( Integer )( pane.getValue() ) ).intValue();
    catch( Exception ee )
    optionType = -1;
    dialog.dispose();
    return optionType;
    catch( Exception e )
    e.printStackTrace();
    but, since return is after dispose() it is throwing an error 'missing return value'
    can i get some kind of solution for this?
    waiting eagerly...........
    -Soni

  • The Scope of Customers,Suppliers,.....

    hi all
    in our company we setup 1 Set of books, 1 Legal Entity , 1 Operating Unit
    i want to know the Scope of the customers displayed in Sales Order , Suppliers Displayed in PO, Bank Accounts , items , ........
    these things displayed at level of SOB Or LE Or Operating Unit,
    and i would be grateful if any one send adocument explain the scope of all these things ,
    this is because we need to implement new site at our Company , So i want to specify if i define it as a new operating unit , or New Legal Entity , Or New Set Of Book, Or New HR/INV Organization.
    thanks

    Hello Reddy,
    We are about to implement the HCM module (We are now in the testing
    phase), on the same client as that of our SAP ERP implementation.
    We need to authorize on the personnel number grouped by 'Payroll Area'
    in transactions PA30, PA40
    In authorization object P_ORGIN, the field VDSK1 is already used to
    authorize on an attribute : cost center (organizational key) for each
    organizational unit, so we can't configure it to authorize on other
    fields from info type 0001 (e.g. Payroll Area).
    We need to continue using the conventional / general authorization and
    not the structural authorization, to stay in compliance with our
    authorization schema already implemented in our FI, MM, SD & CS modules.
    ( Also, as per thread : Steps for creating structural authorization profile using trans. OOSP
    the structural authorization cannot be used to authorize on Payroll Area.)
    We need to go through the HR module implementation without any changes
    in the ABAP code.
    So, the last way out is the custom-specific authorization object, and as I mentioned before, the authorization object P_ORGIN was already used in other ERP modules; e.g. FI, MM, SD & CS,
    ( Note : I haven't started yet implementing this solution.)
    Thanks.
    Reda

  • How do you abort the Scope Fetch before a trigger occurs.

    I'm using a NI PCI 5112 scope card.  I've configured the start trigger on PFI 1 input with no timeout.   There does not appear to be any way to abort or reset the hardware once the niScope Fetch Binary 8.vi is waiting for the start trigger.  Does anyone know how to kill the niScope Fentch Binary 8.vi before the trigger is recieved?  (winthout restarting the computer!!!)
    I'm programming in LabVIEW 7.1.1

    As long as you are in the Fetch call, all other calls to the Scope
    driver will block until Fetch exits.  That's why the Abort doesn't
    do anything.  You have two options:
      1) Use a finite timeout.  Obviously, you are running into
    cases in which the trigger does not arrive, and want to exit
    cleanly.  This is exactly what the timeout is for.
      2) Determine the acquisition state before calling fetch. 
    If this is a finite, single-record acquisition, poll on acquisition
    status and do not call fetch until the status is 1 (acquisition
    complete).  If you're doing a finite, multi-record acquisition,
    poll on the Fetch>>Records Done property and only fetch the
    records that have completed.  If you're doing a continuous
    acquisition, poll on the Fetch>>Points Done or Fetch>>Fetch
    Backlog property and only fetch the number of points that have been
    acquired.
    There's no clean way to break the infinite timeout fetch without forcing LabVIEW to close.

  • Address Leases not appeared in the scopes at DHCP Windows 2008 R2 ent

    Hi Friends,
    Recently couple of days ago we have migrated from DHCP Server ( Windows Server 2003 R2 32 ) to Windows Server 2008 R2 64 bit Virtual Machine.
    After migration, most of the scopes seem empty, no Address Leases appeared in the scopes even most of the reservations also not appeared from DHCP MMC but the client machines obtaining IPs and DHCP VM is working fine.
    After investigation I have found following event log errors.
    Are these event log errors related to this Issue and what will be problem. Please advise.
    ===============================================================================
    Log Name:      Application
    Source:        Microsoft-Windows-LoadPerf
    Date:          9/1/2014 10:01:28 AM
    Event ID:      3002
    Task Category: None
    Level:         Error
    Keywords:     
    User:          SYSTEM
    Computer:      SERVER-DHCP1.com
    Description:
    The performance counter explain text string value in the registry is not formatted correctly. The malformed string is . The first DWORD in the Data section contains the index value to the malformed string while the second and third DWORDs in the Data section
    contain the last valid index values.
    Event Xml:
    <Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='Microsoft-Windows-LoadPerf' Guid='{122EE297-BB47-41AE-B265-1CA8D1886D40}'/><EventID>3002</EventID><Version>0</Version><Level>2</Level><Task>0</Task><Opcode>0</Opcode><Keywords>0x8000000000000000</Keywords><TimeCreated
    SystemTime='2014-09-01T07:01:28.858089200Z'/><EventRecordID>10800</EventRecordID><Correlation/><Execution ProcessID='3108' ThreadID='1628'/><Channel>Application</Channel><Computer>SERVER-DHCP1.Server.com.sa</Computer><Security
    UserID='S-1-5-18'/></System><UserData><EventXML xmlns:auto-ns2='http://schemas.microsoft.com/win/2004/08/events' xmlns='LoadPerf'><param1></param1><binaryDataSize>16</binaryDataSize><binaryData>000000006B1700006B170000980B0000</binaryData></EventXML></UserData></Event>
    Log Name:      System
    Source:        Service Control Manager
    Date:          9/1/2014 9:59:39 AM
    Event ID:      7023
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      SERVER-DHCP1.com
    Description:
    The WMI Performance Adapter service terminated with the following error:
    %%-2147467259
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
        <EventID Qualifiers="49152">7023</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8080000000000000</Keywords>
        <TimeCreated SystemTime="2014-09-01T06:59:39.967870200Z" />
        <EventRecordID>29732</EventRecordID>
        <Correlation />
        <Execution ProcessID="504" ThreadID="3080" />
        <Channel>System</Channel>
        <Computer>SERVER-DHCP1. com</Computer>
        <Security />
      </System>
      <EventData>
        <Data Name="param1">WMI Performance Adapter</Data>
        <Data Name="param2">%%-2147467259</Data>
      </EventData>
    </Event>
    Thanks in Advanced.
    Regards,Ali

    Hi Ali,
    check this post: http://social.technet.microsoft.com/Forums/windowsserver/en-US/1b8cd762-3f95-4ff9-9d9e-75b04e067d2a/server-2008-dhcp-assigns-leases-but-never-displays-leases-in-the-gui?forum=winserverNIS
    Perform these steps from new W2K8 DHCP server:
    Open DHCP mmc
    Open Command prompt: cmd
    Type: netsh dhcp server export C:\dhcp.txt all in command prompt and press Enter
    Delete ALL scope information from within the DHCP mmc
    Type: netsh dhcp server import C:\dhcp.txt all in command prompt and press Enter
    Right-click server name within DHCP mmc and choose refresh

  • [basic] the scope of motion control in LV

    I am a very beginner in motor control part.
    Very recently, some motor need to use some proper control board in control unit or PC.
    If so, what is the scope of the motion control driver (library) in LabVIEW developement version?
    Some restricted motor type?
    What other instrument should I prepare to use the driver?
    What's the difference between this type(PC or control board) and NI motion controller?
    Any materials for beginner should be welcomed.

    For getting started with NI Motion Control I recommend this website. Here you will find tutorials, webcasts, selection guides and much more.
    In general NI Motion solutions are not limited to specific motor types or applications. Depending on your application requirements you can select between motion control plugin-boards or software defined systems based on real-time hardware and/or FPGA technology.
    Please have a look at our web resources first and post any specific questions to the forum.
    Thanks,
    Jochen Klier
    National Instruments

  • How to set the scope for Mxml classes?

    Hi,
    i want to create the mxml class but with internal (package)
    scope (for example).
    Is it possible? (for AS classes yes)

    Don't think you can control scope like this in MXML.

Maybe you are looking for

  • Install OAS 10.1.2.0.2 Linux(opteron)

    Hi, one Question: Is it possible to install an OAS 10.1.2.0.2 (Portal ..) under Red Hat on an Opteron-Server - I know, it's not certificated in 64bit-mode but in 32bit mode ....? Thanks Karl

  • N1 Segment in ACH CTX Flat File Payment Run

    Hi All, I'm trying to create a flat file for ACH CTX using PMW  from payment run I copied the Standard FM's and modified them as per our needs My only question is it don't see some segment like N1 Segment I believe  it contains Payor Company, Payee C

  • How to create Materialize view using Sysdate

    I need to create a materialize view having SYSDATE in its WHERE clause. Can i any let me know how can i do it. I know there is some documentation on that in ORACLE but i could not find it . Thanks

  • No images showing in LR2.6

    I am running LR2.6 on a Dell XPS435T 64b W7.  I downloaded LR2.6, and it seemed to work ok for a while.  Now when I open my catalog there are no images, only gray squares.  The correct metatata shows on the side bar, as do the rating stars on each gr

  • Broken iBook Power Button

    I recently tried to replace the inverter cable in my iBook because the LCD backlight was malfunctioning so doing it myself was much cheaper than getting it done by certain companies we know, however in taking apart the iBook I accidetnaly pulled the