How can I check for 'undefined'?

Hi,
I am creating a custom MP3 player where audio playback is
started by clicking on the title of the audio, but I also want to
be able to start play abck from the Play/Pause button. In order to
implement this dual approach, I am thinking of checking if a sound
has been loaded (with 'mySound.loadSound("path to sound") already
by the my titleButton.
I am thinking of doing this by checking the
'mySound.position' as that would be 'undefined' if there was no
sound loaded.
But how can I check it for being 'undefined', what woud be
the syntax? Itexpects a number so I tried -1, but that didn't work.
Or is there a better way?
Thx,
Nik
have a Play/Pause button and for it in order to

Found the answer.
The code is of course:
etc. //
if (mySound.position == undefined) {
// etc.
I had a erroe else where.
NIk

Similar Messages

  • How can I check for VSearch trojan?

    how can I check for VSearch trojan? And then remove it if found?

    Helpful Links Regarding Malware Problems
    If you are having an immediate problem with ads popping up see The Safe Mac » Adware Removal Guide, AdwareMedic, or Remove unwanted adware that displays pop-up ads and graphics on your Mac - Apple Support.
    Open Safari, select Preferences from the Safari menu. Click on Extensions icon in the toolbar. Disable all Extensions. If this stops your problem, then re-enable them one by one until the problem returns. Now remove that extension as it is causing the problem.

  • How can I check for the existence of an XML file in Illustrator Javascript??

    I'm writing a Javascript to run at startup. I want to check for the existence of XML files and process them, if they are available. How can I check for their existence?

    Your first line just sets a variable to a string value… getFiles() is a method of Folder… so
    var InputXMLDir = Folder( "D:/Brackets/Create_Bracket_Graphics/Input/XML-n-Templates/" );
    Not a PC user so I can't remember if the colon is OK…? As you appear to know the file name why bother with a folder get files anyhow you could just check if the file exists then do some thing…
    alert( File( "D:/Brackets/Create_Bracket_Graphics/Input/XML-n-Templates/brackets_men_web.xml" ).exists );

  • I just buy iPhone4 first hand on Jan 07,2013 but the warranty expire date How can i check for the date of production?

    I was bought iPhone4 16 GB on Jan 07, 2013 from online shop from Laos they told me that this iPhone from Apple in Hongkong (first hand) but I check for the warranty is already expire date. What should we do? I want to know about my iPhone4 first hand or second hand. How can i check?

    This will show you warranty status and give you an idea
    of when originally sold:
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • Can I exit from paintComponent?  ...or... how can I check for invalid data?

    I'm writing a calendar applet for a programming class and I've nearly completed it but I'm stuck at checking for valid data.
    What seems to be happening is that paintComponent() is being called before actionPerformed.
    In actionPerformed (when they click the button), it checks to make sure they entered a valid month (1 to 12). If the didn't it dispalys a message, but if they did it calls repaint().
    But even if repaint() isn't called, Java still seems to call it before actionPerformed and I get exceptions.
    So I tried checking inside of paintComponent() by using a simple if(...) return; but that doesn't seem to do anything... it just keeps going through with the method.
    So -- Once the user presses my button I want to make sure the data is valid before repainting the screen. How can I do this?

    I validate it in actionPerformed which is called by
    the action listener... that is what you meant right?
    The problem is that it seems paintComponent() is being
    called before I can validate the data with
    actionPerformed(). I need to stop paintComponent()
    from always being calledMVC. (Model, View, Controller)
    Initially the internal value of the data (the model) should be valid (or null with a check in the paintComponent method)
    paintComponent (the view part) shows the state of the valid data.
    You press the button.
    actionPerformed is called (the controller).
    It checks the value and, if valid, writes it to the data (model), then updates the view.
    At no point will the view have to render invalid data, because the model is only updated after actionPerformed checks the value.
    The pattern may be applied with different classes performing the three roles, or different methods in the same class (sometimes it's easier that way for simple cases).
    Pete

  • How can I check for directory creation?

    Hi,
    I want to check whether I can create a directory at a particular location.
    Let's say at c:\windows, can create a directory called c:\windows\mydir. But I won't be knowing the parent location (i.e., c:\windows here) at compile time.
    And I would also like to check for creating a directory like c:\windows\mydir1\mydir2 (mydir1 may not even exist).
    What I was doing was, I created the file object for my new directory (i.e., mydir here) and used the canWrite() method on the parent directory. But this method worked only when the parent directory existed. But how can check for a directory path like c:\windows\mydir1\mydir2 where I have to create both mydir1 for mydir2.
    Is there any other methods that I can use to perform this kind of a check.
    Thank you

    I finally figured out a workaround, but i don't know whether this is a good way of checking. :)
    import java.io.File;
    public class TryMKDIRs {
         public static void main(String[] args) {
              File file = new File("c:\\mydir1\\mydir2\\mydir3");
              boolean canICreateDir = false;
              if(false == (canICreateDir = file.canWrite())) {
                   System.out.println(file.getAbsoluteFile() + " cannot be created.");
                   File fileparent = file.getParentFile();
                   while(fileparent != null && (canICreateDir = fileparent.canWrite()) == false) {
                        System.out.println(fileparent.getAbsoluteFile() + " cannot be created.");
                        fileparent = fileparent.getParentFile();
              if(canICreateDir) {
                   file.mkdirs();
                   System.out.println("Directory can be created. . .");
    }

  • How can I check for duplicates in Apple Photos?

    Can't use my existing apps to check for duplicates in Apple Photos as they only work with iPhoto folders. Any ideas how I can get around this gap?
    OS X 10.10.3

    Duplicate Annihilator for Photos:  http://brattoo.com/propaganda/#photos
    PowerPhotos: http://www.fatcatsoftware.com/powerphotos/

  • HT1752 how can I check for SpyBots and other invasion things on my computer

    I am beginning to have odd things happen to my computer.  Someone told me to check for SpyBots, but I don't know how.  I participate on Blog Talk Radio, and was informed they use these spybot things.  How do I find out if there are invasive things like this affecting my computer?
    In the last 2 days I've had two windows pop up saying I needed to restart the computer.  This has never happened before.  Any help anyone?

    Forget about the advise on the spybots. That person doesn't have the foggiest idea what is going on.
    You are having kernel panics. The most likely casue for kernel panics is hardware problems usually RAM that has gone bad.
    Go to http://thexlab.com/faqs/kernelpanics.html for a good procedure on how to find out what is causing the kernel panics.
    Allan

  • How can I check for a Virus?

    Hello, I tried to use my internet banking the other day on my MacBook Pro but for some reason my password wasn't working. I phoned my bank and they informed me that it had been blocked due to a security threat they'd picked up. They suspect there is some sort of Trojan on my computer and someone is trying to gain my details. They said they would unblock my banking access once I had done a virus check on my computer.
    Also- the other day I got an email saying that someone from the Ukraine had tried to access my emails. I'm not sure if this is related or not... but now i'm afraid there could be something on my computer! Is there a scan I can do? And also is there anyway I can check for a keystroke program as well? My bank mentioned this may have been used (although I am the only person with access to my laptop)
    Thanks for your help! PS - My mac is 10.6.8

    It is extremely unlikely that you have any kind of malware on your computer causing this problem. This is probably a canned reply from the bank, and it assumes you're using Windows.
    Most likely, someone had been trying to remotely hack into your bank account. This may have been the result of someone gaining access to your e-mail account, which would provide them with a rich source of information about all your other online accounts, including your bank account. You should immediately change your e-mail password. You should also change the password for any accounts that use the same password as your e-mail account, or any accounts that are associated with the e-mail account. Make sure you're not using the same password for more than one online account... use a password manager like 1Password to keep track of them all if necessary.
    In addition, you will need to closely examine any security questions associated with your various accounts. Your e-mail may provide a lot of information that could allow an attacker to guess the answers to those questions on your other accounts, thus bypassing the password. Change your security questions to nonsensical words or phrases, unrelated to the question, and keep a log of those answers in a secure place, such as in a secure note in your keychain (using the Keychain Access app) or in your password manager.

  • How can I check for spyware on my Intel based mid-2007 iMac running Lion?

    I recently received a message stating that my Intel based iMac desktop may contain spyware plus a friend sent me a copy of an email to my iCloud email address that i did not send to him, i was not even home using my iMac on that date. I do have anti-virus software on my iMac from Integra and I do a scan each day before i shutdown the iMac and have not received any such warnings from that software.
    I do appreciate any and all advise I can receive in this matter. A long time ago I did receive an email a Yahoo based email address and was notified that I could possibly loose my email account due to junk email being sent from my iMac. I did have the support/warranty from Apple at that time and a phone rep did talk me through steps to check for any intrusion to my iMac with negative results, the iMac was clear of any spyware, etc.
    Hoping there is the same for this issue.

    You can't use a specific Mac OS X disc for a Mac with a different computer. First, call Apple and buy Mac OS X Snow Leopard > http://support.apple.com/kb/HE57 Then, make a backup, insert the DVD and upgrade OS X. Finally, open  > Software Update and install the most recent version

  • How can I check for keylogger and other malicious software on a used Mac

    I purchased a used iMAC (Late 2012 21.5") and it has OSX 10.9.4.
    How can I ensure that it is clean and doesn't have any password or key logging or other malicious software installed in it ?
    I basically want to ensure I have a clean iMac at the start and not have to worry about security.
    Thanks

    The first thing to do with a second-hand computer is to erase the internal drive and install a clean copy of OS X. You—not the original owner—must do that. Changes made by Apple over the years have made this seemingly straightforward task very complex.
    How you go about it depends on the model, and on whether you already own another Mac. If you're not sure of the model, enter the serial number on this page. Then find the model on this page to see what OS version was originally installed.
    It's unsafe, and may be unlawful, to use a computer with software installed by a previous owner.
    1. If you don't own another Mac
    a. If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc from the Apple Store or a reputable reseller—not from eBay or anything of the kind. If the machine is very old and has less than 1 GB of memory, you'll need to add more in order to install 10.6. Preferably, install as much memory as it can take, according to the technical specifications.
    b. If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for a MacBook Air. You should have received those media from the original owner, but if you didn't, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To start up from an optical disc or a flash drive, insert it, then restart the computer and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    c. If the machine shipped with OS X 10.7 or later, you don't need media. It should start up in Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    d. Some models shipped with OS X 10.6 and received a firmware update after 10.7 was released, enabling them to use Internet Recovery. If you have one of those models, you may not be able to reinstall 10.6 even from the original discs, and Internet Recovery may not work either without the original owner's Apple ID. In that case, contact Apple Support, or take the machine to an Apple Store or another authorized service provider to have the OS installed.
    2. If you do own another Mac
    If you already own another Mac that was upgraded in the App Store to the version of OS X that you want to install, and if the new Mac is compatible with it, then you can install it. Use Recovery Disk Assistant to prepare a USB device, then start up the new Mac from it by holding down the C key at the startup chime. Alternatively, if you have a Time Machine backup of OS X 10.7.3 or later on an external hard drive (not a Time Capsule or other network device), you can start from that by holding down the option key and selecting it from the row of icons that appears. Note that if your other Mac was never upgraded in the App Store, you can't use this method.
    3. Partition and install OS X
    a. If you see a lock screen when trying to start up from installation media or in Recovery mode, then a firmware password was set by the previous owner, or the machine was remotely locked via iCloud. You'll either have to contact the owner or take the machine to an Apple Store or another service provider to be unlocked. You may be asked for proof of ownership.
    b. Launch Disk Utility and select the icon of the internal drive—not any of the volume icons nested beneath it. In the  Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive.
    c. An unusual problem may arise if all the following conditions apply:
              OS X 10.7 or later was installed by the previous owner
              The startup volume was encrypted with FileVault
              You're booted in Recovery mode (that is, not from a 10.6 installation disc)
    In that case, you won't be able to unlock the volume or partition the drive without the FileVault password. Ask for guidance or see this discussion.
    d. After partitioning, quit Disk Utility and run the OS X Installer. If you're installing a version of OS X acquired from the App Store, you will need the Apple ID and password that you used. When the installation is done, the system will automatically restart into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    e. Run Software Update and install all available system updates from Apple. To upgrade to a major version of OS X newer than 10.6, get it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the original owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed—you have to repurchase them.
    4. Other issues
    a. If the original owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're irrevocably linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Mac App Store Customer Service has sometimes issued redemption codes for these apps to second owners who asked.
    b. If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able to  authorize it immediately under your ID. In that case, you'll either have to wait up to 90 days or contact iTunes Support.
    c. When trying to create a new iCloud account, you might get a failure message: "Account limit reached." Apple imposes a lifetime limit of three iCloud account setups per device. Erasing the device does not reset the limit. You can still use an iCloud account that was created on another device, but you won't be able to create a new one. Contact iCloud Support for more information. The setup limit doesn't apply to Apple ID accounts used for other services, such as the iTunes and Mac App Stores, or iMessage. You can create as many of those accounts as you like.

  • I downloaded what I think is a Trojan to my ipad2 from the ios email client. It was this scam: We attempted to deliver your item. and then you download a link. How can I check for it?

    I got a package delivery notice from my email and stupidly clicked the link. It locked my screen for a minute and all seems to be fine, but I see it's a password trojan. How can I find and get rid of it if its there.

    Due to the same security features that mean there's no malware capable of infecting an iPad that hasn't been jailbroken, there's also no real anti-virus software for the iPad. The security of iOS (specifically, the sandboxing feature) would not allow an anti-virus app to scan your iPad. There are a few anti-virus apps, but they can only scan things external to your iPad, such as your e-mail or Dropbox accounts.
    So, in short, yes, you're just panicking.

  • How can i check for posted but not yet commited changes in a form

    Dears
    I make changes programmatically in a form then i post it using (Post built in).
    If the user exits the form, i make check for any changes in the form to commit it using the system variable :system.form_status
    Unfortunately the value of this system variable is 'Query' not 'Changed' because of using the post built in.
    Is ther another system variable ( or any another way ) that check for posted but not yet commited changes in the form ?
    Thanks a lot
    Mostafa Abolaynain

    I had faced similar situation. Using of package variable which identifies, what is the user's latest action.
    This is just a workaround.
    Capture what the user has performed into a variable say, PKG_VAR.ACTION,
    This will be assigned values like List L, and Create C, Update U and Saved S.
    If commit is executed,assing the status S to the variable.
    So while closing,
    IF :system.form_status = 'CHANGED' or PKG_VAR.ACTION in ('C','U') THEN     
    -- validate the data, n perform commit.
    else
    -- just close the form.
    end if;
    Regards
    Deepz : )

  • Touch Events: How can I check for a button being pressed while another button is being held down?

    Hello,
    I'm trying to check for a button being pressed while another is down through Touch.  In my case, I' m making a game and I need for a button to make the character jump.  However, when I hold down right, I notice that the jump button becomes somewhat unresponsive and I have to press it twice or more to get it to trigger, as opposed to just pressing the jump button by itself with nothing held down which works fine.  I'm testing this on my Motorola Droid 2.
    Here is some of my code that demonstrates text instead of my character moving around:
    package  {
         import flash.events.TouchEvent;
         import flash.ui.Multitouch;
         import flash.ui.MultitouchInputMode;
         public class Document extends MovieClip {
               Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
               private var controls:BottomBar;
               private var debugText:String;
               public function Document() {
                    addIngameGUI();
               private function addIngameGUI(){
                    controls = new BottomBar();
                    controls.y = stage.stageHeight - controls.height;
                    addChild(controls);
                    controls.aBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.bBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.leftArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.rightArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
             private function testBtns(event:TouchEvent){
                   debugText.text = event.target.name;
    What am I doing wrong?  Is there a better approach?
    Thank you in advance.

    Hello,
    I'm trying to check for a button being pressed while another is down through Touch.  In my case, I' m making a game and I need for a button to make the character jump.  However, when I hold down right, I notice that the jump button becomes somewhat unresponsive and I have to press it twice or more to get it to trigger, as opposed to just pressing the jump button by itself with nothing held down which works fine.  I'm testing this on my Motorola Droid 2.
    Here is some of my code that demonstrates text instead of my character moving around:
    package  {
         import flash.events.TouchEvent;
         import flash.ui.Multitouch;
         import flash.ui.MultitouchInputMode;
         public class Document extends MovieClip {
               Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
               private var controls:BottomBar;
               private var debugText:String;
               public function Document() {
                    addIngameGUI();
               private function addIngameGUI(){
                    controls = new BottomBar();
                    controls.y = stage.stageHeight - controls.height;
                    addChild(controls);
                    controls.aBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.bBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.leftArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.rightArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
             private function testBtns(event:TouchEvent){
                   debugText.text = event.target.name;
    What am I doing wrong?  Is there a better approach?
    Thank you in advance.

  • How can I check for references to previous server and remove them?

    I recently migrated several Win7 PC's off an old sbs2003 box to a new 2012 essentials server.
    All client data is stored on the server in a shared folder and that is mapped to the local PC's.
    Everything has been great, except we have noticed a delay of 10-15 seconds the first time on one PC, the user opens up Word or Excel and clicks on File (to check recent documents) - it goes to "not responding" for 10-15 seconds and then is perfectly
    normal.
    Once the program responds again (and the recent documents appear), there is no longer any delay in opening any of the documents at all.
    If the user goes off and browses the internet for a while and comes back, re-opens Word or Excel again, the same thing happens.
    I've checked what I hope is most stuff, and think I've come down to references on the PC to the old server still.
    Is there a list of registry entries/groups that I should be checking, and are there other places aside of the registry that I should be checking also, so I can be sure that only the new server is referenced?
    Appreciate any guidance please.

    Hi,
    Where is these recent office document located? On your Server?
    Generally speaking, application hungs means its process isn't waiting for Windowsing input. Is other application have similar problem?
    To troubleshoot this problem, firstly, I would like to suggest you using Process Explorer to check Word or Excel's stack. Then check what does its thread waiting for.
    Downlaod Process Explorer:
    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
    If no use, you can use Process Monitor to monitor the starting process of Word or Excel, then we should be able to find which resource cause hung.
    Download Process Monitor:
    http://technet.microsoft.com/en-us/sysinternals/bb896645
    Note: When using Process Monitor to caputer app's trace. Firstly, please set its filter Process Name is Word.exe.
    After that, start work to start monitoring.
    If there is any difficute using these tools, please feel free let us know.
    Roger Lu
    TechNet Community Support

Maybe you are looking for

  • How to add a petty cash payment in journal entry

    HI, I was just wondering if anybody could help me with regards to making a petty cash payment, for example if i went to the shop for and spent £15.00 on stationary etc, how would i post this payment in the journal entry screen? many thanks.

  • Album metadata fields – is it possible to manipulate these individually?

    We're currently mirroring content between a series of Wordpress MU blogs and iTunes U. To do this, we're using a Wordpress MU plugin called Podpress. Essentially, we upload the files to Wordpress, push individual file metadata into various tags (<itu

  • Connecting two 2560x1440 Monitors via 2 MiniDP to DP Cables

    Hi, everyone! I have a quick question. I recently bought a Macbook Pro Retina 13", and I'd like to connect it to two Dell 27" monitors that run at 2560x1440. From reading online, the Macbook Pro comes with two thunderbolt slots that are the equivalen

  • SAP WM - Develop Business Blueprint

    Hi All, We're in the process of implementing SAP WM. Can somebody share their experience regarding preparing the implementation roadmap and developing a business blueprint ? Thanks Meghna

  • I need help fixing this... i can't get PDF to open

    [2011-08-07:20:00:49] Launching subprocess with commandline c:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Adobe AIR Updater -installupdatecheck [2011-08-07:20:00:49] Runtime Installer end with exit code 0 [2011-08-07:20:00:49]