Problems Overriding setInterval with Button onRelease

Hi.
I'm successfully jumping between playing Frame 1 and Frame 2
using the functions below and setIntervals ...
( The following code is in Frame 1 main timeline ... )
stop();
/ / this advances to the next frame
var myInterval:Number;
function proceed() {
nextFrame();
clearInterval(myInterval);
myInterval = setInterval(proceed,15000);
// The code below is in Frame 2 of the main timeline
stop();
// the following function goes back a frame
var myInterval:Number;
function receed() {
clearInterval(myInterval);
prevFrame();
myInterval = setInterval(receed,9000);
Everything gets all jacked up when I try and add a button to
escape the flipping between Frame 1 and 2 and jump to Frame 5. My
button is in frame 1. The following script is on Frame 1 of main
Timeline and instead of going to Frame 5 when the button is pressed
it just goes to the Next Frame (not overriding setInterval??)
//FLASH GLOSSY BUTTON
//designed and developed by [email protected]
import mx.transitions.Tween;
import mx.transitions.easing.*;
//functions used for the event handlers
function over(){
var myTween:Tween = new
Tween(this.btn_mask,"_alpha",Strong.easeOut,this.btn_mask._alpha,50,2,true);
function out(){
var myTween:Tween = new
Tween(this.btn_mask,"_alpha",Strong.easeOut,this.btn_mask._alpha,0,2,true);
function press(){
this._y +=3;
this._x +=3;
// Want to go to Frame 5 on release of button ...
function release(){
this._y -=3;
this._x -=3;
clearInterval(myInterval);
gotoAndPlay("5");
function releaseoutside(){
var myTween:Tween = new
Tween(this.btn_mask,"_alpha",Strong.easeOut,this.btn_mask._alpha,0,2,true);
this._y -=3;
this._x -=3;
//button1 events
btn1.onRollOver = over;
btn1.onRollOut = out;
btn1.onPress = press;
btn1.onRelease = release;
btn1.onReleaseOutside = releaseoutside;
Any suggestions?
Sincerely,
Paul Cross

unless your frame is labeled with the string 5, you should
use:
gotoAndStop(5).
and if it is labeled with the string 5 you should change it.
it's problematic to use flash names that start with a
number.

Similar Messages

  • Interactive Reports - Problem (possible bug) with button template?

    Hey all,
    I possibly noticed a problem with the use of the button template of the search bar in an interactive report.
    When I for example choose 'Button Alternative 1' as Button template and then save my report then it looks perfect.
    When I now Export/import my application, I loose the button template of my interactive report, if I open the report attributes it isn't selected anymore.
    Does anyone else have this problem?
    Apex version: 3.1.2.00.02
    Kind regards,
    Oli

    Oli,
    Thanks for bringing this up. One of my beta testers just called to say that two of our IRs weren't showing the Cancel or Apply buttons at all. But the third IR worked fine. In my Alpha version, all three had Buttons as the selected style, so I'm a bit confused what went wrong.
    But now I'm thinking if the fact that I had multiple themes defined in the application might have caused the confusion. I didn't deploy the themes from Alpha to Beta because they were all based on Theme 13, and I thought my extensions were included in the application export (which I didn't realize until recently). I'm guessing that if I drop the extraneous themes on Alpha and re-select the button theme, I should be okay when I deploy again?
    I just dropped the extra themes in my Beta and the IRs button theme was undefined again, so I'm thinking they were pointing to the wrong "button" style. Hopefully cleaning up in alpha and changing these buttons will resolve this and I won't have deployment problems!
    Wish me luck!
    Stew

  • I have created a site with iWeb. I have replaced the iWeb Nav bar with a vertical one I made myself. Problem is, my top button disables itself if it overlaps into the "hidden" nav bar area. I can cmd click and drag it into this area, but then all the rest

    I have created a site with iWeb. I have replaced the iWeb Nav bar with a vertical one I made myself. Problem is, my top button disables itself (and the animation doesn't work) if it overlaps into the "hidden" nav bar area (indicated by a blue rectangle). I can cmd click and drag it into this area, but then all the rest of my site is pushed down the page. Don't know what to do about this. I don't know how to bring the rest of the page up without dragging it also into the designated nav bar area. Also, by doing this, is it affecting my site in ant way? see my site here at www.steveburrowsimages.com
    The home page is with it all draged into the nav bar area and the about page is with is outside the nav bar area (notice that the top button does not animate or work as a button.
    Getting confused here. Anyone got any ideas?

    Well, you made a good start with SEO by getting rid of the iWeb default navigation since it doesn't help the spiders and, out there in the real world, there are more people than you would think with javascript turned off in their browsers.
    One of the downsides of iWeb is that it doesn't allow for the alt attribute in the img tag. Its well worth adding these to give you extra keywords even if you have captioned all your images. Use iWeb SEO Tool for this...
    http://www.iwebformusicians.com/Search-Engine-Optimization/Tags.html
    iWeb, just like most drag and drop software, creates a huge amount of code which causes the pages to load slowly in the browser. Running you files through an optimizer will help to reduce this problem and further reduce the size of image files even beyond the initial optimization you do before loading them into iWeb...
    http://www.iwebformusicians.com/Search-Engine-Optimization/Optimize.html

  • Draging a box with button attached on stage excuting button problem

    Hi,
    I have a box on the stage, which is a movie clip. I opened
    this movie clip and placed a button on it. I want to be able to
    drag the box on the stage and the button to move with it. Also I
    want to be able to press the button , which take me to frame 2. I
    have done all of this but the button will not activate. The code I
    have written is:
    box_mc.onPress =function(){
    startDrag(this);}
    box_mc.onRelease=function(){
    stopDrag()};
    stop();
    I opened the movie box (where i placed the button) I wrote
    the following code:
    gotoframe2_btn.onRelease=function(){
    gotoAndStop(2)};
    However, I can drag the map (with button attached) but cannot
    press the button, to perform the action, to bring me to Frame 2. I
    have created a 2nd Frame in the Timeline on the main stage and also
    on the Timeline when i open the movie of the box.
    Hope you can help
    Thanks
    Paul

    Oh, sorry about that, I didn't see the code you posted in the
    previous topic I made
    but thanks a lot i got it working!

  • I have problems with buttons and Forms in my trial proof of Indesign CC, how can I fix it?

    I have problems with buttons and Forms in my trial proof of Indesign CC, how can I fix it?

    Moved to InDesign forum.
    You can start by telling us what the problem is.

  • Having trouble with buttons in motion menus

    I'm having some problems with buttons in motion menus:
    - I've created a motion menu where some text (button names) fade in.
    - I set a loop point after the text has faded in completely.
    - I set the end condition to "loop"
    (there is some animation after the text fades in that I would like to loop)
    - I draw out 5 buttons and assign different overlay colors to each of the button states.
    The problem is that each time the motion menu jumps back to its loop point.. the menu seems to stutter - the overlay color on the currently selected button turns off for a second and the button is momentarily disabled (can't be selected). This problem only shows up on the actual dvd build. The buttons work smoothly when tested in the simulator.
    I can avoid this problem by losing the animation and just setting the end condition to "still".. but I was wondering if anyone knows if there is something I might have missed or could try as a workaround.
    17" powerbook g4   Mac OS X (10.4.5)  

    This problem only shows up on the actual dvd build. The buttons work smoothly when tested in the simulator.
    It could be how the DVD is reading the DVD (sort of the nature of DVD, everything is not exactly the same), because buttons will not show until the loop point and there may be a slight pause from end of animation in the menu to the loop point. And the overlay will turn off briefly when it hits the end.
    Visually what you can do is make the animation in a manner so that at the loop point the buttons are part of the background itself and make sure your loop point is at that point (or slightly after) so it looks like the button is there.
    For the most part the setting of still may work okay (really a creative call), sometimes listening to the same music/seeing samee animation may be too much (of course it depends on project) and you can jump to the loop point on the menu on subsequent calls

  • Problem in tilelist with dataprovider.

    I have a problem in tilelist. with the dataprovider a get the
    message error
    ArgumentError: Error #2025: The supplied DisplayObject must
    be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    if i delete the images from the last added to the first one i
    have no prob but if i want to delete from the middle i get the
    message error th sode that i use is
    <mx:TileList id="tileList"
    dataProvider="{imgData}"
    columnCount="4"
    columnWidth="222"
    rowCount="2"
    rowHeight="194"
    themeColor="haloSilver"
    verticalScrollPolicy="on"
    x="0" y="415" width="100%">
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox horizontalAlign="center"
    verticalAlign="middle" width="222" height="194"
    verticalScrollPolicy="off" horizontalScrollPolicy="off" >
    <mx:Image id="img" width="165" height="126"
    maintainAspectRatio="true" source="{data.asset}" />
    <mx:Label id="txt" text="{data.title}"/>
    <mx:Button id="del" label="Delete"
    click="outerDocument.deleteSnapShot(event)"/>
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    the function to add the image is :
    public function addImgToTile(bm:Bitmap):void{
    var bm1:BitmapData = Bitmap(bm1_source.content).bitmapData;
    var bitmap:Bitmap = new Bitmap(bm1);
    var vo:MyVOBm = new
    MyVOBm(bitmap,formatTime(inStream.time));
    imgData.addItem(vo);
    And the function to delete the image is:
    public function deleteSnapShot(ev:Event):void{
    imgData.removeItemAt(tileList.selectedIndex);
    tx for your help

    tx Amy for your help here i give you the code that generate
    the image from streaming video
    <mx:Canvas id="videoHBox" horizontalScrollPolicy="off"
    verticalScrollPolicy="off" backgroundColor="#000000" width="456"
    height="284" y="37">
    </mx:Canvas>
    <mx:Button x="464" y="188" label="In" width="48"
    id="btnIn" click="addStart(inStream.time);" enabled="true"
    visible="true" useHandCursor="true" buttonMode="true" toolTip="Add
    Start Image (shotcut Home)"/>
    <mx:Button id="Btn_add_action" x="464" y="221" label="Add
    Screenshot" click="addImgToTile(bm1)" useHandCursor="true"
    buttonMode="true" toolTip="Add Clip (shotcut insert)"/>
    <mx:TileList id="tileList"
    dataProvider="{imgData}"
    columnCount="4"
    columnWidth="222"
    rowCount="2"
    rowHeight="194"
    themeColor="haloSilver"
    verticalScrollPolicy="on"
    x="0" y="415" width="100%">
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox horizontalAlign="center"
    verticalAlign="middle" width="222" height="194"
    verticalScrollPolicy="off" horizontalScrollPolicy="off" >
    <mx:Image id="img" width="165" height="126"
    maintainAspectRatio="true" source="{data.asset}" />
    <mx:Label id="txt" text="{data.title}"/>
    <mx:Button id="del" label="Delete"
    click="outerDocument.deleteSnapShot(event)"/>
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    variable:
    private var videoHolder:UIComponent = new UIComponent();
    [Bindable] public var imgData:ArrayCollection = new
    ArrayCollection();
    init :
    nc = new NetConnection();
    nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
    nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    netSecurityError);
    nc.connect(Srv_Name);
    videoHolder.setActualSize(Playing_Video_width,
    Playing_Video_height);
    Playing_Video = new Video(Playing_Video_width,
    Playing_Video_height);
    videoHolder.addChild(Playing_Video);
    Playing_Video.x = 0;
    Playing_Video.y = 0;
    videoHBox.width = Playing_Video.width;
    videoHBox.height = Playing_Video.height;
    videoHBox.addChild(videoHolder);
    functions:
    public function addStart(timecode:Number):void{
    var bm:Bitmap = copyBitmap(videoHBox as
    UIComponent,timecode,"start");
    bm1 = bm;
    img_start_time.text = formatTime(timecode);
    start_time = timecode;
    public function addImgToTile(bm:Bitmap):void{
    var bm1:BitmapData = Bitmap(bm1_source.content).bitmapData;
    var bitmap:Bitmap = new Bitmap(bm1);
    var vo:MyVOBm = new
    MyVOBm(bitmap,formatTime(inStream.time));
    imgData.addItem(vo);
    private function
    copyBitmap(source:UIComponent,timecode:Number,origin:String=''):Bitmap
    try{
    var bmd:BitmapData = new BitmapData( source.width,
    source.height );
    bmd.draw(source);
    corectImg = false;
    catch (err:Error){
    this.setFocus();
    inStream.seek(timecode);
    if (origin == "start") setTimeout(addStart,750,timecode);
    return new Bitmap(bmd);
    public function deleteSnapShot(ev:Event):void{
    imgData.list.removeItemAt(tileList.selectedIndex);
    and the MyVOBm class is :
    package components
    import flash.display.Bitmap;
    [Bindable]
    public class MyVOBm
    private var _asset:Bitmap;
    private var _title:String;
    public function MyVOBm(asset:Bitmap, title:String)
    this.title=title;
    this.asset=asset;
    public function set title(title:String):void{
    _title=title;
    public function get title():String{
    return _title;
    public function set asset(asset:Bitmap):void{
    _asset=asset;
    public function get asset():Bitmap{
    return _asset;

  • Help with buttons :S

    hi all,
    i'm new to flash but i have an idea whats going on with webpages. I need some help with buttons! i have a website and its has a stage and 9 different flv's (screens). I've been trying to read online and i can't find out how to navigate to different screens, example below
    home          |            |
    about us     |  stage   |
    contact       |            |
    you click one one button it updates the stage. also i'm using actionscript 2.0.
    thanks for any help ahead of time
    Thank you,

    Is it a wi-fi or cellular connection that isn't working?  If its wi-fi and other people/computers/phones can connect check your settings.  If its cellular, are other people's phones (on the same carrier) working in the same location? If other people can't connect then it is likely a network problem.  If others can you may need to reset/restore you iPhone.

  • Interactive Prototype - How do you simulate light boxes with buttons? (CS4)

    I am in the process of mocking up an interactive prototype of the homepage of a web application.  On this homepage, there are various links(text with slices) and fields that when clicked on will trigger a dialog to appear over the top of the page similar to a "light box" effect seen on many other websites/applications.
    The workflow I am trying to simulate is as follows:
    User clicks the text link (state 1)
    Dialog appears on top of current page (state 2)
    User fills in necessary fields then clicks save button (state 2)
    Dialog disappears and returns user to base state (state 1)
    The base state of the page is in state 1.  I placed the images/content for the light box in state 2 and then added an onclick image swap behavior to have the link in state 1 trigger the light box (also a slice) to appear in state two.  That all worked fine until I added a save button symbol from the common library to the lightbox dialog in state 2.  When I did that, Fireworks automatically brought be back to state 1 and the button appears on both/all states no matter what I try to do.  Also, my attempts to add an onclick behavior to the save button to bring me back to state 1 haven't worked either.
    So my questions are:
    How do I get that button only to appear on state 2?
    The "hotspot" for that button or any slice/hotspot in any state appears active for all states but are only valid for when that certain dialog appears.  Is there a way to manipulate button/slice hotspots across states so they are only active in the correct states?
    How do I get the Save button to bring me back to the base state?
    Mocking up a lightbox type dialog seems like it would be a pretty common thing to do so I am hoping this is just a simple mistake I am making... any help would be greatly appreciated!
    Here are some images to help illustrate what I am trying to do: 
    Desired:
    Here is what Fireworks is doing:
    State 1 w/link behavior
    State 1 with button behavior (this appears on state 1 no matter where I add the button but I want it only to appear in state 2)
    State 2
    And here is the actual fireworks png proof of concept:

    Hi Linda,
    Thanks for the suggestion, however, that doesn't appear to be working.  I've uploaded the file that I am using as my proof of concept.  You can download it via the link below.  I changed the button so it's only a graphic with a slice over it but there are still two issues.  When the save button is clicked the state does not change back to state 1.  The second problem is that even in state 1, the active area for the save button slice in state 2 is still active even though the button is not there. Any thoughts?
    https://docs.google.com/leaf?id=0B0Fc5EuxtTzPMzY0NTA4ZGQtZjc1Yi00Njk3LThlOTUtYmFlZWQyNzQ5N GVj&sort=name&layout=list&num=50
    Thanks,
    Greg

  • Changing box color with buttons

    I'm kind of new to this whole flash thing...but here's what i
    have:
    I have a couple different .fla files that are opened via
    buttons on a main "index" file.
    It's probably easier for me to give an example:
    Let's say I have files: "index" (as the main page), then
    "page 1," "page 2," "page 3," and "page 4." On the "index" page, i
    have buttons that display the other pages; 1,2,3, and 4.
    What i'm trying to do is have three different boxes, say a,
    b, and c on page 2, each one representing a different piece of
    equipment.
    On the additional pages, i'll have three buttons...each one
    changing the color of one of the boxes. For example...button 1 will
    turn "box a" green, button 2 will turn it yellow, etc... Then when
    you go to the next page, button 1 will turn "box b" green, etc...
    I've been doing tutorials, but i just cant figure out how to
    code this. If anybody can help, please email me
    Here
    I also have a sample file i can send.
    Thanks!

    thanks for the reply dzedward....
    So I right clicked on the button I want to use this with and
    pasted this code. I changed the (box.mc) to (box_a)...the name of
    the color box. When i run it, an error comes up "Statement must
    appear within on handler" and the source is
    "btn.onRelease=function(){
    I don't know if i'm supposed to change something else, but i
    tried it with "btn1.onRelease" also (the name of the button)
    All help is appreciated.
    Thanks.

  • Questions about buttons: onRelease and on(release)

    I have been experimenting with buttons lately and am trying to use a function that uses the release mouse event. I was a little confused at first, since I found some tutorials that used onRelease() and some that used on(release) {...can somebody explain the differences to these and how to use either of them?

    if you're using as2, both onRelease and on(release) can be used.  on(release) is attached to the button or movieclip (highly undesirable) and onRelease is attached to a frame using the button/movieclip's instance name:
    // if your objects instance name is your_btn:
    your_btn.onRelease=function(){
    // code here
    if you're using as3, neither will work.

  • Problem in Using webdynpro Button outside Interactive Form

    Hi Experts,
    I am using the WebDynpro SUBMIT button  Outside the interactiveForm
    My question infact was, that I want to use the WebDynpro native button and place it outside the form.
    I have written the code in the onActionSubmit() of this button to bind data to a table by using subforms in interactive forms.
    My problem is the data is not getting displayed at output,but when i print the size of the node the node is getting binded with data i.e the node size is not equal to Zero.what might be the problem.Please help with a reply .
    Any kinds of tips are appreciaed.
    Thanks,
    Madhavi

    hi,
    thanks for your reply,
    The cardinality of the datasource is 1:1 ,and the data is present and binded to the table node,i have traced it using MessageManager.
    I am doing this in NW2004s.
    I have also done it in NW2004,there i could able to display multiple rows,but what is the problem if iam doing in 2004s.
    Will you please help me further regarding this issue.
    Can you also please explain why to debug the application.
    Thanks in advance

  • After several time installed CS6 and a clean Windows 8.1 bridge still pause after selecting a picture or right click with button mouse.

    My bridge pause all the time. I have to wait 30 seconds after selecting a picture or click the right button of the mouse. I have installed a new windows 8.1, and a fresh CD6. But still these problems in Bridge. No problems in Photoshop. What to do

    What is the problem:
    When I choose a picture in Bridge I have to wait 20 till 30 seconds (sometimes more).
    When I choose with right click of the mouse. I have to wait the same time.
    When I choose the menu. Also
    After opening the picture(s) in Camera RAW. There are no problems
    In Photoshop there are also no problems. Everything works all right.
    Only Bridge have these problems. But I can’t work with it.
    My Computer
    HP Z820 with double     CPU Type           Mobile Intel Celeron M, 2000 MHz
    Nvidia Geforce GTX 980 card
    System memory 64 Gb
    Windows 8.1 Home Edition
    All software is up to date, incl BIOS
    DirectX 4.09.00.0904 (DirectX 9.0c)
    Lots of space on my disc drives
    Software: Adobe Master Collection. But only installed Photoshop and Adobe Acrobat
    Installation done with my original DVD of Adobe. All software updated
    But still problems
    Software installed again (including Windows).
    Now installed adobe from a download version from adobe.
    Still the same problems
    I have no illegal software!
    Multimedia      
    Geluidskaart     SB Recon3D PCIe Audio Controller
    Opslag 
    IDE apparaat     Standaard Dual Channel PCI IDE Controller
    SCSI/RAID apparaat       Controlefunctie voor opslagruimten van Microsoft
    SCSI/RAID apparaat       Intel(R) C600 Series Chipset SAS RAID (SATA mode)
    SCSI/RAID apparaat       Intel(R) C600 Series Chipset SATA RAID-controller
    SCSI/RAID apparaat       LSI Adapter, SAS2 2308 Mustang
    Harde schijf       ATA Samsung SSD 850 SCSI Disk Device
    Harde schijf       ATA SAMSUNG SSD 830 SCSI Disk Device
    Harde schijf       SEAGATE ST3450856SS SCSI Disk Device
    Harde schijf       SEAGATE ST3450856SS SCSI Disk Device
    Optische Station             HL-DT-ST BD-RE  BH16NS40
    Optische Station             hp DVD-RAM GHA3N
    SMART Status harde schijf         Onbekend
    Partities             
    C: (NTFS)            243668 MB (150173 MB vrij)
    D: (NTFS)            122101 MB (65332 MB vrij)
    E: (NTFS)            429244 MB (322019 MB vrij)
    F: (NTFS)            429244 MB (243491 MB vrij)
    Geheugencapaciteit       1195.6 GB (762.7 GB vrij)
    Invoerapparaten           
    Toetsenbord     Logitech HID-Compliant Keyboard
    Toetsenbord     Standaard-PS/2-toetsenbord
    Muis     HID-compliant Mouse
    Muis     Microsoft PS/2-muis
    Netwerk            
    Netwerkkaart    Intel(R) 82574L Gigabit-netwerkverbinding  (192.168.178.37)
    Netwerkkaart    Intel(R) 82579LM Gigabit Network Connection
    Peripherieapparaten    
    Printer  Adobe PDF
    Printer  EPSON XP-950 Series
    Printer  HP 4730 PCL 6
    Printer  Microsoft XPS Document Writer
    USB1 apparaat Texas Instruments USB 3.0 eXtensible Host Controller - 0096 (Microsoft)
    USB2 apparaat Intel(R) C600/X79 series chipset USB2 Enhanced Host Controller #1 - 1D26
    USB2 apparaat Intel(R) C600/X79 series chipset USB2 Enhanced Host Controller #2 - 1D2D
    Van: station_two 
    Verzonden: maandag 13 april 2015 21:58
    Aan: johan van der klaauw
    Onderwerp:  After several time installed CS6 and a clean Windows 8.1 bridge still pause after selecting a picture or right click with button mouse.
    After several time installed CS6 and a clean Windows 8.1 bridge still pause after selecting a picture or right click with button mouse.
    created by station_two <https://forums.adobe.com/people/station_two>  in Bridge General Discussion - View the full discussion <https://forums.adobe.com/message/7434796#7434796>

  • Problems to sincronize with iTunes

    Recently i've bought a macbook pro and i'm trying to sincronize (from my iPhone) my contacts and calendar using iTunes.
    My problem is: the "information button" has disappeared. What can i do?
    Thanks and regards

    Hello Alvaroap,
    It sounds like you have the latest version of iTunes on Mavericks and do not have an Info tab in iTunes to sync your calendar and contacts to your device. Mavericks does not use Sync Services so there is no Info tab to click in iTunes. Here is more info from an article explaining why there is no Info tab.
    OS X Mavericks
    OS X Mavericks v10.9 and later do not use SyncServices. Instead, Mavericks supports sharing your information using several network-based and cloud-based solutions. If you want to sync your information across multiple devices and computers, you should use one or more of these methods. These include iCloud, CardDAV servers, CalDAV servers, and servers that utilize the Exchange ActiveSync protocol.
    From: About SyncServices
              http://support.apple.com/kb/HT5847
    You can use iCloud to sync your calendars from your computer to your phone with the added bonus of not needing to connect your phone physically to your computer to update it.
    Set up iCloud on all your devices. The rest is automatic.
    http://www.apple.com/icloud/setup/
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • What does problems were found with the partition map mean

    Why is there a problem when I run my disk utility that says "problems were found with the partition map that which might prevent booting"?  Why is there a problem????????

    You have to repair your partition map. It's the most important part of the hard drive related to software, because if the partition map doesn't work, the whole hard drive is useless.
    As you have OS X Lion, you should be able to repair it while OS X is started. Open Disk Utility (in /Applications/Utilities), choose your hard drive at the top of the sidebar, and press the button to repair the disk. What do you see in the blank box?
    Also, after choosing the hard drive in Disk Utility, tell me the SMART status, at the bottom of the window. You may also want to check the Macintosh HD status

Maybe you are looking for