 |
|
 |
|
05-25-05 10:45 PM
hi.
i'm looking over another programmer's code and am trying to figure out
what this line of code is doing:
__nc.call( "getStreamLength", new Result(), video );
this is nested in this function here:
private function getStreamLength():Void
{
var parent = this;
video = __videoName;
function Result()
{
var parent = parent;
this.onResult = function( res )
{
parent.__playLength = Math.floor( res );
parent.getStream();
}
}
* __nc.call( "getStreamLength", new Result(), video );*
}
now i can trace out the video variable but for some reason, that line of
code in question isn't firing ( i can tell because the response object
isn't getting invoked -- i put a trace statement in there ).
i'm trying to understand what it's trying to do. is it reinvoking the
"getStreamLength" function, or...?? just trying to figure out where i
should begin debugging.
thank you.
matt.
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
Matt,
That line is calling a user written function on the (presumably)
connected flash communication server specified in the net connection
__nc. What I presume the programmer is doing is dealing with one of
those necessary but annoying facts about streamed files which is that
there is no built in function to ask the server how long a file is.
You have to write a server resident function and then call that
function and wait for the response to come back.
Regards
Hank
On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> hi.
>=20
> i'm looking over another programmer's code and am trying to figure out
> what this line of code is doing:
>=20
> __nc.call( "getStreamLength", new Result(), video );
>=20
> this is nested in this function here:
>=20
> private function getStreamLength():Void
> {
> var parent =3D this;
>=20
> video =3D __videoName;
>=20
> function Result()
> {
> var parent =3D parent;
> this.onResult =3D function( res )
> {
> parent.__playLength =3D Math.floor( res );
> parent.getStream();
> }
> }
> * __nc.call( "getStreamLength", new Result(), video );*
> }
>=20
> now i can trace out the video variable but for some reason, that line of
> code in question isn't firing ( i can tell because the response object
> isn't getting invoked -- i put a trace statement in there ).
>=20
> i'm trying to understand what it's trying to do. is it reinvoking the
> "getStreamLength" function, or...?? just trying to figure out where i
> should begin debugging.
>=20
> thank you.
>=20
> matt.
>=20
>=20
> =3D-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D-----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
If nothing is being returned, I would assume that the function
getStreamLength isn't defined on the server. Look at your main.asc on
the server for something like:
Client.prototype.getStreamLength =3D function() {
as;ldkfja;sldfkja;sldfkja;sldkfj }
or in the Application.onConnect() function, something like=20
client.getStreamLength =3D function()......
you get the idea.
If it's not defined, you can define it easily. All it does it take a
param and use Stream.length(streamName) to get a stream length in
seconds.
Client.prototype.getStreamLength =3D function(streamName)
{
=09myStreamLength =3D Stream.length(streamName);
=09this.call("receiveStreamLength",0, myStreamLength);
}
Cheers
On 5/25/05, hank williams <hank777-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Matt,
>=20
> That line is calling a user written function on the (presumably)
> connected flash communication server specified in the net connection
> __nc. What I presume the programmer is doing is dealing with one of
> those necessary but annoying facts about streamed files which is that
> there is no built in function to ask the server how long a file is.
> You have to write a server resident function and then call that
> function and wait for the response to come back.
>=20
> Regards
> Hank
>=20
> On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.or
g> wrote:
f[vbcol=seagreen]
>=20
> -----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> -----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
--=20
Jordan Snyder
Applications Developer
ImageAction, USA
http://www.imageaction.com
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
hi hank.
thanks for your quick response, i understand it now.
so i did get it to return a result but the strange thing is is that
every 3rd time or so i compile it returns a result of 0. and then maybe
it'll return 0 two times in a row.
all other times, it returns the correct length of the file. i'll go and
find that server-side function now to see if the problem is there.
otherwise, is there an explanation for why this might be happening?
thank you for lending a hand.
best,
matt.
hank williams wrote:
>Matt,
>
>That line is calling a user written function on the (presumably)
>connected flash communication server specified in the net connection
>__nc. What I presume the programmer is doing is dealing with one of
>those necessary but annoying facts about streamed files which is that
>there is no built in function to ask the server how long a file is.
>You have to write a server resident function and then call that
>function and wait for the response to come back.
>
>Regards
>Hank
>
>On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> wrote:
>
>
>
>=---------------------------------------------------------
>Supported by Fig Leaf Software - http://www.figleaf.com
>=---------------------------------------------------------
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
is it returning 0 length for the same file or are you using different
files? if different files, they might not be encoded with the correct
metadata. perhaps post the server side and client side code that
handle this interaction.
On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> hi hank.
>=20
> thanks for your quick response, i understand it now.
>=20
> so i did get it to return a result but the strange thing is is that
> every 3rd time or so i compile it returns a result of 0. and then maybe
> it'll return 0 two times in a row.
>=20
> all other times, it returns the correct length of the file. i'll go and
> find that server-side function now to see if the problem is there.
> otherwise, is there an explanation for why this might be happening?
>=20
> thank you for lending a hand.
>=20
> best,
>=20
> matt.
>=20
> hank williams wrote:
>=20
f[vbcol=seagreen]
>=20
>=20
> =3D-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D-----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
--=20
Jordan Snyder
Applications Developer
ImageAction, USA
http://www.imageaction.com
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
hi.
i was just told that our FCS host doesn't allow us to write any
server-side code. but the getStreamLength() function is there so someone
must have written it, right?? -- and i'm testing with the same flv.
here's the output from the IDE when it does work:
getConnection()
net conn has been established
getStreamLength()
RESULT: 94.04 // length of .flv -- other times it returns RESULT: 0
getStream()
streamName: homePage
streamLength: 94
hank and jordan. thanks very much for your help. something must be going
on with our FCS host, i imagine.
Jordan Snyder wrote:
>is it returning 0 length for the same file or are you using different
>files? if different files, they might not be encoded with the correct
>metadata. perhaps post the server side and client side code that
>handle this interaction.
>
>
>
>
>On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> wrote:
>
>
>
>
>
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
Well I would be curious whether you are always accessing the same file
or not. If it is not the same file then I would guess that sometimes
the file you are trying to access isnt there, so it returns a length
of 0.
If it is there, then it suggests something wierd is going on. Perhaps
sometimes it is not able to establish the netconnection, but in that
case the connect call should generate an error. I would also look at
the appInspector on the server side and see what it says is happening.
You should be able to see whether the server is doing the right thing.
You can even put a trace in the getStreamLength function to see if the
function is being called each time that you think it is.
Unfortunately, I dont have a silver bullet, but hope this helps.
Regards
Hank
On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> hi hank.
>=20
> thanks for your quick response, i understand it now.
>=20
> so i did get it to return a result but the strange thing is is that
> every 3rd time or so i compile it returns a result of 0. and then maybe
> it'll return 0 two times in a row.
>=20
> all other times, it returns the correct length of the file. i'll go and
> find that server-side function now to see if the problem is there.
> otherwise, is there an explanation for why this might be happening?
>=20
> thank you for lending a hand.
>=20
> best,
>=20
> matt.
>=20
> hank williams wrote:
>=20
f[vbcol=seagreen]
>=20
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
The call on the server side for getting the file length (I am
forgeting the exact call name) I am fairly sure doesnt use injected
metadata to figure out length so I dont think this would be the
problem.
Regards
Hank
On 5/25/05, Jordan Snyder <jordan.snyder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:[vbc
ol=seagreen]
> is it returning 0 length for the same file or are you using different
> files? if different files, they might not be encoded with the correct
> metadata. perhaps post the server side and client side code that
> handle this interaction.
>=20
>=20
>=20
>=20
> On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.or
g> wrote:
t
of[vbcol=seagreen]
t[vbcol=seagreen]
>=20
>=20
> --
> Jordan Snyder
> Applications Developer
> ImageAction, USA
> http://www.imageaction.com
>=20
> -----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> -----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
Well, there is no getServerLength function built into flashcomm, so
either the programmer wrote it, or your service provider has a package
of routines that they provide for these kinds of things. For many apps
this function is needed, and if there is no way to program it and they
dont provide it, then I cant imagine how the service would be usable.
It sounds like you are using one of those streaming services like
vitalstream, and I think I remember reading somewhere that they do
provide their own library.
Regards
Hank
On 5/25/05, Matthew Ganz <matt.ganz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> hi.
>=20
> i was just told that our FCS host doesn't allow us to write any
> server-side code. but the getStreamLength() function is there so someone
> must have written it, right?? -- and i'm testing with the same flv.
>=20
> here's the output from the IDE when it does work:
>=20
> getConnection()
> net conn has been established
> getStreamLength()
> RESULT: 94.04 // length of .flv -- other times it returns RESULT: 0
> getStream()
> streamName: homePage
> streamLength: 94
>=20
> hank and jordan. thanks very much for your help. something must be going
> on with our FCS host, i imagine.
>=20
>=20
>=20
>=20
> Jordan Snyder wrote:
>=20
t[vbcol=seagreen]
of[vbcol=seagreen]
t[vbcol=seagreen]
>=20
>=20
> =3D-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D-----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
05-25-05 10:45 PM
Hank,
I'd be interested to learn how Stream.length() does get that
information, since FCS doesn't have any special data storage areas of
its own.
Matt,
It sounds like your FCS host might provide that function as a general
utility, since it is so vital to FCS app creation. And if this is the
case, perhaps there is an issue with their code. You might try
getting a look at their code or even seeing if they have any
documentation on it...since they don't let you write your own apps,
surely they've given you at least a basic toolset.
Good luck!
Cheers
On 5/25/05, hank williams <hank777-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> The call on the server side for getting the file length (I am
> forgeting the exact call name) I am fairly sure doesnt use injected
> metadata to figure out length so I dont think this would be the
> problem.
>=20
> Regards
> Hank
>=20
> On 5/25/05, Jordan Snyder <jordan.snyder-Re5JQEeQqe8AvxtiuMwx3w@public.gma
ne.org> wrote:
be[vbcol=seagreen]
nd[vbcol=seagreen]
t[vbcol=seagreen]
out[vbcol=seagreen]
ne of[vbcol=seagreen]
ect[vbcol=seagreen]
he[vbcol=seagreen]
i[vbcol=seagreen]
>=20
> -----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> -----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
--=20
Jordan Snyder
Applications Developer
ImageAction, USA
http://www.imageaction.com
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 06:57 PM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
Medical and Health forum | Computer Games Reviews | Graphics design forum
|
 |
|
 |
|