ActionScript 3.0 :: Pass Textbox Value As Variable For URL/Filename To NetStream.play(url)

Oct 1, 2009

I would like to pass a value from a text box on stage as the URL or filename to the NetStream.play() argument. example:

var url:String = url_text.text;
var conn:NetConnection = new NetConnection();
conn.connect(null);

[Code].....

The point of the matter is that I'm pulling the values from JavaScript/HTML using the ExternalInterface which changes as the user selects next on a HTML page. The page name (URL) is being parsed and passed back as the video filename. I'm using the text boxes currently just to test/view the values being received and sent to JavaScript. The value send and receive fine, I just can not seem to pass the value into the NetStream.play(JavaScriptValue).

function getTextFromJavaScript(str:String):void {
sending_ti.text = str;
var jsArgument:String = sending_ti.text;

[Code].....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Adding Filename Of A File To A Textbox

Jul 21, 2009

How would I add the name of an item in an array to a text box? I want to add the name of each item in an array to the text box depending which picture is being displayed.

[Code]...

View 2 Replies

ActionScript 1/2 :: Pass Variable Into HTML To Play A Flash File?

Feb 17, 2010

I'm trying to create a simple SWF file that can receive the name of a FLV file in the HTML file and play it since I have many FLV files.  Basically using the technique of FlashVars.  I've set the contentPath/source in the components to be blank, and set my actions in the first frame to be player.source = filename, as was instructed to do so in a Flash book I am reading. I then set the "filename" variable to a file in the same path as the web page in the HTML file, however, all I get is a blank Flash player skin.  The FLV file will not load.  I also tried setting the "filename" variable to load the FLV from a public website in the same domain and on another domain, but it still doesn't work.

View 5 Replies

ActionScript 2.0 :: Saving XML With Variable Filename In Php?

Jan 26, 2006

I'm trying to save an XML file on a remote server via an php file, and so far this works fine by following the tutorial on this site - exept one thing...I would like to define the filename of my XML file to be saved via php in flash dynamically, eg. so I can create several XML's from flash. But how is this possible ?- can an entry in the passed XML file be read in an easy way in PHP4 - or can I send a variable along with the XML object with some wrapping (maybee an advanced object).

View 1 Replies

ActionScript 2.0 :: Making Filename A Variable

Apr 21, 2006

it's possible to have AS take the filename of itself and make it a variable. I need it to be done by AS only. I know it's possible in PHP, but I'm not sure about AS. I'm guessing if it's possible it's one line of code. I'm using Flash 8 but publishing at Flash 6, AS 2.

View 2 Replies

ActionScript 3.0 :: Error: "NetStream.Play.StreamNotFound" While Playing Mp4 File Using NetStream Object?

Jan 7, 2010

I am using NetStream, NetConnection and Video object to play an mp4 file which is hosted over a web server using http.This is an AIR application and the relevant code is pasted below:

var url:String = <some http url>;
connect_nc = new NetConnection();
connect_nc.connect(null);

[code]........

View 0 Replies

Flex - Embed Image With A String Variable Which Contains A Filename?

Jun 26, 2010

I try to embed images in a mx:tree:

<mx:Tree labelField="name" id="tree"
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')">
</mx:Tree>

This works fine, but I will embed the images with a String variable.

[Code]...

View 3 Replies

ActionScript 3.0 :: Select Variable Filename From Local Directory With Fn To Load XML

Aug 23, 2011

I would like to select a specific xml file to load from a local directory. The file name is composed of "Title" + "number sequence". I know the Title (in this case its XLink07), but I need to select the latest number sequence or the latest by date stamp.

For example, the local directory has the following files:
XLink01[36735298100].xml
XLink02[36735298100].xml
XLink02[36735298101].xml
XLink07[36735298100].xml
XLink07[36735298101].xml

In this example I need to select file XLink07[XXXXXXXXXXX].xml where XXXXXXXXXXX is the highest number within the XLink07[XXXXXXXXXXX].xml files. Title is Xlink07 and function should return Number sequence [36735298101]. Files with higher number sequence have later date stamps than files with lower number sequences. I need to select the highest number or the latest date stamp for the file that begins with XLink07.

My action script to load the local .xml file without any function to select the correct file is:
Security.allowDomain("*", "*")
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("XLink07[36735298101].xml"));
xmlLoader.addEventListener(Event.COMPLETE, showXML);
function showXML(e:Event):void {
[Code] .....

View 1 Replies

Media Server :: Stream.play (live_from_FMLE, -1, 4500, True) Got No NetStream.Play.Start?

Nov 5, 2010

I got a bunch of live stream from FMLE, say: "FMLE_channel1", "FMLE_channel2", "FMLE_channel3". And then on the server side, I created several corresponding republished stream called "channel1", "channel2", "channel3".

On periodical basis, we call Stream.get("channel1").play("FMLE_channel1", -1, 10, true) every 10 seconds. Similar things were done on the second channel & third channel.Soon after the above Stream.get("channel1").play() call, I should get the following events in sequence:info :NetStream.Unpublish.Successinfo :NetStream.Publish.Startinfo :NetStream.Play.Resetinfo :NetStream.Play.Start In the above case all are happy. Clients can view channel1, channel2, channel3 well.But then after a while, one of the three channels, in most case it would be channel1, will not be viewable.

With the server trace info, I found that after the Stream.get("channel1").play() call, only the following two events exists:

info :NetStream.Unpublish.Successinfo :NetStream.Publish.Starti.e. I was missing the play.reset and play.start event.I further checked and confirmed that the FMLE was publishing all three channels fine to the server. I was able to view the "FMLE_channel1" from flash clients, but not the republished "channel1". the version is FMS 3.5.0.

View 3 Replies

ActionScript 3.0 :: Pass Netconnection To Netstream?

Apr 30, 2009

I should probably be refrencing a book rather than continueing to ask questions here but there are no books for AS 3.0 and flash media server. So this forum is my book i suppose any way here is what i have...I have 2 .as files one holding code for a netConnection and one for creating the netStream my problem is i need to pass the netConnection refrence from the netConnection.as file to the netstream....here is my failed attempt to do so I also get the following error message..ArgumentError: Error #2126: NetConnection object must be connected.

[Code]...

View 3 Replies

ActionScript 3.0 :: Play An Mp3 File Using NetStream.play?

Mar 23, 2010

I have a "movie player" that plays flv files using the code below (videoToPlay is the name of the file to play and is just a string). I want to use the same setup to play an mp3 file also.I tried using mySound = new Sound(); and then mySound.attachNetStream(ns);, but it gives me this error: 1061: Call to a possibly undefined method attachNetStream through a reference with static type flash.media:Sound.

View 5 Replies

ActionScript 3.0 :: Different Between NetStream.play And VideoPlayer.play?

Nov 4, 2010

1) What is the recommended/best practice method for loading videos (flv, f4v, mp4, etc.) from a play list. Some of the files might be on the local file system, some might be on a streaming server and uses rtmp.
 
2) Does the VideoPlayer.play internally use NetStream/NetConnection objects? I could get the files to play using both these methods - not sure if one is better than the other. I didn't see any references about streaming in the VideoPlayer.play method - but it does work with rtmp URLs!
 
3) For a long running standalone application, how do I make sure the VideoPlayer/NetStream objects are properly released/garbage collected? Right now I am closing the netstream/netconnection after playing every file - mainly because I do not know which server/file system the next video is being loaded from.

View 6 Replies

ActionScript 2.0 :: Pass A Variable As Well And Can't Seem To Escape To Pass It?

Apr 6, 2008

Trying to pass a variable as well and cant seem to escape to pass it. How can I pass using window.open as such: Trying to pass (pid) all i get back is (pid) and not actual pid.How to on a jscommand?

Code:
something.onRelease = function () {
var jscommand:String = "window.open('http://www.someform.php?proj= + (pid)','win','height=200,width=300,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); }

I can do a standard getUrl("http://www.someform.php?proj=" + (pid), "_blank"); works fine but no control over window properties.

View 1 Replies

ActionScript 2.0 :: Exchange A Filename/url (like "XMLtoLoad") By A More General Variable?

Jun 25, 2003

I have the following question: How can i load a dynamic xml, i.e. the .xml file that will be generated automatically and thus gets different names.I want flash to "listen" to a variable "file", that is "file" represents the name of the xml-file to load. Like showXml.swf?file=abcd1234.xml. btw i don't exactly use the xml extension so it becomes showXml.swf?file=abcd1234

I using a general name = "XMLtoLoad" to load my xml.My AS right now is somthing like:

file = XMLtoLoad;
_root.xmlDocument.load("XMLtoLoad");

how can i exchange a filename/url (like "XMLtoLoad") by a more general variable? Or maybe i should ask how can i convert the name after "?file=" to a URL within AS

View 2 Replies

Flash :: Streaming - Generate A "NetStream.Play.StreamNotFound" Error While Play?

Mar 2, 2011

I used NetStream.play("invalid-live-stream-url") to play an invalid live stream. The other arguments are using default, e.g. start = -2, len = -1.

The menu says that when we use the default "start" and "len" to call "NetStream.play", "Plays the live stream until it is no longer available. If a live stream of the specified name is not found, Flash Player plays a recorded stream until it ends."

However, I do not have a recorded stream on the server that has the same name as the live stream, and I did not get the expected "NetStream.Play.StreamNotFound" error.

View 1 Replies

Javascript :: Pass The Variable So That The Resulting Line Of Code Doesn't Have The Quotes Around The Variable Value?

Oct 3, 2011

I'm trying to pass the contents of variable playnoyes to the long line of code below to decide whether or not to autoplay the flash movie, but doing it as I have below, the resultant line of code has the variable in quotes and therefore the code doesn't execute it as expected. My question is, how can I pass the variable so that the resulting line of code doesn't have the quotes around the variable value.

var playnoyes='true';
var testtext = "<script type='text/javascript'>AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.[code]....

View 3 Replies

ActionScript 3.0 :: Declare A Variable In PHP And Pass That Variable To My Flash File?

Mar 5, 2010

I am trying to do is declare a variable in PHP and pass that variable to my flash file. Right now i am simply trying to do 1 easy variable, more will happen in the future but i need to figure this out first.I have used other forums and they say try this and that, but nothing i do seems to work. here is my code.

PHP Code:[code].....

View 8 Replies

ActionScript 2.0 :: CS3 - Netstream - FLV Doesn't Load / Play

Aug 24, 2009

The main problem is that the FLV doesn't load/play, which most likely causes the secondary problems, such as the bufferClip always visible and no way to test the video and audio scrubbers.

[Code].....

View 5 Replies

Flash :: Netstream Play In The Middle Of A Video?

Jan 19, 2010

I'm using the netstream and video object to play a video in flash. Specifically a mp4 video.

What I'm trying to do is start playing the file from a specific position (Ex. 20seconds).

However with netstreamObject.seek(20) doesn't work unless the stream has been loaded past 20seconds. Is there a way to specify starting to load at 20s? Or any other way of accomplishing this?

View 5 Replies

ActionScript 3.0 :: NetStream Play Complete Still Not Working?

May 2, 2008

Hoped this would ave been fixed in as3 but this event does not always get triggered. Seems to be related to the encode. Anyways I would like to see others approach to this issue.

Currently I have place a condition in the NetStream.Play.Stop event to check if the ns.time is > the duration-1;

[as]
if (ns.time > duration-1){
playing = "complete";
}
[as]

I have noticed this does even work consistantly unless I change it to ns.time > duration-2.

View 1 Replies

ActionScript 3.0 :: Netstream.play.stream Not Found

Feb 7, 2009

I am trying to upload my demo reel. I compressed it to an FLV file, and used the import video command with the setting' "Load external video with playback component." After selecting my skin and hitting ok, I got a prompt that said "Netstream.play.stream not found." Why isn't this working?

View 2 Replies

Professional :: Netstream FLV Position Store In Variable?

May 16, 2010

I have a AS2 netstream instance, in which I am loading various flv's into. The 'main' video has links to other visble when its playing. I want to be able to store the position of the flv (in seconds) so that when the user comes back to the 'main' video it remembers where it was and contiues to play. This is the code I have written so far regarding this (its probably massively wrong).

var remember:Number;
if(ns.play == ("flvs/reel.flv")) {   ns.time = remember;  trace ("stored"); }

[code]....

View 1 Replies

ActionScript 2.0 :: F8 Play / Pause Clip Not Working With NetStream

Feb 6, 2009

I've got a play/pause movie on my timeline to control an FLV via NetStream. The idea is to switch from a play symbol to a pause symbol, but it's not working.[code]Clicking on the clip will start and stop the flv just fine, but the symbol switch doesn't happen. When I take out the ns code, just to check and see if the switch will actually work, there's no problem.What am I doing wrong? How can I get my clip to change from a play to a pause symbol?

View 1 Replies

Media Server :: NetStream.Play.StreamNotFound Not Dispatching?

Nov 3, 2009

I'm recording audio using FMIS, the file is being saved out as a FLV file and I am able to play it back. Eventually that file may be deleted after some time and I would like to notify the user if the file is no longer available. I was expecting to see NetStream.Play.StreamNotFound after deleting the file on the server but I'm not getting that message. Instead I get:
 
-->      NetStream.Play.Reset-->     NetStream.Play.StartAnd nothing plays which is expected since the file is deleted, but I dont get the right message. I'm calling the file like so:ns.play ("flv:file_to_stream");

View 7 Replies

Media Server :: How To Avoid NetStream.Play.Stop

Jun 15, 2010

I'm streaming mp3 on flash media server 3.5 on  linux version, and very often come accross with that problem, when the buffer.length become 0 on client side, the streaming will stop with NetStream.Play.Stop event, and will not be continued. I think this case it should wait always till the data arrives and never should stopping. Some more info : I tested on applications/live folder, and the mp3 files are created dynamically during the playing, and the creation speed is almost the same like the playing speed, so those are not fix files.

View 2 Replies

Media Server :: NetStream.Play.StreamNotFound Not Working?

Aug 3, 2011

I would like to have the possibility to detect when NetStream is not working (i.e. the name used in initialization can't be found on the server side). The StreamNotFound doesn't work at all. I've read that it's the fault of the Flash Media Server, which automaticaly creates new stream, if it cannot be found (of course it's an empty stream - what is wrong from my point of view). Is it true? If yes, can I disable it on the server side, so I could easily detect if the stream name is correct?

View 8 Replies

Media Server :: Netstream Play And Publish Simultaneoulsy?

Nov 15, 2011

i've created a sub-folder called dvr under fms 4.0 applications. i made a test of playing a video named sample.flv then at the same time i publish it to the same fms 4.0 server with a different video name: "mergedVideo".the asc at the fms server as following:

application.onAppStart = function()
{
trace("app start : " + application.name);

[code]...

View 1 Replies

ActionScript 3.0 :: NetStream.Play.Stop Firing Early In Chrome?

Feb 4, 2011

Is anyone having trouble with Chrome getting NetStream.Play.Stop early in Chrome? Seems to fire around the time the buffer has filled. Same code is and has been working fine in all other browsers for some time.

View 2 Replies

Media Server :: Got NetStream.play.stop Before It Reaches End Of Playback

May 23, 2011

i have application that streams videos from fms .i try to play video of 240 seconds, but when playback reaches 180 seconds i got NetStream. play. stop . it happens regularly at the same time.why does it happen? is it encoding of the video??

View 4 Replies

Actionscript 3.0 :: NetStream.Play.Start Fires Multiple Times

Jul 28, 2009

I'm working on a project using a MVC design pattern where flvs are played form a xml playlist. I noticed something strange in the Output window. For the first flv the NetStatusEvent NetStream.Play.Start fires once, the second one fires twice, the third one three times....

Here is the part of the code where I load the video :

Code: Select allpublic function loadVideo(url:String):void
{
_nextBtn.mouseEnabled = true;
_playHead.x = 0;

[Code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved