Hmmm,
I try to get a "player ready" callback from longtailvideo's flash
player.
I use very basic code just like reddrumhead:
var swf = new Swiff(content, {
id: 'player_1',
width: 320,
height: 120,
container: $('player_wrapper'),
callBacks: {
playerReadyCallback: function()
{
alert
('player_ready');
}
}
});
The callback is sent by the player:
ExternalInterface.call("playerReadyCallback");
I can get the callback outside the domready.
How can I get it from inside swiff?
Is it possible?
Thanks for your help!
On Jan 27, 1:39 am, gabriel munteanu <[email protected]> wrote:
> not from within theswiffobject but from the actionscript, from
> within flash object itself.
> more precisely from this actionscript statement:
> ExternalInterface.call("onLoad");
>
>
>
>
>
> On Tue, Jan 26, 2010 at 11:27 PM, reddrumhead <[email protected]> wrote:
> > Hmmm, okay.
>
> > So if I declare the onLoad function like so:
>
> > var onLoad = function(){}
>
> > And then call it within theSwiffobject, you're saying that it should
> > work. I don't see how it will...
>
> > On Jan 23, 2:12 am, gabriel munteanu <[email protected]> wrote:
> >> ok, i think i know the reson why it doesn't work for you.
> >> onLoad must be in the global space.
> >> flashLoadedHandler function is in my global space.
> >> flash looks for onLoad method in the global space, you have it hidden
> >> in theSwiffclass.
> >> 1. note:
> >> i tried to set up a mooshell example, but it doesn't work. can we
> >> upload swf files there? i guess it was because i tried to load a swf
> >> file from my domain, instead of mooshell.net domain.
>
> >> On Fri, Jan 22, 2010 at 11:53 PM, reddrumhead <[email protected]>
> >> wrote:
> >> > Thanks for the reply gabriel!
>
> >> > I did have the "" (quotes) around onLoad at one point and it didn't
> >> > work then either.
>
> >> > This is the last three lines of my flash file:
>
> >> > if(ExternalInterface.available){
> >> > ExternalInterface.call("onLoad");
> >> > }
>
> >> > and my Javascript code:
>
> >> > var swf = newSwiff(content, {
> >> > id: 'webcam',
> >> > width: 720,
> >> > height: 370,
> >> > container: $('swf-content'),
> >> > callBacks: {
> >> > onLoad: function(){
> >> > alert('flash loaded!');
> >> > }
> >> > }
> >> > });
>
> >> > I must be completely confused with this, because I've tried everything
> >> > and can't get it working...
>
> >> > On Jan 21, 1:17 pm, gabriel munteanu <[email protected]> wrote:
> >> >> Hi, i made it work it my jsblaster game project.
> >> >> here is 1 source file
> >> >> :http://code.google.com/p/js-blaster/source/browse/trunk/js-blaster/sr...
> >> >> my similar line is the 28th: but my js function is called
> >> >> flashLoadedHandler.
> >> >> you should make this line as the last line executed in flash, in order
> >> >> to have all other flash resources loaded if possible.
>
> >> >> 1120: Access of undefined property onLoad. is because onLoad is not
> >> >> surrounded by "".
> >> >> the idea behind all this is that flash has no onLoad event, it is
> >> >> "faked" by placing this ExternalInterface.call("JSFUNCTIONNAME");
> >> >> method as last executed line of code in flash.
>
> >> >> On Thu, Jan 21, 2010 at 8:57 PM, reddrumhead <[email protected]>
> >> >> wrote:
> >> >> > My messages keep getting cut off...
>
> >> >> > What I am trying to do is fade in the 'swf-content' div once the swf
> >> >> > has loaded. Unfortunately it's impossible to do without a working
> >> >> > onLoad: event.
>
> >> >> > Anyone have any thoughts?
>
> >> >> > On Jan 21, 12:56 pm, reddrumhead <[email protected]> wrote:
> >> >> >> Not sure why it cut off the rest of my message... here's the rest:
>
> >> >> >> Warning: 3553: Function value used where type Object was expected.
> >> >> >> Possibly the parentheses () are missing after this function
> >> >> >> reference.
>
> >> >> --
> >> >> jgabioshttp://bash.editia.info
>
> >> --
> >> jgabioshttp://bash.editia.info
>
> --
> jgabioshttp://bash.editia.info