ActionScript 3.0 :: Returning The SWF Url?

May 19, 2010

In 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 Replies


Similar Posts:


Actionscript :: Returning A Value From Php To Swf?

Jul 4, 2011

I 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?

View 2 Replies

ActionScript 3.0 :: Returning More Than One Value?

Jul 14, 2009

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.

View 7 Replies

ActionScript 3.0 :: Returning A Value From A Function

Apr 6, 2010

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 Replies

ActionScript 3.0 :: Mc Not Returning To State?

May 5, 2011

only 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].....

View 4 Replies

Flex :: Returning The Value Of A New CheckBox In Air?

Oct 31, 2009

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".

View 5 Replies

Returning Errors From AMFPHP?

Mar 19, 2010

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]...

View 1 Replies

ActionScript 2.0 :: Ns.onStatus Not Returning A Value?

Jan 22, 2009

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.

View 1 Replies

ActionScript 2.0 :: If Else Always Returning A 'true' Value?

Mar 7, 2010

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]....

View 5 Replies

Actionscript 3.0 :: Getter Not Returning Value

Jan 14, 2009

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 Replies

Actionscript 2.0 :: Ns.onStatus Is Not Returning A Value?

Jan 22, 2009

The following snippit...

ns.onStatus = function(info){
trace("The movie has ended keptain!");
if(info.code == "Netstream.Play.Stop"){

[code].....

View 2 Replies

ActionScript 2.0 :: Returning The INSTANCE Name?

Sep 10, 2004

i 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 Replies

ActionScript 2.0 :: Returning A Value From A Function?

Nov 2, 2005

well I have a function in my index.swf that goes like this

Code:
function getLanguage(language):String {
var sLang:String = language;

[Code].....

View 5 Replies

ActionScript 2.0 :: Returning Value From Function?

Dec 14, 2007

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?

View 2 Replies

ActionScript 2.0 :: Returning A Value From A Class?

Aug 5, 2008

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.

View 1 Replies

ActionScript 3.0 :: Returning A Class Name?

Sep 11, 2009

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 Replies

ActionScript 3.0 :: MovieClip Not Returning From Function

Jun 30, 2009

I 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]...

View 1 Replies

ActionScript 2.0 :: SWF Hangs In I.E. When Returning To Page

Jul 31, 2009

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.

View 1 Replies

ActionScript 3.0 :: Function Returning A Variable?

Aug 9, 2009

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 Replies

ActionScript 3.0 :: Song ID3 Is Returning Null

Nov 30, 2009

PHP 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.

View 2 Replies

ActionScript 2.0 :: Returning The Value Of A MovieClip's Children?

Mar 24, 2010

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]....

View 1 Replies

ActionScript 3.0 :: Number Returning Different Lengths

Feb 27, 2012

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]...

View 3 Replies

ActionScript 1/2 :: Returning The Minimum Value Of An Array?

Jan 16, 2010

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].....

View 2 Replies

Professional :: Color Picker Not Returning The Right Value?

Dec 10, 2010

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].......

View 1 Replies

Actionscript 3 :: Returning Array In A Class?

Nov 5, 2009

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?

View 2 Replies

Flex :: Returning Different Sub-classes From A Function?

Dec 21, 2009

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...

View 4 Replies

Php :: Flex With AMF Returning Results Slowly?

Sep 3, 2010

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]....

View 1 Replies

Flex :: URLLoader Returning No Data?

Sep 4, 2010

in AS3 I'm trying to load a URL (a Yahoo address) into the application so I can process the source code and pull things out of it.However, when I load it, or any other page, I get 0 bytes back.Here's my current code.

private function doSearch():void {
var req:URLRequest = new URLRequest("http://yahoo.com");
var loader:URLLoader = new URLLoader();

[code].....

View 1 Replies

AS3 :: Flash Returning Undefined Variables From PHP

Aug 24, 2011

Im trying to fetch some data from PHP and use it in a link in flash AS3. flash code:

[Code]...

View 3 Replies

Actionscript 3 :: Returning A Property Rather Than The Class Itself?

Feb 15, 2012

I can use toString() to return any string desired when using trace(instance), is it possible to return other types of objects?For example, I may have this class:

public class List
{
private var _content:Array = [];
public function add():void{}
public function remove():void{}
}

I normally need to make a getter that returns the _content, eg:

public function get content():Array{ return _content; }

So that I can do things like:

for each(var i:Object in myList.content)

Can I make myList in the above case actually return the value of content automatically? So that I can do like:

trace(myList); // item, item, item (similar output as tracing an array)
for each(var i:Object in myList)

View 1 Replies







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