Button need to change appearance when pushed

I just got some great help in here, to get a button to switch inbetween 2 videos. I just need to have the button when not pressed say "video1" and when pressed say"video2" and when pressed again say "video1" etc... just don't know how to go about it since my as3 skills is not the greatest.
I have the following code in my keyframe where the button (videobtn) is:
import VideoBg;
var videos:Array=new Array('videos/bird_short.f4v','videos/kanin.f4v');
var num:uint=1;
var vid:VideoBg=new VideoBg(videos[index]);
var index:int = videos[Math.floor(Math.random()*videos.length)];
//var vid:VideoBg=new VideoBg(videos[Math.floor(Math.random()*videos.length)]);
addChild(vid);
setChildIndex(vid,0);
videobtn.addEventListener(MouseEvent.CLICK,toggleVideoF);
function toggleVideoF(e:MouseEvent):void{
index=(index+1)%videos.length;
vid.playF=videos[index];

What you should probably do if you can't work out the code is to use buttons inside the movieclip to manage the rollover and rollout animations--one button in each frame.  That way you will only have to have two frames inside that movieclip that you need to worry about coding for.  Then your code that you showed earlier (that has the index I was talking about) for the CLICK event would just have to switch between the two frames...
videobtn.addEventListener(MouseEvent.CLICK,toggleVideoF);
function toggleVideoF(e:MouseEvent):void{
   index=(index+1)%videos.length;
   vid.playF=videos[index];
   videobtn.gotoAndStop(index+1);

Similar Messages

  • I cannot add an event on my iPhone or iPad calendars. The "plus" button, or add event button does not even appear when I open the app.

    I cannot add an event on my iPhone or iPad calendars. The "plus" button, or add event button does not even appear when I open the app.

    Thanks for the suggestion. Sadly, that did not fix it. I changed the sync setting as you described, but I still don't get my older events. I have turned my IOS devices off and on again too. One more piece of information, the only events I see for October are recurring events. Either one day events like birthdays set to repeat every year, or events within the month that spanned more than one day. No one time events or appointments are showing.

  • I have a site published that i need to change, but when i publish the new pages it dosen't change the site that's already published. How do i remove the old site?

    I have a site published that i need to change, but when i publish the new pages it dosen't change the old site.

    See if this helps you any further :
    The concept of Sites in iWeb
    Also, clear the browser cache and reload the page(s).

  • My ipod shuffle 4th gen bought today and the voice over works for naming playlist and battery percent but wont name song and artist can anyone help also is the voice over button meant to be soft when pushed ?

    my ipod shuffle 4th gen bought today and the voice over works for naming playlist and battery percent but wont name song and artist can anyone help also is the voice over button meant to be soft when pushed ?
    thanks

    This document explains setting up and using VoiceOver.
    http://support.apple.com/kb/ht4322
    The overall settings for VoiceOver is on the shuffle's Summary screen in iTunes.
    Artist name and song name - Press and release the VoiceOver button. 
    The playlist menu - Press and hold the VoiceOver button.

  • Radio buttons and Checkboxes to change appearance when selected

    Hi guys!
    Help needed.
    I want my check boxes and radio buttons when selected to change color from black to "0,64,128", size from 12 to 14 and to become bold.
    Also the default appearance for checkboxes is cross, but I need it to be a check mark.
    I would be so much thankful if you could give me some advice.
    THANK YOU!
    Maria

    Hi Bibhu,
    Thanks for quick response!
    For check mark -- thanks! How could I not see that option!
    For radio button -- it's not working.
    I found this helpful tips on changing appearance of the radio buttons and check boxes. http://www.assuredynamics.com/wp-content/uploads/2010/11/Assure-Dynamics-Checkboxes-and-Ra dio-Buttons-Rev-1.pdf
    I used the first script, but I got an error message. I can't understand what I am doing wrong. It says: "Syntax error near token "{" on line 2, column 1.
    I am confused.
    Help appreciated.

  • How to disable delete button of UITableView automatically appears when it i

    Hi,
    My app has a UITextField on a UITableViewCell, and having a trouble with editing text in the UITextField.
    When I am going to edit the text, first I tap the UITextField, then a loupe appears, and it should follow the move of my finger.
    But when I move my finger intending to move the loupe, UITableView misunderstands the gesture and show a delete button on the table view. And once the delete button appears, it blocks control to the loupe and the loupe freezes.
    As table row can be deleted just by turning UITabeView's editing YES, there is no need to display delete button in my application when the table view is swiped, and I need to disable this function of UITableView.
    Are there any ways to prevent delete button from appearing?

    Its in my TableViewController which also acts as my delegate method.
    // FavouritesViewController.h
    #import <UIKit/UIKit.h>
    @interface FavouritesViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
    IBOutlet UITableView *favouritesTable;
    @property (nonatomic, retain) UITableView *favouritesTable;
    the "myTable" reference is the reference to my tableview. So with the example above I have the following in my FavouritesViewController.m:
    #pragma mark Table Edit Delegate Methods
    - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated:animated];
    [favouritesTable setEditing:editing animated:YES];
    Hope this helps. Regards, Michael.

  • No changes appear when batch editing Camera Raw Files and saving as jpegs

    When I batch edit my raw files, including saving the file as a jpeg, from bridge or photoshop the resulting file saved never includes any changes I made in the Camera Raw editor. For example if I have lightened the photo by changing the exposure in Camera Raw as a saved jpeg after batching the file is still as dark as when originally shot. Is there some little box I forgot to check or something? Thanks!
    andy

    I've seen something like this, but have not figured out why yet. In my situation I select a group of images in Bridge and go to Tools / Photoshop / Image Processor.
    There I click the "open first image to apply settings" box.
    Save in Same Location
    Save as JPEG, resize to fit (1200 pixels), Convert Profile to sRGB.
    No Action selected
    Include ICC Profile
    Run it and in Camera Raw roll the saturation down to -100 (convert to b&W).
    Click "Open Image"
    The process runs and the first image is converted to b&w, but the others are not.
    John

  • Bookmark ribbon not appearing when pushing bookmark icon

    I'm reading a Project Gutenberg book I downloaded from the iBooks store, and when I press the bookmark icon in the upper right of a page, no ribbon comes down to indicate it's marked. When I go to the list of bookmarks, only sometimes has a bookmark been registered, and when it has, it's for a spot a few pages earlier in the text.
    If I click on the listed bookmark, iBook will take me to the page it claims I've marked, and the red ribbon will be there.
    Is this just an issue with the epub formatting of some books, like this free one?

    OK, I have a theory about how this thing is behaving; bookmarks seem to show up/behave as you would expect (when I tap on the ribbon) provided I have the font size set to something that appears to paginate the book to its original (just a guess on my part) layout. If I increase the font size to make things larger/more easily readable, then things get screwy as described above as the pagination bumps up the # of pages and the page #s where a ribbon gets place doesn't seem to correspond to the exact visible page I wanted it on. Confused? So was I, but the evidence seems to point to this.
    Anyway, try this out and see if it doesn' behave as I described.
    Bottom line - iBooks does not behave in a rational manner and therefore it is buggy in my opinion - i.e. this is not a "feature"...
    I have no experience with other iBooks downloads. Steve Jobs is my first purchase - and this this is my introduction to iPad and iBooks and terribly ironic to discover behavior like this with the ode to Steve book - which, BTW, I am enjoying max.

  • Why aren't changes appearing when I edit photos in Photos?

    When I edit photos in the new Photos program the changes aren't being applied. Is there a setting I'm missing?

    this issue has resolved itself after a shutdown / reboot.

  • My itouch is frozen on the itunes sign with the charger cord going into it. I have tried to restart hold down the two buttons but nothing changes. When I plug it into itunes it doesn't read it and I ran that test and nothing changes...HELP PLEASE!

    Frozen itouch with the itunes sign with the charger going into it.  I have held down both buttons for 10 seconds I have re ran the tests but itunes doesn't read it still

    Put your phone in DFU mode. Connect it to itunes and hold down the power and home buttons at the same time for ten seconds. Then while keeping the home button pressed let go of the power button. Keep holding until a message pops up saying your phone is in recovery mode. Then sync it back up. This will erase everything from ipod and restore it back from itunes.

  • Getting "An error has occurred" on download of Mountain Lion, button has no label and doesn;t do anything when pushed

    The download of Mountain lion failed, when I resumed it, I got "An error as occurred" and the button label went blank.  when pushing the button, nothing happens.  The purchase item when to a new category in the Purchases page in the Mac App Store, it is titled "Other Purchases" and is at the top of the Purchases page, probably due to the fact that this was a redemption from the UpToDate mode for a new MacBook.  The "Other Purchases" category remains on the page when I sign out of the App Store. 

    Launch the App Store.
    From the App Store menu bar (top of your screen) click Check for Unfinished Downloads
    If that doesnt help, try here >   Mac App Store: How to resume interrupted downloads

  • I cannot get my e-mail to automatically enter addresses in the "TO:" box. In the past, I would get a list of e-mail recipients to appear when I typed 1 letter. That function no longer works. Do I need to change a setting or what?

    I cannot get my e-mail to automatically enter addresses in the "TO:" box. In the past, I would get a list of e-mail recipients to appear when I typed 1 letter. That function no longer works. Do I need to change a setting or what?

    Settings > Store > Sign Out.
    Sign in with the correct ID.

  • I upgraded pages.  Now when I begin a new document I automatically have a text box.  How do I get rid of the text box so that it does not automatically appear.  What settings do I need to change?

    I upgraded pages.  Now when I begin a new document I automatically have a text box.  How do I get rid of the text box so that it does not automatically appear.  What settings do I need to change?

    Perhaps you are loading a template that has a text block already on it.
    You might try the blank template option and set that as your go to template in your preferences

  • When using Firefox to access my Lotus Notes webmail account, I cannot attach files. The following error message appears: Domino Web Access Warning. What settings do I need to change or how do I fix this?

    When I try to send an attachment in my Lotus Notes webmail, a Domino Web Access Warning appears. What setting do I need to change or how do I fix this? I just switched from Internet Explorer to Firefox 2 days ago. Thanks
    == This happened ==
    Every time Firefox opened
    == When I switched from Internet Explorer to Firefox

    Idem for me

  • HT5278 i did this update and now the volume on my phone doesn't appear when i push the buttons on the side of the phone. occasionally i see them, but my speakers won't work for playing videos or music either. it does ring when i receive a call though! ne1

    i did the ios5.1.1 update and now the volume on my phone doesn't appear when i push the buttons on the side of the phone. occasionally i see them, but my speakers won't work for playing videos or music either. it does ring when i receive a call though, and for my alarm. ne1 else had these problems?

    I have had this happen to me on 3GS, 4 and 4s.   Usually the solution is one of the following:
    1-  If  your volume indicator says  headphones even though they are not plugged in, then:
    Stick your headphones into the headphone jack and then remove quickly.
    2. If that does not work Power your phone off. Then when restarting Reset the phone by pressing the home button and the power button at the same time until the apple logo appears.
    3. Make sure you have not chosen to send audio to an Airplay device such as Apple Tv.
    Hope one of these works for you

Maybe you are looking for

  • How to use a Iphone 4 in other country?

    Hi, When I live in US, I buy my iphone 4 (without contract) i paid full price in AppleStore in Briarwood ... but never realise that the iphone i lock to the at&t, because i already have sim card from this operator . I understand that, when i moved to

  • Missing Library Albums

    The "Library Albums" component (with star ratings etc.) does not appear on my Library Inspector tab. I downloaded A3 about 3 weeks ago, and it has never appeared. Am I missing something or misreading the documentation?

  • Count of 0TOTALSTCK

    Hi all I'm struggling with a count issue which i hope you can help me with. On IC_C03 i need to count the number of entries where 0TOTALSTCK = 0. As 0TOTALSTCK is non-cumulative i don't know the value of each row until query runtime. As such i can't

  • I am emigrating to canada from the uk and taking my ipad 2,how do i go about charging my ipad?

    i am emigrating to canada from the uk and taking my ipad 2,how do i go about charging my ipad with the lower canaidian voltage?

  • Call layout from function

    Hi , i have a function that call to a layout. my problem is that when i ran the function, the layout not get the parameters that i pass to her. how can i pass a parameters from function? thanks, dana.