Dopo aver visto in un post precedente, http://bestar-space.blogspot.com/2009/04/gestire-con-flash-la-musica-di.html come gestire con flash e ActionScript la musica di sottofondo del nostro sito o blog, qualcuno giustamente mi ha chiesto(dico giustamente perche mancava il pulsante pausa)come si fa a mettere in pausa l'audio, tramite un pulsante gestito con actionscript.
Iniziamo:
Create due pulsanti:
play > con nome istanza > inizio
pausa > con nome istanza > pausa
importa nella libreria il file audio e in Proprietà Concatenamento inserite come Identificatore il nome > audio
nel primo fotogramma inserite il cod AS sotto:
-----------------------------------------

suono=new Sound(this);
suono.attachSound("audio");

pausa.onRelease=function(){
suono.stop();
};
inizio.onRelease=function(){
suono.start(suono.position/1000,999);
};
--------------------------------------------------

Provate il filmato..


Articoli correlati per categorie




 Abbonati gratis a questo blog      

19 commenti

  1. Marie // 12 agosto 2009 alle ore 12:12  

    Hi Sweetie,
    How are you? How was your weekend, mine was very nice, it was really hot here, I loved it !!! =) Did not have the big party but had a few friends over for a little get together, spent some time in the pool, had a few drinks, was very nice =)
    How is your aquarium coming along? Can't wait to see it =)
    Many hugs to you xxxxxxxxxx

  2. Marie // 16 agosto 2009 alle ore 01:29  

    Hi ! How are you ???? I haven't heard from you in a while, is everything alright? It's raining here, but it is a warm gentle rain, the flowers needed a drink =) Nothing much going on here, just trying to deal with summer being almost over, I like autumn when the trees start to change colors,but I don't like when all the leaves start to fall off the trees. Hope you are doing great!!
    Lots of hugs

  3. Marie // 19 agosto 2009 alle ore 11:45  

    Hi My Dolce Bestar,
    I am happy to hear you are doing well, and that you got a chance to get away for a couple of days, if I could go to the sea I would too !!! I love the water and I truly love being on the beach, a lot of excitement during the day and so peaceful and romantic in the evening =) I have not been to the ocean in a few years, I miss it a lot !!!! You will have to take some pictures and then post them on here so I can see =)
    My birthday is on Monday (August 24th) and I am not sure what I am going to do yet, probably have a little party with just close friends and family. Would like to get away for the weekend, but money is kind of tight right now, so will have to wait until I can afford it =)

    Many hugs to you

  4. Marie // 25 agosto 2009 alle ore 03:55  

    My Dearest Bestar,
    You are THE BEST !!!! Thank you sooooo very much, I LOVE my gift. You are incredibly sweet and soooo talented !!!!! I love that you included the Beatles =) You have made my birthday a wonderful one, I am so happy that we are friends! Many many hugs and kisses to you !!!!!!!!!

  5. Marie // 25 agosto 2009 alle ore 04:12  
    Questo commento è stato eliminato dall'autore.
  6. Guest // 29 agosto 2009 alle ore 05:10  

    Hello Dolce Bestar,
    Thank you for leaving the information 8-)
    Heyyyyy you have emoticons now, nice!!!!
    Do you have big plans for the weekend?
    I am going to a carnival where there is a band that are kids that range
    in age from 14 to 17 that have a band called crooked X,
    they play rock and heavy metal songs and they really sound good

    http://www.youtube.com/v/SoIkoi3dl-A&feature
    I will let you know how it goes ;)
    Other than that not much going on. Sending you lots of hugs and :* 's

  7. Marie // 10 settembre 2009 alle ore 04:15  

    Hi Sweetie,
    I am great, thank you. The message with the video was from me, I see it says guest =)
    I had a great birthday, thank you =) And that concert was really great too =) There was a cover band that did music from ac/dc, I was rocking out =)
    How are you doing???? I hope everything is great, the weather here is rainy, rainy, rainy, it is still warm but cooler than it is supposed to be. I am shutting down the pool this weekend, putting the cover on it =( I will miss it until next summer.
    Many hugs and kisses

  8. Marie // 10 settembre 2009 alle ore 04:15  

    Hi Sweetie,
    I am great, thank you. The message with the video was from me, I see it says guest =)
    I had a great birthday, thank you =) And that concert was really great too =) There was a cover band that did music from ac/dc, I was rocking out =)
    How are you doing???? I hope everything is great, the weather here is rainy, rainy, rainy, it is still warm but cooler than it is supposed to be. I am shutting down the pool this weekend, putting the cover on it =( I will miss it until next summer.
    Many hugs and kisses

  9. Marie // 13 settembre 2009 alle ore 02:29  

    Awwwwww, you are so sweet, you don't have to worry, I am always here =)
    It has been a very lazy weekend, not much going on.Next weekend maybe, I am going to the renaissance festival here in Kansas City, KS, it is a lot of fun it is a 16th century village with crafts, shows and food
    here is a website where you can see what it has
    http://www.kcrenfest.com/favs.html
    I hope your weekend is peaceful and relaxing
    Tons of hugs and kisses to you :*

  10. Guest // 16 settembre 2009 alle ore 17:13  

    Ciao Bestar, come stai ?
    Sono rientrata dalle vacanze.

    Quando potrò vedere qualcosina di nuovo sul blog di prova?

    Un abbraccio affettuoso.

  11. Marie // 21 settembre 2009 alle ore 03:51  

    Hi !! How was your weekend? Mine was a lazy, stay at home and do nothing weekend =),a couple friends came by, it was nice. I haven't gotten the chance to go to the festival yet, something always comes up when I try to plan things =) Hope to go next weekend though.
    I hope this week is great for you !!!!
    HUGS, HUGS and more hugs

  12. Guest // 24 settembre 2009 alle ore 18:34  

    ciao carissimo,
    finalmente ho fatto un salto sul tuo blog... ma quanto scrivi! complimenti, ci son molte cose interessanti anche per una "capra" come me (in senso lato eh! beeee scherziamo?!)
    chissà se capisci chi sono... bè mi sa che ci vediamo presto, cmq. io appena rientrata dalle ferie... ti lascio un indizio fotografico.
    spero tutto ok nella tua vita!
    bye bye
    "chinese girl"

  13. bestar // 25 settembre 2009 alle ore 11:49  

    @ <span>"chinese girl"</span>
    Anche se ci siamo salutati di persona, ti do il benvenuto anche sul blog...

  14. Guest // 27 settembre 2009 alle ore 21:19  

    Grazie del benvenuto! Chissà che non riesca ad imparare qualcosa frequentando questo luogo...
    Ciao Bestar, ti auguro una bella e luminosa giornata!!
    "chinese girl"

  15. bestar // 29 settembre 2009 alle ore 19:33  

    Ciao <span>"chinese girl"</span>
    A disposizione....
    NB: Spero tu abbia fatto delle foto a Londra...
    Buona Serata...

  16. Guest // 29 settembre 2009 alle ore 22:05  

    effettivamente... qualcuna... per la precisione 1.200!!! :)  la mia prima reflex l'ho battezzata bene!
    la foto che ti avevo allegato è il "London Eye" tra le nuvole.
    ciao have a good day!

  17. bestar // 30 settembre 2009 alle ore 10:32  

    wowwwwwwwwwwwwwww........
    qualcunaaaaa... 8-) = 1200???????????????
    1200/30
    very cool.............
    have a nice day too

  18. luis-brianza // 28 ottobre 2009 alle ore 22:14  

    sera bestar volevo metere musica di sottofondo nel blog ed ecco subito un problema apro flash clicco file vado su import - library si apre la cartella di importazione musica e cosa trovo tutte cartelle nominate GBM nessuna traccia di wav o mp3 come mai grazie luis.

  19. luis-brianza // 28 ottobre 2009 alle ore 22:18  

    dimenticavo sto usando adobe flash cs4 professional di nuovo ciao

Posta un commento