JQuery (this) and ExternalInterface

Hey guys, I have an ExternalInterface to call a javascript function. But how can I now use jQuery to target the .swf that called the function?

For example, I call the changeObject function using ExternalInterface. How can I get jQuery to change the same object tag of flash files? This is what I have and it does not work:

function changeObject()
{
    jQuery(this).css('height','500px');
};

jQuery (this) returns as undefined. I do not know the identifier of the element of the object. This is a dynamic identifier. There will also be several .swf on the page.

Thank!

+2
source share
3 answers

So, I installed the new Flashvar, which was a unique identifier for the player. Like this:

var flashvars = {};
flashvars.src = '<?= $this->get('link') ?>';
flashvars.playerID = '<?= "flash-".uniqid(); ?>';
var params = {};
params.allowscriptaccess = 'always';
var attributes = {};
attributes.id = '<?= $this->get('attributeId') ?>';
swfobject.embedSWF('<?= $this->get('pluginUrl') ?>/flash/wiredrivePlayer.swf', 'no-flash-content', '100%', '100%', '10.0.0', 'expressInstall.swf', flashvars, params,attributes);

Flashvar actionscript ( Model.as):

// Add into the "Declare private vars" section
private var _playerID:String;

// Add into the private function init(flashvars:Object) section
_playerID = flashvars.playerID;

//Add into the public functions section
public function get playerID():String {
    return _playerID;
}

//Add into the public function endOfItem() section
// inform JavaScript that the FLV has stopped playing
ExternalInterface.call("stoppedPlaying", _playerID);    

Javascript , :

function stoppedPlaying(playerID)
    {
        // do something when the FLV starts playing
        var playerID = '#' + playerID
        jQuery(playerID).css('background','red');

    }

arg playerID (this) jQuery. !

+1

, - - , changeObject swf Flash.

0

, , , ( - , ).

, swf , ( swf).

0

All Articles