Mootools chain accessible to Flash

  • Zielak69
  • Novice
  • Novice
  • Zielak69
  • Posts: 21
  • Loc: Poland

Post 3+ Months Ago

I've got a problem. I have an animation to change background on a header. It works well when It's attached to some div with 'click' event. Here's the code:
Code: [ Select ]
window.addEvent('domready', function() {
    $('headertool').addEvent('click', function(e) {
        $('header').set('tween', {
            onComplete: function(e) {
                    $(e.id).set('tween', { onComplete: Class.empty });
                    $('header').setStyles({'background-image': 'url(images/kontakt.png)'});
                    $(e.id).tween('opacity', 1);
                }
            });
        $('header').tween('opacity', 0);
        e.stop();
    });
});
  1. window.addEvent('domready', function() {
  2.     $('headertool').addEvent('click', function(e) {
  3.         $('header').set('tween', {
  4.             onComplete: function(e) {
  5.                     $(e.id).set('tween', { onComplete: Class.empty });
  6.                     $('header').setStyles({'background-image': 'url(images/kontakt.png)'});
  7.                     $(e.id).tween('opacity', 1);
  8.                 }
  9.             });
  10.         $('header').tween('opacity', 0);
  11.         e.stop();
  12.     });
  13. });

Is there any way to run this function from flash? I usually use navigateToURL(new URLRequest('javascript:functionHere()'), '_self'); (as3) but, first of all, it's in domready as I guess and secondly it's not a separate function, it's in addEvent so I also need to convert it to separate function...

Can you help me out? ):

[edit] Problem fixed. Here's the code if you were looking for it ;)
Code: [ Select ]
function changeHeader(ss) {
window.addEvent('domready', function() {
    $('header').set('tween', {
             onComplete: function(e){
                    $(e.id).set('tween', {
                        onComplete: Class.empty
                    });
                    $('header').setStyles({
                        'background-image': 'url(images/'+ss+'.png)'
                    });
                    $(e.id).tween('opacity', 1);
             }
         });
         $('header').tween('opacity', 0);
    })
}
  1. function changeHeader(ss) {
  2. window.addEvent('domready', function() {
  3.     $('header').set('tween', {
  4.              onComplete: function(e){
  5.                     $(e.id).set('tween', {
  6.                         onComplete: Class.empty
  7.                     });
  8.                     $('header').setStyles({
  9.                         'background-image': 'url(images/'+ss+'.png)'
  10.                     });
  11.                     $(e.id).tween('opacity', 1);
  12.              }
  13.          });
  14.          $('header').tween('opacity', 0);
  15.     })
  16. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 110 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.