I am getting a 1056 error in my custom class file and cannot figure out why... Help

Here is the error I am getting:
ReferenceError: Error #1056: Cannot create property button1 on com.sample.PWClass.PClass.
Here is my code:
package com.sample.PWClass {
    import flash.display.MovieClip; 
    import flash.events.MouseEvent; 
    import flash.text.TextField; 
    public class PClass extends MovieClip { 
        private var totalChar=8;// number of chars in the password 
        private var xcom:String="abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ"; 
        private var xcomnum:String="0123456789"; 
        private var l_length=xcom.length; 
        private var n_length=xcomnum.length; 
        private var new_password:String=new String();// set the inital variable 
        public function PClass() { 
            button1.addEventListener(MouseEvent.CLICK,onClickHandler); 
        private function onClickHandler(evt:MouseEvent):void { 
            mark.text = newPassword(); 
            trace(mark.text); 
        private function newPassword() { 
            new_password=new String(); 
            for (var i=0; i < totalChar; i++) {// loop and create password 
                var a=xcom.charAt(Math.floor(Math.random() * l_length)); 
                var b=xcomnum.charAt(Math.floor(Math.random() * n_length)); 
                var char=Math.floor(Math.random() * totalChar) % 2 == 0?a:b; 
                new_password+= char; 
            return new_password; 

If this is not your document class, since button1 is not created within the class, there is nothing provided to reference it as an external object.  You need to pass in a reference to it.

Similar Messages

  • I installed dropbox in my applications and now I want to delete it.  Dragging it to the trash isn't working because I get a message that dropbox is open, but I have hardly used it at all and cannot figure out why or how it is open.

    When I try to uninstall dropbox I get a message that it's open, however, I never use dropbox and cannot figure out how to close it in order to move it to the trash.

    Look in the menubar for a blue icon shaped like an open box and click on it. Click on the gear icon and select quit. Now you can throw it away. DropBox is an almost faceless program - it puts an icon in the menu bar and that's all it shows.

  • I purchased a book from itunes and cannot figure out how to get it on my ipod nano 7.  I cannot find an answer that works.

    I purchased an audio book from itunes and cannot figure out how to get it on my nano 7.  I have tried everything. 

    Have you double checked to make sure these Audiobooks are configured to sync to your iPod from under the iPod's Books configuration tab in iTunes?  This is assuming that the audiobooks are already stored in your iTunes library and appear under the Books category.
    To access this configuration tab, plug in your iPod and select it from under the Devices section in the left hand pane of iTunes to bring yourself to the iPod's Summary tab. Now locate the Books tab across the top in the main iTunes window and select it. Here you can configure what and how audiobooks are synced to the device.
    If you make any changes to this tab, make sure to hit the Apply button on in the lower right hand corner. This will sync the updated changes to your device.
    B-rock

  • I'm having a lot of issues with firefox and cannot figure out how to get help. It began when I updated to 13. I get all kinds of ad popups, I cannot play one

    I'm having a lot of issues with firefox and cannot figure out how to get help. It began when I updated to 13. I get all kinds of ad popups, I cannot play one game on FaceBook called Farm Town at all, and I keep getting an AVG popup about cookies that I cannot get rid of. These issues are causing me to use Chrome very often even though I like Fox better. I've searched and searched how to get help and cannot find anything. How does one get personal technical help?? These issues do not happen in Chrome at all. Thanks.

    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    You can also do a check for a rootkit infection with TDSSKiller.
    *http://support.kaspersky.com/viruses/solutions?qid=208280684
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • I just bought an ipod nano and cannot figure out how to sync the music from itunes onto it. i go to itunes and nothing happens. Is there a sync button im not seeing? I get my playlisits but that is it.

    just bought an ipod nano and cannot figure out how to sync the music from itunes onto it. i go to itunes and nothing happens. Is there a sync button im not seeing? I get my playlisits but that is it.
    ALSO does anyone know how to have 2 ipods on 1 computer but seperate?

    Hi there,
    I would recommend taking a look at the information found in the articles below. The first two articles have the same content, but are geared towards either OS X or Windows.
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad
    http://support.apple.com/kb/PH12313
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad
    http://support.apple.com/kb/PH12113
    How to use multiple iPhone, iPad, or iPod devices with one computer
    http://support.apple.com/kb/ht1495
    -Griff W.

  • I lost the little white balance dropper thingy and the option to change exposure and cannot figure out how to get them back! Help! Thank you!

    I lost the little white balance dropper thingy and the option to change exposure and cannot figure out how to get them back! Help! Thank you!

    Are you saying you've lost the "Basic" tool tab?
    If yes, just right-click on one of the other tabs and select "Basic" from the context menu that's presented.

  • I upgraded to the new version "4" and it will not load any websites..."unable to locate server" is all i get and cannot figure out the problem ....had to delete and go back to an earlier version whichi understand is unsafe...what to do?

    # Question
    I upgraded to the new version "4" and it will not load any websites..."unable to locate server" is all i get and cannot figure out the problem ....had to delete and go back to an earlier version which i understand is unsafe...what to do?

    That was probably caused by your Firewall blocking the newly installed version of Firefox.
    No known security issues with Firefox 3.6.17, which was just released this past week.

  • My Canon MP620 appears to be connected, yet every time I try to print something, it says error.  I have tried to unplug and track the error, but I cannot figure out why. Please help! this is such an inconvenience!

    My Canon MP620 appears to be connected, yet every time I try to print something, it says error.  I have tried to unplug and track the error, but I cannot figure out why. Please help! this is such an inconvenience!

    What Mac model? What Mac OS version?
    FYI, this forum is for Apple hardware made before 1999.

  • My computer crashed and I was using Chrome, not have firefox and cannot figure out how to get my "Favorites" into firefox. I have located the file on my computer, but it's not on any ISP.

    I am trying to get my computer back in working order and use Firefox instead of Chrome. I have my "favorites" folder on my desktop but cannot figure out how to link it to my Bookmarks and get websites to come up.

    If your "folder of things" are bookmarks exported from Chrome then see the link that Tony has already posted ie
    [[Importing bookmarks from Google Chrome. ]] '''<-- clickable link above '''
    Once you have those bookmarks in firefox use the firefox Bookmarks menu to see and click on the required bookmark, that will take you to the location of that bookmark, which usually will be somewhere out on the Internet.
    To use bookmarks in firefox read [http://www.mozilla.com/en-US/firefox/features/#bookmarking Firefox Features]

  • How can I get my playlists/music on my Itunes libray and iphone?  I only have it on my iPad and cannot figure out how to sync to all.

    I have an iPad mini and iphone 5s.  My ipad has all of my music on it but my iphone won't sync any music or playlist to it.  Iphone has a random choice of about 20 songs on its playlist.  My itunes library does not show any playlists or music/app purchases.  I already clicked the "Transfer Purchases" button and it didn't do anything.  My icloud is turned on on both devices.  Not sure what I am doing wrong... (I'm also not a pro with apple technology)

    I downloaded Itunes 10.2 on new desktop, ran sync with my ipod touch (Gen 2) and have all my music on new PC.  Just can't get it to sync with my Apple TV (Gen1).  I have made music purchases on Apple TV and cannot get them to Ipod/Iphone?  Help

  • On my new desktop, for the first time ever, I cannot access my gmail through Mozilla without getting a "get me out of here" option and I cannot figure out why.

    I have been trying all day to access gmail on mozilla. I installed, uninstalled, and re-installed Firefox and I keep getting the same warning whenever I try gmail. All other sites function perfectly.

    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can remove all data stored in Firefox from a specific domain via "Forget About This Site" in the right-click context menu of an history entry ("History > Show All History" or "View > Sidebar > History") or via the about:permissions page.
    Using "Forget About This Site" will remove all data stored in Firefox from that domain like bookmarks, cookies, passwords, cache, history, and exceptions, so be cautious and if you have a password or other data from that domain that you do not want to lose then make sure to backup this data or make a note.
    You can't recover from this 'forget' unless you have a backup of the involved files.
    It doesn't have any lasting effect, so if you revisit such a 'forgotten' website then data from that website will be saved once again.

  • Accidentally "Hibernated" a Tab Group and cannot figure out how to get it back!!! WHERE did it go and how do I get it back???

    I accidentally put one of my tabbed groups into hibernate. HOW do I get it back? There were about 10-12 tabs open in there and I have NO idea how to get them back! This has happened before but it was no biggie, this time there were some important tabs that I do not remember what they all exactly were! Somehow I clicked the tabbed group and bunch of "zzz's" appeared and then when I went to click off, my group disappeared! Does ANYONE know how to correct this?

    What do you mean with that you "hibernated a tab group"?
    Did toy delete (remove) this tab group?
    App tabs and tab groups are stored in the sessionstore.js in the Firefox profile folder.<br />
    You can try to restore a previous version of this file to see if that restores the lost group.
    *Right-click this file in Windows Explorer: Properties > Previous Versions
    *http://windows.microsoft.com/en-US/windows7/Previous-versions-of-files-frequently-asked-questions
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Open Directory)
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • I am trying to show Utube video's on my church iMac through our projector and cannot figure out an easy way to get the video from my iMac screen to the projection screen?

    How do you easily show Utube video's up on a projection screen using an iMac?

    The first thing we need to know is exactly which model iMac you have and which model projector you have. This will help us point you to the correct video adapter/cable. Video output standards have changed dramatically over the years utilizing both analog and digital signals. Once we know which outputs and inputs each device has we can make a recommendation.
    Here's an article that shows the various Apple video ports.
    http://support.apple.com/kb/PH10567
    Your project will likely have one or all of the following VGA (analog), DVI (digital), or HDMI ports that can be used to connect your iMac.
    This article lists the various video cables and adapters available from Apple.
    http://support.apple.com/kb/HT3235

  • My hard drive crashed and was replaced. In the process my Photoshop has developed errors. I need to reinstall it. I have the online version and cannot figure out how to reinstall the same?

    Need to reinstall photoshop CS 6. I had purchased the online version. Please let me know how I can set it up again.

    Like you did before you download and install Photoshop onto your machine it runs on your machine.  Follow the download instructions else you will be denied access Download CS6 products

  • Been sat here for the past 5 hours trying to figure out why itunes wont download, it says error and something to do with Microsoft? Help me please.. getting a bit bored?

    been sat here for the past 5 hours trying to figure out why itunes wont download, it says error and something to do with Microsoft version? Help me please.. getting a bit bored?

    i have this problem too
    my dad thinks its because itunes is getting overloaded

Maybe you are looking for

  • What's with the ro ?

    Hi, I've spotted that in the grub menu.list, the / partition is mounted ro. Whereas with other distribs (like openSUSE) it isn't. And if with openSUSE you try to add ro, it fails to start properly. What happens if I start Arch without ro in the grub

  • How can I get email on my phone?

    My email quit downloading to my I phone 4 on April 9, 2014, how can I get it back up?

  • Needing to authorize on one library more than once

    My laptop apparently has a multiple personality. One the same user library that I recently de-authorized, then re-authorized, when I try to play a number of songs, I now get a a prompt on some (but not all)tunes telling me that I need to authorize th

  • Light and dark solid grey vertical lines appear randomly on screen

    This has happened about 4 times in the last couple of months, when these light and dark solid grey lines appear on my screen, I have to turn my computer off by holding down the power button and rebooting it, it fixes the problem for the time being. T

  • When I get a call on Viber swiping the screen cuts off the call

    Everytime I get a call on Viber I need to swipe the screen and enter my PIN to answer the call. When I swipe the screen it imediatly cuts off the call. Does anyone else have this problem?