AS3 stops working if text button is modified

I have a perfectly working text based button positioned inside a movie clip and being called from the main time line.
Then I decided to add a color changing effect on the up state of the button. Originally button had a static text for the Up, Dow, Over, Hit frames. As soon as I modified the text into a mc I am getting an error code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at acolyte24A_fla::mainsite_mc_2/frame30()[acolyte24A_fla.mainsite_mc_2::frame30:4]
Here is line 4 from frame 30:
HowTo_maininfo_mc.HowTo_jtv4u_link_btn.addEventListener(MouseEvent.CLICK, onClick_openJTV);
"HowTo_jtv4u_link_btn" is the button in question. It was working right before I modified the Up state into an MC.
What is the proper steps to modify a button in this way?

Thank You.
I obviously had and still have some problems with tutorials from developphp, but 90% of my site is based on his staff. I always attributed the problems to my minimal level of expertise rather than his shortcomings. Would you be able to recommend a better, more reliable source of tutorials I can rely on?
I have added a line of code right before the line as you instructed.
So here is the line of code in question before I add the text line to an image based button:
HowTo_maininfo_mc.HowTo_jtv4u_link_btn.addEventListener(MouseEvent.CLICK, onClick_openJTV);
function onClick_openJTV(event:MouseEvent) :void {
navigateToURL(new URLRequest("http://www.ubloom.com/index.php?option=com_content&task=view&id=718&It emid=152"));
here how it looks when I add trace function:
trace(HowTo_maininfo_mc);
trace(HowTo_maininfo_mc.HowTo_jtv4u_link_btn);
HowTo_maininfo_mc.HowTo_jtv4u_link_btn.addEventListener(MouseEvent.CLICK, onClick_openJTV);
function onClick_openJTV(event:MouseEvent) :void {
navigateToURL(new URLRequest("http://www.ubloom.com/index.php?option=com_content&task=view&id=718&It emid=152"));
This is what I have in the OUTPUT panel:
[object HowTo_mainInfo_221]
[object SimpleButton]
[object HowTo_mainInfo_221]
[object SimpleButton]
The button is working and opens a site as intended.
Now I add a line of text to the button as my design intention is for user to see the link being written out and click on it. ( I do not want to do it as dynamic text because I want it to have Over and Out states where link lights up and in Up state it changes colors on the screen)
So after adding a line of text
[object HowTo_mainInfo_221]
null
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at acolyte24A_fla::mainsite_mc_2/frame30()[acolyte24A_fla.mainsite_mc_2::frame30:6]
I confirm I left the working button intact, all I did is added a text based mc to it.
Here is the line 6 from frame 30:
HowTo_maininfo_mc.HowTo_jtv4u_link_btn.addEventListener(MouseEvent.CLICK, onClick_openJTV);
How can it be a null object reference if it was just working before I added text, I did no even remove the drawing object from the button, just added the text?

Similar Messages

  • My top button stopped working, the physical button is broken.

    My top button stopped working, the physical button is broken. Apple genius' stated they will not fix my phone because there are signs of moisture in my phone. What does that have to do with my broken button, and why can't my phone functioning the way it is supposed to due to an issue that is not my fault?

    wow i dont know who you are getting your phone "fixed" through but its not apple.
    Apple does not charge prices like that.
    If you got it 1 year ago in september, the hardware warranty has expired by now unless you had your device covered by applecare insurance.
    and if it WERE covered by limited hardware warranty, an obvious hardware issue like the power button not working is covered under the warranty UNLESS it was due to accidental damage.
    So if you paid 198 dollars, chances are its because you dropped your phone and thats why the button was not working,.
    ..and even then, the iphone 4 out of warranty/accidental damage replacement fee is 149. not 198.

  • My sounds have stopped working for text, YouTube and music

    My sounds have stopped working for text, YouTube and music since in downloaded new software!

    I'm not sure if this will help, but I went into my sounds setting and made sure that both the "vibrate on ring" and "vibrate on silent" were selected to "on."  Once I did this, I was able to get the vibrating notification for a call received (as this had previously not been the case).  Hope this helps.

  • Space bar stops working while texting

    My ihpone 5 is only a few days old and it's my first iphone.
    Twice today while I was texting, the space suddenly stopped working. The cursor would advance as if I had typed a period, and start a new sentence with a capital letter, but would only back space as far as where the space bar wouldn't work. I could not back up past that point and could only go forward if I started a new sentence. Has this happened to anyone else?

    I agree with others, this doesn't sound like a ML problem.  It is either a H/W problem, or..., it is possible that something got into the keyboard.  For example, if you were eating around it, perhaps some type of crumb got under the key.  That would do it too.
    You can try this: http://www.youtube.com/watch?v=kh88cn_rtLo
    This can be a pain if you haven't done it before.  But worth a try if you'd have to otherwise pay for a new keyboard (and if it is a crumb versus a bad switch/button).

  • Mid 2011 Macbook Air - Yosemite keyboard and trackpad stopped working, the only button that worked was the power button, only one USB port works.

    I have a Mid 2011 Macbook Air.
    Upgraded to Yosemite last week.
    Three days ago I was using my Macbook Air for the first time since upgrading to Yosemite. I had been using my Macbook Air for approximately 30 minutes, I was using safari and the keyboard and trackpad stopped working (would not respond). The only button that worked was the power button.
    I rebooted and they were still not working. I plugged in a USB mouse and external USB keyboard, only one USB port would work (the Left USB port if looking at the screen) so I had to swap between keyboard and mouse.
    After logging in there is a bluetooth icon at the top of the screen with a sawtooth line through it. Bluetooth is unavailable and the bluetooth icon is missing from the system preferences menu.
    If I run a hardware test by holding D (on USB keyboard) at startup it says that no problems are found and at the conclusion of the test the keyboard and trackpad start working again. When I log on the bluetooth is working again.
    I shut down the Macbook Air and when I started it again the keyboard and trackpad and right side USB ports were all not working again. I logged in using the USB keyboard and mouse and the bluetooth not available sawtooth icon had returned.
    I ran the hardware test again and at the conclusion of the test the trackpad and keyboard started working again.
    I have tried deleting com.apple.Bluetooth.plist and com.apple.Bluetooth.plist.lockfile from /Library/Preferences/ and tried resetting SMC and Power Functions but this did not fix the issue. The only thing that seems to work is running a hardware test - obviously I don't want to do this every time I use the computer.
    I do not believe any hardware is faulty/damaged - I think it has something to do with bluetooth/Yosemite.
    I do not have the Macbook with me at the moment, if you have suggestions that I can try or additional checks/info you require please let me know and I can get back to you.
    Thanks,
    John

    Hi!
    I have exactly the same problem, and I can't find any solution.
    I can't even track down the root of the problem: the Bluetooth/Wifi module? The trackpad? The keyboard/top case? The logicboard?
    I've tried all the usual: SMC/PRAM reset, clean install, kext cache clearing.
    Any suggestion is greatly appreciated!

  • Soundboard Help! - Convert AS2 to AS3 - Stop All Sounds On button release

    Im making a soundboard and I chose AS3 by accident.  What I need the code to do is STOP the CURRENT sound from playing
    if another is pressed.
    the code that worked for AS1 and AS2 was
    onMouseDown = function () {
    stopAllSounds();
    I tried messing around with this in AS3:
    import flash.media.SoundMixer;
    "mouseUp" (MouseEvent.MOUSE_UP), "click" (MouseEvent.CLICK)
    SoundMixer.stopAll();
    but It doesnt do anything.
    import flash.media.SoundMixer;
    SoundMixer.StopAll();
    ^^^
    plays the sound once and messes the sound up after playing for only half  a second or not at all
    thanks a lot for help

    this as2 code:
    onMouseDown = function () {
    stopAllSounds();
    // would be the following in as3:
    this.addEventListener(MouseEvent.MOUSE_DOWN,f);
    function f(e:Event):void{
    SoundMixer.stopAll();

  • AS3 Stops Working on Update

    I updated FlashPro from 10.0 to 10.0.2 through the adobe updater.  After the update applied, Flash ignores any code entered on my action layers as if it were not there, even simple stop(); command.  Anyone else had this issue?  suggestions?  Thanks!

    No error messages were displayed.  AS3 commands just would not function. Resolved by uninstalling/reinstalling Flash...???  Gremlins...

  • On my nano 2nd gen, my center/select button just stopped working. all other buttons work.

    on my 2nd gen nano, I added an audiobook yesterday. now the center /select button just quit working. now all i have is just the main menu. everthing downloaded music & audiobook.

    I've been trying to fix a 1st Gen 1GB Nano for the past two days for a coworker and I have to say that with all the digging I have done (around 10 hours at this point) I have yet to find a solution to this matter.
    It's become clear that something is happening with the new updates that seem to be killing off a increasing number of iPod's yet you'll find no fix here.
    You will however hear many, many, many times over to do the 5R's. And you can do that many, many, many times and you will return to the same problem every time.
    It's not just a problem with iTunes/iPod on XP as I can confirm I have had this problem on OS X as well.
    Apple needs to get their act together and start offering some answers to customers questions. I shouldn't have to pay or take a trip to a not so local store just to get product I purchased from the company to work.
    I find myself nervous each and every time my Mac tells me it has updates because I just have to ask myself what this update is going to break.
    Will my iPod play after this update? Will iTunes work after this update. Oh look, my iSight doesn't work anymore after the OS X update (I finally fixed that), and now I see that some Intel iMacs are having wireless issues as well.
    I'm growing more and more frustrated each time I see another person having a problem but only see the same answers (that don't work) offered. If it wasn't for end user support there would be no support at all.

  • Urgent!! Need your Help! iPhone stopped working and Lock Button Not working

    Lock button on phone has not been working for 6 months (me being lazy, never got it sorted). Now today, I took my phone out of my pocket and it had shut down. Black screen. Cant turn it on because button broke. doesnt respond when i plug into my computer or on charge.
    Desperate for help please!!! Need my phone! got very important info on it and alot of baby pictures of my son which arent backed up (again, my fault for being lazy)
    any help appreciated please
    thanks

    There is no magic that will fix broken hardware.
    Make an appointment at the genius bar and see if they can help you.

  • Ipad all buttons stopped working and volume button has gone haywire

    I've had my ipad 4 16g wifi for the last year and a half with no problems whatsoever and then all of a sudden yesterday it's as if it's become possessed! ALL of the buttons have become nonresponsive, so I can't go to the homepage without using my fingers to sweep it, I cannot close my apps because the home button doesn't work, I can't turn the volume up or down using the volume button and I can't even turn off my ipad with the power button. Nothing seems to work and when they do, it works for 10 minutes and goes haywire again.
    THe volume button seems to be the worse for some reason with nothing even being close to it, it goes on and off and on and off sporadically for a span of 10 minutes. The ipad can still function but is considerably slower when the volume is going haywire and I have absolutely no clue why. What I have tried so far is resetting all settings and rebooting the ipad multiple times and this has not solved the issue. I have also updated to the latest software since the problem and it hasn't helped either. Any ideas?!!

    Try this, but you may not be able to  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    Have you tried Restoring?
    Restoring iOS software
    http://support.apple.com/kb/ht1414
    Home button not working or unresponsive, fix
    http://appletoolbox.com/2013/04/home-button-not-working-or-unresponsive-fix/
    Fixing an iPad Home Button
    http://tinyurl.com/om6rd6u
    Not normal. Take it to an Apple Store for evaluation.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
     Cheers, Tom

  • Shortcuts stopped working for text messages after installing iOS 6. How do I fix this?

    Also emoji does not show up either. I have even restarted my phone. Reinstalled the App. Restarted my phone again

    on the pad, in settings, messages, turn it off.  alternately, identify the pad, in that same setting, with a different incoming 'receive at ' address, and delete the one that is already there, (that is most likely the same as what you have set on your phone)  I have a different receive at address on different devices for that same reason.

  • Button stops working when load a mc inside.

    Hi if I load a movieclip within a _mc it stops working as a
    button.
    I use
    mcLoader.loadClip (File, Sprite);
    and then:
    mc.play();
    Anyone can help me?

    I have the same problem on ipad and iphone.  The bug was only introduced in iOS 8 and 8.1.2 hasn't fixed it.
    I play music on shuffle when commuting and when it hits a video I have to try and get the ipad out of my bag or switch to my phone which is a major pain on a crowded train.
    I thought it was bluetooth only but it's the same on 3 different devices.  Apple support suggested resetting all my settings.  Er, no thanks.  Tried forgetting and re-selecting devices but no good.  Apple support reported this to their technical support 5 weeks ago but nothing since then, so completely useless.
    Only way around is to create playlists without videos, or delete all of them.

  • Help! My buttons have stopped working when keyboard locks.

    I have a blackberry curve 8900 and it's always worked fine but today it started giving me trouble. I have it set to always block the keyboard when not in use and today, it won't unlock anymore.
    I tried taking off the battery and SIM card for a few minutes, and then when it turns on it works perfectly fine, but the minute I leave it alone and the screen goes dark, everything just stops working, the trackball, buttons, unlock button, etc. The screen is just plain dark as if it was off ( but it isn't cause I still hear emails and bbm messages)
    I thought it may have something to do with the memory,  and I deleted a bunch of useless stuff but nothing seems to work. Also, it happened out of the blue, no new installs in the past few months. Didn't drop it or got it wet. Any suggestions? Thanks!

    Hello leonomeli,
    Try one of the different methods listed here for reloading your BlackBerry Device Software:
    http://www.blackberry.com/btsc/KB03901
    Cheers,
    -FB
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click "Accept as a Solution" for posts that have solved your issue(s)!

  • I have a fairly new iPod touch and the touch screen has stopes working in certain places like the bottom row of apps and things on keyboard I have updated it and restored it multiple times it makes no difference please help!?

    I have a fairly new iPod touch and the touch screen has suddenly stopped working..... Like the bottom row of apps has stopped working and certain buttons on the keypad are not working at all what so ever I have taken it to the apple store once before they told me to update it I did so and it didn't get better I have also restored it multiple times still nothing I really would like a working I pod please help!!!

    If you restored to factory settings/new iPod and still have the problem that indicates a hardware problem.
    Make an appointment at the Genius Bar of an Apple store..
    Apple Retail Store - Genius Bar

  • Eject stopped working

    one day my eject shortcut (command-E) and dragging to trash can to eject a cd or image stopped working. the eject button on the sidebar stopped working too.
    however, i can eject using the disk utility. it's annoying to have to keep opening that just to eject.
    did i disable something?

    Hi Tom,
    as far as I am aware, there is still an issue with certain Automator actions and FileVault.
    ...it doesn't work.
    To use that action/workflow you will need to turn FileVault off.
    Have as search on here, there are quite a lot of postings about it...
    regards
    Ric

Maybe you are looking for

  • Philips HDMI to DVI connection....is this possible?

    Hi, I just recently got a 32" Philips LCD with VGA and HDMI capabilities. I want to run my 12" G4 PB to it. I have a HDMI to DVI cable that I am connecting via the mini-DVI cable that came with the G4 but I get no signal. I called philips and they ha

  • Unable to Scan to Email

    I have the photosmart 7525 for my mac book pro.  Until recently, I had no problem scanning directly to my email address. I have tried to do troubleshooting based on all the inputs from checking my wireless connectivity to restoring defaults but am un

  • How do I generate a random String

    Hi, there is probably a very simple answer to this question, but nevertheless.... Is there a class I can use which will allow me to generate a random String of any length? Many thanks.

  • Parse XML with SAX

    Hi all, I have the folow xml file: <n> <q> <r></r> <r></r> </q> </n> How can I make, that automaticli show me the elements of a tree? for Example: n includes r,r,q q includes r,r r includes r r includes r That I can show the Elements of all Trees? Th

  • Can't use templates due to some issue with "sites"

    I'm trying to create a website from a template on dreamweaver, but my computer is giving me some grief about "adding a site". I already entered the information for my site in the "configure server" box. I've entered the proper info for ftp host and h