how to get jQuery to interact with Flash?

how to get jQuery to interact with Flash?

Hello!

I've been trying for some days now to figure this problem out.
I'm very novice in javascripting and jQuery but as I understood it's the thing to work with and you can do amazing things with it so why not learn it!

However my problem is that I cannot get a jQuery code to work with a Flash menu.

What the script does is that it scrolls smoothly to a DIV in the page.

  1. jQuery(document).ready(function(){
    jQuery('#nav a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
    var $target = jQuery(this.hash);
    $target = $target.length && $target
    || $('[name=' + this.hash.slice(1) +']');
    if ($target.length) {
    var targetOffset = $target.offset().top;
    jQuery('html,body')
    .animate({scrollTop: targetOffset}, 1000);
    return false;
    }
    }
    });
    });
















I'm trying to get it to work with a menu made in Flash but I dont know how to get it to interact with the jQuery code.

I thought it would work with simple actionscripting in Flash;

  1. on (release) {
    getURL("#home-page", "_self");
    }


But that didn't work.

Is it possible to rewrite the jQuery script and make functions to call in Flash and still maintain the smooth scrolling effect?

Please help me, this has been bothering me for days! :(
    • Topic Participants

    • alrik