1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    35
    Vote Rating
    0
    I3D is on a distinguished road

      0  

    Default Actions and Auto Actions!

    Actions and Auto Actions!


    Hi Guys

    I'm building a piano in Sencha Animator, so far so good, i was able to load the sounds, do the keys and all. However, on the first scene I want the piano to auto play a fey keys, after 2 seconds of the scene loads. I have been trying to understand how to tie those events but with no luck, can someone please explain how can this be done, if possible at all?

    Thanks.

    Iyad

  2. #2
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    lyad,

    You can delay an animation by moving the keyframes further to the right and/or adding a new scene before? Perhaps I can help you more if you can explain it in greater detail what you're trying to accomplish.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    35
    Vote Rating
    0
    I3D is on a distinguished road

      0  

    Default


    Thanks for the reply

    The site I am doing is Piano built with CSS inside Sencha Animator. The piano keys "buttons" have an active and hoover state driven by CSS, along with Audio files tied to each key when pressed to play a note, driven by JavaScript.

    What i want is to have the Piano automatically play a Tune the first time the site loads, then the user needs to replicate that tune. For that to happen, i can't just use the timeline, since i can't simulate a button being pressed through the timeline, thus can't play a note on each stroke. So I thought to do that in code, have the first scene execute a script to automatically press a few keys in order.

    My first attempt I gave each key a CSS ID, assigned that to a variable with document.geyElementById. problem is the script inside the scene isn't recognising that variable and always hitting a "NULL" error.

    So the question is, how can I go about doing that? Is this even possible? having the scene to auto press a sequence of buttons!

    thanks for the help

  4. #4
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    Thanks for clarifying. It sounds like an interesting project!

    Just to do a brief example. I created square on the stage and gave it a cssid of "somename".

    Then I added the following to the start action on the scene

    Code:
    var element = document.getElementById('somename');
    
    //do someting on this element in 1 second
    setTimeout(function(){
        element.style.backgroundColor = 'red';
    }, 1000);
    
    
    //do someting on this element in 2 seconds
    setTimeout(function(){
        element.style.backgroundColor = 'green';
    }, 2000);
    This changes the background color of the square to red and then green.

    Is this helpful?

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    35
    Vote Rating
    0
    I3D is on a distinguished road

      0  

    Default


    Hi Arne

    Thanks for the help on this, however what i want is to start a click event. and so far if i try to write something like


    element.click();
    I immediately get an error of undefined! how can i access click events?

    thanks

  6. #6
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    I don't think click event from js is supported well in browsers. You'll probably have to structure your code differently or look into how the events are handled in the exported code and call the click action code directly.

  7. #7
    Sencha User
    Join Date
    Oct 2011
    Posts
    35
    Vote Rating
    0
    I3D is on a distinguished road

      0  

    Default


    I have no idea how to do what you've just said!! might be the extra hours of work is getting into me. Alright i'll look into that, thanks Arne

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi