#1180 access main.as function error

Hi all

I have a crushing deadline. I was reusing AS2 and try to update one year AS3 movie player.

I had a problem getting an instance of a custom class ComboBox CHANGE event to perform a function in the main.as ComboBox is added to that. It displays. This allows me to get the thin data value.

My main THAT the file is "ZMoviePlayer". The ComboBox class is LanguageMenu.

AS3 CS6 Player 10.3

(Class hand AS - ZMoviePlayer)

com of the packaging. {Of Zebra

import com. Zebra.ZMovieUI.ZMovieUI;

import com. Zebra.ZMovieUI.LanguageMenu;

Import fl.controls.ComboBox;

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.MouseEvent;

Import fl.lang.Locale;

...

SerializableAttribute public class ZMoviePlayer extends MovieClip {}

public static var Lang: String = new String();

public var Lang: String = new String();

public var movieUI:ZMovieUI = new ZMovieUI();

public var LangMenu:LanguageMenu = new LanguageMenu(); ComboBox

...

(this loads objects presentations and combobox - no problem)

public void done(event:LoaderEvent):void {}

movieUI.x = 0;

movieUI.y = 0;

addChild (movieUI);

...

LangMenu.x = 618;

LangMenu.y = 20;

addChild (LangMenu); ComboBox-

}

(the function in the class I want to call and pass Var Lang)

(Class LanguageMenu - combobox)

com of the packaging. {Zebra.ZMovieUI}

import com. Zebra.ZMoviePlayer;

import com. Zebra.ZMovieUI.ZMovieUI;

import com. Zebra.ZMovieUI.ZButtons. *;

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.MouseEvent;

Import fl.controls.ComboBox;

import flash.text.TextFormat;

import flash.text.Font;

Import fl.data.DataProvider;

import flash.text.TextField;

Import fl.lang.Locale;

...

public void init (): void {}
var menu1:ComboBox = new more;
var cbTxtformat:TextFormat = new TextFormat();
cbTxtformat.size = 12;   Allows to simply increase the font size

Increase the font size of main TextField of your ComboBox
Menu1. TextField.SetStyle ("textFormat", cbTxtformat);

Increase the font size of the components dropDownList
Menu1. DropDown.setRendererStyle ("textFormat", cbTxtformat);

Menu1. Width = 165;
Menu1. Height = 24;
Menu1. RowCount = 24;
Menu1.addEventListener (Event.CHANGE, changeHandler);
addChild (menu1);

...

public void changeHandler(event:Event):void {}
var Lang: String;
Lang = ComboBox (event.currentTarget).selectedItem.data;
ZMoviePlayer.Lang = Lang;
trace (ZMoviePlayer.Lang);
Locale.loadLanguageXML (Lang);

ZMoviePlayer.loadLang (Lang);
loadLang (Lang);    1180: call to a method may be undefined

}

Thank you

Jim

If you want to call the parent class to treat a function using the value of Lang, you should have the child send a CustomEvent who carries the Lang value.  So, you will want to create a CustomEvent class for this...

AS3 - custom event class
------------------------

package
{
import flash.events.Event;
SerializableAttribute public class CustomEvent extends Event
{
public var params: Object;
public void CustomEvent (type: String, params: Object, bubbles: Boolean = false, cancelable: Boolean = false)
{
Super (type, bubbles, cancelable);
This.params = params;
}
Public Overrides function clone (): event
{
return new CustomEvent (type, params, bubbles, cancelable);
}
         
Public Overrides function toString (): String
{
Return formatToString ("CustomEvent", "params", "type", "bubbles", "cancelable", "eventPhase");
}
         
}
    
}

Use:

(1) when you instantiate the LangMenu object, assign an event listener to listen to the CustomEvent:

LangMenu.addEventListener ("langmenuEvent", eventHandler);

(2) create the event handler for it in the main class as well:

private void eventHandler(e:CustomEvent):void {}

trace (e.params.lang);  to check if the data is sent

loadLang (e.params.lang);

}

(3) to send the event in your changeHandler function:

dispatchEvent (new CustomEvent ("langmenuEvent", {lang: Lang}));

You can spend several properties in this second argument of the object

(Note: If problem dispatchEvent, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)

Tags: Adobe Animate

Similar Questions

  • I am adadministrator but I can not access my computer functions

    2 days ago, I think I've accidentally changed my security settings for my: C drive while checking my computer ( don't know if this is the real reason however). I am the administrator on the computer and there is no other users. whenever I connect it denies access to my characteristics.  on the accounts in the control panel it says that I am administrator but he always tells me that I need to contact my administrator when using functions as the uninstall programs and features.  I ran an avg full deep scan off my computer and his own come so I'm almost certain that this is not a virus.  I'm running Windows Vista Home premium and I've never experienced this before.  whenever I start the computer, it starts to fuck as usual and then I get loads of pop ups for example:

    -Google Installer has stopped working
    -Apple sync notifier "could not start because corefoundation.dll was not found (I've never heard of corefoundation.dll)"
    -browserprotect.exe has stopped working (and whenever I close the pop up back to the top again)
    -When I go to access some of my files and applications it says 'you have insufficient access, please contact the administrator '.
    -When I try to access to my: C drive, it says ' not accessible, access is denied. "
    -When I go to access the features a bit it says "the parameter is incorrect" (not sure what that means)
    I'm usually a computer wiz and use of high-quality software, command prompt and all that, but I have trouble understanding it, so don't you worry I will understand any technical language, thanks :)

    Hi Oliver,

    Exactly how you have changed the security settings for the C: drive?

    Problems to work on files and folders in Windows can be caused by permissions issues, or even corrupt corrupted user accounts.

    Method 1:
    I suggest you try the procedure described in the article and see if it helps.

    "Access denied" or other errors in the access to or work with files and folders in Windows
    http://support.Microsoft.com/kb/2623670#method4

    Method 2:
    If the problem is not resolved, I suggest you temporarily disable the security software and check if it helps.

    Disable the antivirus software
    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software

    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks.


    Method 3:
    If the problem persists, I suggest you try to run the system restore to point before that the problem began earlier and check if that helps.


    What is system restore?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-system-restore


    Note:
    when you do the system restore to restore the computer to a previous state, programs and updates that you have installed are removed.

    Hope this information helps. Answer the post with an up-to-date issue report to help you further.

  • Disk utility can't partition [exFAT], 75 GB main drive. Error.

    Disk utility can't partition [exFAT], 75 GB main drive. Error. Trying to create a new partition Windows 10. Since then, Bootcamp is crap. Try to install it manually.

    Why not install Windows 10 as a virtual machine in VMware Fusion, Parallels or Virtualbox?

  • I get the error access path/file execution error ' 75 "you try to start a product.

    I get the error access path/file execution error ' 75 "you try to start a product. How will I know which file it is trying to access. Is there a log or something?

    Hello

    1. when exactly you get this error message?

    2 have you made any changes to the computer before the show?

    Please provide more information on the issue so that we can better help you.

    In the meantime, make the boot minimum troubleshooting and check if the problem persists.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note:

    How to configure Windows to use a Normal startup state

    After you have used the boot is a way to solve your problem, you can follow these steps to configure Windows XP to start normally.

    1. Click Startand then click run.
    2. Type msconfig and click OK.
      The System Configuration utility dialog box appears.
    3. Click the general tab, click Normal Startup - load all device drivers and services, and then click OK.
    4. When you are prompted, click restart to restart the computer.
  • I installed a sniper art called win game it shows yellow field and gives Pure virtual function error

    I installed a sniper art called win game it shows yellow field and gives Pure virtual function error.

    Hello

    · What is the full error message that you receive with error code if any?

    I suggest you to refer to the manual of game for more information contact the Publisher of the game for support. There may be a specific game update that solves this problem because it seems to be linked to a C++ runtime error in the game.

  • nVidia Driver Update: "Invalid access to memory location" error

    Recently, I noticed that nVidia had updated the drivers for my GeForce 440. When I tried to install, I got an "invalid access to memory location" error and the installation failed. I thought that I still had operational drivers, then I would understand later.

    Three nights ago Windows Update took on himself to try the update for me. He uninstalled the driver with success (which I didn't have to do it because of the above error), but has no installation. Following manuals to install attempts have also failed.
    Looking at the window control panel programs and features shows that older drivers seem to be installed, but don't work do not. Also, attempts to uninstall fail with the same error.
    Because I reinstalled Vista during the summer, and made no significant changes since then, I don't have a system restore point. Careless of me, I know, but that's it.
    Is it possible to solve this problem short even after reinstall Vista or should I resign myself to a day and a half of reupdates?

    Hello SudroBrown II,

    Thanks for choosing Windows and thank you for providing an opportunity to help you.

    According to the description, it looks that you are having problems with the Nvidia graphics card. "As I understand it, you get an error message" invalid access to memory location "when you install drivers Nvidia GeForce 440.

    Make the SFC (System File Checker) scan and see if the problem occurs.

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    Answer to us if you are having problems with the graphics card or any other issue of Windows, and I'd be happy to help you.

    Good day!

    Hope this information helps.

  • Cannot access Yahoo Messenger, encounter error as Yahoo messenger does not work

    Cannot access Yahoo Messenger, encounter error as YAHOO MESSENGER NOT WORKING, CONTROL of WINDOWS.

    Cannot access Yahoo Messenger, encounter error as YAHOO MESSENGER NOT WORKING, CONTROL of WINDOWS.

    Who belongs to the instances of Yahoo Messenger
    http://www.bigblueball.com/forums/Yahoo-Messenger-support/

    http://YM.FF14.NET/forum/index.php

  • No access to windows functions.

    Recently, I bought a set of 4 programs dealing with speed PC, update drivers, disk optimizer and spy protector and malware and after executing all as it seemed them to remove a large number of programs and data, when I noticed that I couldn't stop him. A lot of my programs installed had disappeared when and when it restarts, including all the backup system and restore data was missing too. As those which he created was left. At that time I could not access the basic functions such as assistance and access to control panel, Windows Explorer, open network, etc. because he had no path etc or I didn't have permission to do. As my laptop was my own I never used a higher function access password so I was surprised to see what happens when he asked for it. These programs have been a Microsoft partner I've ever done a backup of my system before I was running them.

    My question is how can I access my top feature when I have never protected functions by a password? I really need help because I am retired and have no funds to be considered for the service. I have also no disk or the backup of the Windows 7 upgrade, because originally when I bought the laptop it came with Windows Vista on it and the drive is long gone, many years ago. Can someone help me please! Thanks for all the ideas... Don't forget, I have no installation disc. Thank you once again...

    In your new user, go to the control panel and select users.

    From there you can see the status / type of each user and make changes.

    Regarding the copy from one to the other, you'll need to Google, I'm really swamped at work and need to get back to the things that I should do.

    Have fun and don't forget that Mr. Google knows everything.

    Bob

  • Impossible to install Lotus SmartSuite 9.8.2, access to system registry error and should then stop error.

    Original title: loading lotus smartsuite in windows 7

    Loading lotus smartsuite 9.8.2 in windows 7 I get the error message ' access to system registry error and should then quiting error. "

    Hello

    The problem is specific to the application?

    If the problem is specific to Lotus SmartSuite 9.8.2 I'd contact the IBM Lotus SmartSuite support for assistance. Consult the following link:

    http://www-947.IBM.com/support/entry/portal/overview/software/Lotus/Lotus_SmartSuite

  • Can't access the c: drive, error 'access denied '. Problems began after refresh of Windows 8

    Original title: problems after update of windows 8

    Hello

    I have windows 8 sony vaio laptop

    day before yesterday I had an error at startup of windows saying CRITICAL_SYSTEM_DIED. I ran windows update since the auto repair could not help me.

    After that I am not able to use my c: drive, it says access denied. It seems that I hv has lost control over my account. It's always an administrator account, but I am not able to use it as an administrator.

    Please help quickly. Urgent!

    Hi Angel,

    For a better understanding of the issue, I would need more information on your side.

    1 having you only access c: drive?

    2. What is the full error message?

    This problem could occur due to these reasons.

    1. Because of permission problem.
    2. Corrupt system files.

    Try the steps listed here and see if it helps.

    Method 1:
    I suggest to run the (SFC) System File Checker tool and check if this solves the problem. SFC scan would be a system file corrupt on the computer search and replace.

    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows:

    Method 2:
    I suggest you try the steps in the section 1st: I get an "Access denied" error message when accessing or working with files and folders in the article and see if that can help.
    "Access denied" or other errors in the access to or work with files and folders in Windows

    Hope this information helps. Answer the post with an up-to-date issue report to help you further.

  • Whenever I try to install and update creative cloud, he's going to halfway and stop the download says "Setup could not access the critical file (error code46).

    Whenever I try to install and update creative cloud, he's going to halfway and stop the download says "Setup could not access the critical file (error code46).

    Hello

    Please refer to the instructions mentioned in the link below, it should help:

    Cannot install Creative cloud installation - error code 46

    "Setup could not access a critical file. Please try to reinstall. (error code: 46) »

    Stop creating cloud download

    Let us know if this was helpful.

    Kind regards

    Bani

  • How to access the dehaze function in Photoshop?

    How to access the dehaze function in Photoshop CC? This is supposed to be present in the new versions of Lightroom and Photoshop. I see it in Lightroom, but it cannot fine in Photoshop. Thank you.

    It is in camera raw.

  • "Access denied" pop-up error while opening the form online Adobe in IE8.

    "Access denied" pop-up error while opening the form online Adobe in IE8. I use a crosslink to connect to the customer's network and then open IE with Tunnel of App. Tried to re - install Acrobat reader several times but always present problem. Even tried to change the properties of the PDF (-> Preferences - general/Internet/Security Enhanced Edition)

    Problem is resolved...

    Fact following the steps:

    Uninstalled Adobe

    Disable anti virus running to do a fresh install of adobe reader 10.0

    Delete the adobe folder under <> \AppData\Local>Adobe and <> \AppData\Roaming>Adobe

  • Access to the PRODUCT_USER_PROFILE error

    Hello

    people 8.42.15, CRM88 Oracle on a Win 2003 Server tools
    When loging as sysadm via SQLPLUS, I have the following error:
    C:\Documents and Settings > sqlplus sysadm/s*@MYDB

    SQL * more: Release 10.2.0.1.0 - Production Wed Nov 26 16:00:54 2008

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    Access to the PRODUCT_USER_PROFILE error
    WARNING: Product user profile information has not loaded!
    You may need to run PUPBLD. SQL as SYSTEM

    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With partitioning, OLAP and Oracle Data Mining options
    Release 9.2.0.7.0 - Production jserver

    Any idea? I thank.

    Run the Oracle script %ORACLE_HOME%\sqlplus\admin\pupbld.sql

    Nicolas.

  • Error # 1120 access of undefined property ERROR. AS3

    I have a code inside an actionscript file, and I get several errors when you try to debug:

    1120: access of undefined property squares.

    1180: call to a method may be undefined addChild.

    1120: access of undefined property squares.

    1120: access of undefined property squares.

    1120: access of undefined property fl_click.

    1120: access of undefined property myTimer.

    1120: access of undefined property timerListener.

    1120: access of undefined property myTimer.

    Here is my code for my main actionscript file:

    package 
    {
        import flash.events.MouseEvent;
        import flash.display.MovieClip;
        import flash.utils.Timer;
        import flash.events.TimerEvent;
    
        public class Game extends MovieClip
        {
            public var myTimer:Timer = new Timer(50);
            public var square:Square;
            square.addEventListener(MouseEvent.CLICK, fl_click);
            myTimer.addEventListener(TimerEvent.TIMER, timerListener);
            myTimer.start();
    
            private function timerListener(e:TimerEvent):void
            {
                square.edgeCorrect;
            }
    
            private function fl_click(event:MouseEvent):void
            {
                square.moveDownABit();
            }
    
            public function Game();
            {
                square = new Square();
                addChild( square );
            }
    
    
    

    I am a beginner, so please tell me exactly what to do with my code, thanks!

    The big problem is this line:

    public void Game()

    Remove the semicolon and try to compile it again.

Maybe you are looking for

  • Tecra M5: Cannot install driver nVidia on Vista Ultimate SP1 x 86

    Today I installed the version of Vista Ultimate with SP1 (PTM51E - Bios 3.60) Since installing I can not any version of the nvidia drivers graphics card to install. "Driver Installation Module stopped working and was closed" is the error that happens

  • SD-PHOTO CARD

    MY PC BED IS NO LONGER MY SD CARD WHEN IT IS INSERTED, WHY?

  • stop a VI when its FP is closed

    I'm having a problem getting the interaction I want between two VI, I did.  I have a high level of the VI page that allows the user to choose options for tests to execute.  When they choose a Subvi opens (and in the block diagram of high level VI, it

  • wlan zbook 14 questions

    I have a brand new 14 Zbook with Windows 7 64-bit OS, where I have two questions. (1) the wifi does not work at home. Windows complains over any Internet connection. All my other devices work at home, so there is absolutely no problem with my connect

  • problems with vista ultimate fix Pack 2.

    My operating system is vista ultimate. I've recently updated to fix pack 2 such as requested by Microsoft. Since upgrading my system is unreliable. It freezes and goes through the process of repair and restoration at least once a day. I can get out o