Actionscript 2.0 :: Ns.onStatus Is Not Returning A Value?
Jan 22, 2009The following snippit...
ns.onStatus = function(info){
trace("The movie has ended keptain!");
if(info.code == "Netstream.Play.Stop"){
[code].....
The following snippit...
ns.onStatus = function(info){
trace("The movie has ended keptain!");
if(info.code == "Netstream.Play.Stop"){
[code].....
The following snippit:
// FLV Completion
ns.onStatus = function(info){
if(info.code == "Netstream.Play.Stop"){
[code]....
Is not returning anything at the end of my flv. I have also tried: Netstream.Play.Complete to no avail.
I'm just trying to build as simple of a player as possible, and I have it working how I want it to, but I need to figure out how to know when the video ends so I can call any callback functions I might want to be called.I've spent the better part of the last 3 hours trying different examples online, but none do anything. It compiles fine, but just doesn't do anything...
I'm attaching the code I already have, and would appreciate it if anyone could point me in the right direction.
ActionScript Code:
var _path:String = root.loaderInfo.parameters.Path;
var _w:int = root.loaderInfo.parameters.Width;
var _h:int = root.loaderInfo.parameters.Height;
[code]....
I am trying to detect the end of a streaming video using NetStream.onStatus in AS2. It worked like a charm in a Flash app but I started having problems when I decided to put it in a separate AS class. Here's the snippet -->
class MyClass
{
�.
// Properties & variables
[Code]....
The code works fine and fires an event when the stream stops (I get the trace output without a hiccup). Problem is: it doesn't seem to recognize MyMethod function - or any other method of this class for that matter - for some reason! Just ignores it! When I set trace traps inside MyMethod they don't fire.
I'm using the following code to record a stream on the server side,,,,,,the problem is onStatus only reports NetStatus.data.start and no other codes i don't even know what the code it does returns means as it is undocumented .....how can i make onStatus report properly?[code]
View 2 RepliesIn as 2.0 there was a simple code like trace(_root._url) that would return the url of the actual swf file. What is the equivalent in AS3? The samples I found were all realted to window.location and other things, is there no simple code for this like in as 2?
View 3 RepliesI am trying to transfer a movie-clip staged in a swf(on local machine) to a remote server. Below is a part of the action-script code concerned with it;
function createJPG(mc:MovieClip, n:Number, fileName:String) {
trace("sdf:");
var jpgSource:BitmapData = new BitmapData(mc.width,mc.height);
jpgSource.draw(mc);
[Code]....
I want to close the swf when the upload is complete., I would like to know how to return a value(may be a number which I intend to use to indicate completion of file transfer) from the php script to the swf and how to receive that value in the swf?
ActionScript Code:
var temp = 1
function change(out){
out = 2
return "something"
[code]....
(I would do this if I had a function that returned a value already and I needed it to output more information - I'd pass it an output variable which it would fill for me)but in AS3 that doesn't seem to work - it seems changes I make to a function argument apply only within the function.
I have an external function that needs to return a customerID value. However, it seems to be returning the initial value instead of the value that I believe is being set within the function.[code]
View 2 Repliesonly issue i'm having is that if i drop the item in the zone requiring a change, and pick the item back up, it combines the shapes. I'm thinking I need to have the if statement more universal. I've uploaded my fla to rapid,I'll put my coding below as well.
backbutton.addEventListener(MouseEvent.CLICK, backclick);
helpbutton.addEventListener(MouseEvent.CLICK, helpclick);
answerbutton.addEventListener(MouseEvent.CLICK, answerclick);
[code].....
I am trying to save settings to an XML File and setting the relevant data if the check box is checked or not.
private static function createXMLData():void
{
prefsXML = <preferences/>;
prefsXML.application.@windowsstart =
[Code]....
well i assume that is what the error means, it cannot get details of something that is not set yet.. so how would i get it to check and if nothing then it is obviously a "false".
When using flash remoting with amfphp, what can I write in php that will trigger the 'status' method that I set up in my Responder in Flash? Or more generally, how can I determine if the service call has failed? The ideal solution for me would be to throw some exception in php serverside, and catch that exception in flash clientside... How do other people handle server errors with flash remoting?
[Code]...
I am makign something which generates a random number, then proceeds to check it against a range of fields loaded from an XML file. I have checked and the fields are loading the correct numbers in, but the "if" statement is always returning 'true'. The only time I have been able to get it to properly execute is when I use numbers instead of variables. I have tried using Number(variable), but that doesn't seem to fix anything. here is my code.
ActionScript Code:
on (release) {
_root.colnum = Math.round(Math.random()*100);
if ((_root.colnum<=_root.wballmax) && (_root.colnum>=_root.wballmin)) {
[Code]....
I have a setter and getter method , the getter method should return an array collection but it's always returning an empty array collection even when I've run trace to check on it.[code]...
View 1 Repliesi have a MC, that contains a button, and when i press that button i need it to send the instance name of _parent.MC (instance name is "kala") to the variable "_root.eelmine".result must be: _root.eelmine = kala;
View 2 Replieswell I have a function in my index.swf that goes like this
Code:
function getLanguage(language):String {
var sLang:String = language;
[Code].....
I have the following function defined in a class:
Code:
vidNetStream.onMetaData = function(myMeta){
_root.totalDuration = myMeta.duration;
//trace(_root.totalDuration + "!");
}
totalDuration is a private variable defined in my class.... how can I get that function to effectively save totalDuration?
I decided to turn this util into a class because I use it in almost all of my projects. Basically what it is is I import an XML file and it has all these HTML characters like & or and my function basically converts those strings of characters to its regular form ie: ['&' (&] or [' ' ( )]
so calling it in a FLA file would be something like this:
Code:
var entity:DeEntitizeHTML = new DeEntitizeHTML("bob & jim");
and here is my class file:
Code:
class com.dop.DeEntitizeHTML
{
function DeEntitizeHTML(my_str)
[Code]....
how to return that value back to the var entity in my FLA.
Is there any method that returns the Class name of an instance as a String? I would like to then pass that String as the parameter into the getDefinitionByName() method to create a new instance of that Class (whatever it is).basically, whatever I have stored in the variable 'currentPage' (which could be any number of classes I haev written), I want to create a new instance of (therefore re-instantiating it). this will then act as the method for a 'reload' button which is designed to reload whatever the current page/activity is.
View 5 RepliesI am trying to return a movieClip to a project variable, so it can be retrieved outside of a function. However it fails.
I tried to simply set up a variable so when the function returns, it has a storage variable.
Then i tried for a function to retrieve the variable content
However when i call the trace(mc) it fails as undefined [code]...
A SWF (published as AS2 for player version 9) sits on a page called home.aspx with other textual content. The SWF is a wrapper that loads in various other SWFs based on flash cookie data. Here is the problem: In I.E. (and not Firefox), sometimes the wrapper SWF hangs and fails to load the external SWFs.
The only time this happens is when returning back to this home page via another link that ends in a hash mark (home.aspx#) or to (default.aspx) which is supposed to act the same as home.aspx Also, this doesn't happen every time. Only sometimes. Anyone have any clues? I'd love to provide a link but this is on a beta server at the moment and I don't think I'm allowed to.
I have a variable which needs to be updated upon user input. It works inside the function, the trace function returns the correct type, but for a reason it wont pass it on the variable on the main timeline.[code]
View 5 RepliesPHP Code:
var aaa:Sound = new Sound (new URLRequest ("awd awd.mp3"));aaa.play ();trace (aaa.id3.artist);
The song plays but when I try to get the song's artist / album it returns null. I also tried copying the format from live adobe help website but it still returns null.
Also I have 3 songs named 1, 2, and 3 in a folder. I made a playlist type thing and it works fine, the only problem I see is that I would have to rename 30 songs.
Is there a way that I can obtain the name of a clip's children just like I can obtain the name of it's parent by using _parent?
Basically, I have a whole bunch of MovieClips that I have created through a function that parses an XML file. Basically, it's a custom-made Tree.
I have them all set up in their proper horizontal and vertical positions, but the one thing I'm having trouble doing is closing a branch on it. I've tried storing values in arrays to help me sort all the MovieClips on the Stage, but I must confess that I'm not good with arrays at all, so is there some sort of obscure function somewhere that can return the child clips, so I can do something like:
Code:
myMC.onRelease = function():Void {
if (myMC.hasChildMovies() == true)
for (var i:Number = 0; i < myMC.childMoviesArray.length; i++){
[Code]....
I'm trying to track one of my characters as it moves across my stage, however it seems that samuraiChar's (my character) x position has a much higher decimal rounding system in place rounding to maybe 8 decimals where as the over object that I'm trying to track with it has only a 2 d.p rounding system. Can someone explain to me why this is and how I can fix it, also I may be wrong I'm not 100% sure if this is the problem.
[Code]...
how can I output the lower value inside an array of numbers? I have this but it is not doing the work, it is always returning the very first number in the array.
[Code].....
I have a color picker which I set usingMenu.ColorPicker.selectedColor = 0x339900;It displays the correct color when ran. If trytrace(Menu.ColorPicker.selectedColor);it traces 0. Why is this? Even stranger is later I set some xml parameters using
xml.parameter[0] = Menu.ColorPicker.selectedColor; xml.parameter[0].@name = "color1"; xml.parameter[1] = Menu.ColorPicker2.selectedColor;
xml.parameter[1].@name = "color2";
[code].......
I built a class that parses JSON data, stores it in an array, and now I want to return that data so that it can be stores in an array in my root AS file. I'm eventually trying to pass the returned array to another class. My class looks like this:
package com.src
{
import flash.display.Sprite;
import flash.net.URLRequest;
[Code]....
I keep getting the following error however:
1061: Call to a possibly undefined method payload through a reference with static type com.src.DataGrab.
Does anyone have advice on what might be wrong with my class, or a more logical way to write the getResults() function so that I can get retrieve the array being generated by this class?
Say I have four sub-classes of 'Car'. One for each color. I want to have one function that can build and return a 'color-car' sub-class based on the passed value. This is a dumb example, I know, but it is precisely what I am trying to do only on a smaller scale.
public class Car
{
}
public class BlueCar extends Car
[code]....
Ok. You get it. This doesn't work for a reason unknown to me. I get 1118 errors which complain about conversion of BlueCar into Car, etc...
I think this is just a matter of fine tuning some different elements, but I'd like to know your take. I've got a Flex app, using the Flex 4 data services, communicating with Zend AMF services. One of the services returns all the results in a database using SELECT * FROM table there are ~1200 rows (140KB package size).
My problem is the response time, it's rage inducing. Total duration is always between 7-8 seconds. All but about 150ms of that is latency. I broke up the PHP to figure out exactly where the latency was and turns out return $rows is eating up ~6.8sec latency. I can deal with 1-2sec, but when I start waiting around for 8sec I feel kinda dumb. I cross checked the query response speed directly from the database, and just like I was expecting the total query time is 45-60ms.
PHP, this is basically just the generated Flex data service code, although in production it isn't the same:
public function getAllProject_entries() {
$stmt = mysqli_prepare($this->connection, "SELECT u.*
FROM $this->tablename u");
[code]....