ActionScript 2.0 :: Send A String To A Function And Return A Object?

Mar 16, 2010

is it possible to send a string to a function and return a object??? here is the code, but it doesn't work

[Code]....

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Inheritance / Interface - Override A Function That Return An Object Of Class A And Make It Return An Object Of Class B Which Extends A?

Aug 4, 2009

I'm having some troubles with the use of interface and inheritance in AS3. I've done lots of OOP in the past and what I'm trying to do seems obvious to me, but doesn't work in AS3. The question is : Is it possible to override a function that return an Object of class A, and make it return an Object of Class B which extends A ? It seems not to be possible, since I'm getting a signature error in Flash, when compiling. For example, the following set of class do not compile (the code in function definition doesn't matter):

[Code].....

View 3 Replies

ActionScript 3.0 :: Send Search String To Database Query And Return Results To Dynamic Text Fields?

Feb 22, 2011

I have a dropdown box that is used to select a Category. I need the Flash Application to send the value of Category plus the search string in my textbox to my Access query and return results for each product meeting selection criteria. The Flash Application is calling an ASP.NET web service which in turn queries an MS Access database.

To start, how do I define the category ID and search value in my Actionscript 3 code?I've placed a series of 12 or so objects that will be populated with the product description, title and price. How do I setup each field to be dynamic text associated with the title description and price from my query results? If there are more than 12 products returned by the query, how do I add an additional page of objects to house more than 12 query results?

View 2 Replies

Save Image From Flash, Send It To PHP And Return A URL String To Flash?

May 20, 2011

I use this code to convert an image to a BitmapData and store a JPG in a ByteArray.

import com.adobe.images.JPGEncoder;
var jpgSource:BitmapData = new BitmapData (img_mc.width, img_mc.height);
jpgSource.draw(img_mc);

[code]....

Now, I want to do the following:

1. send the ByteArray to PHP;

2. PHP must store a physical image_id.jpg on server;

3. then PHP must return the URL of the image to Flash;

The first lines of PHP could be:

if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];

[code]....

View 1 Replies

ActionScript 3.0 :: Object To String To Send To Php?

Aug 21, 2009

I am supper stuck I have a Object and need to send that to a php script as an associative array. When i send the object itself it.

View 9 Replies

ActionScript 3.0 :: Return An Object With A Function?

Jun 18, 2009

I'm trying to create a function that determines which of 4 similar classes to create, and returns the new object itself.

Basically, I have a base class (Panel) that has 3 additional variations in layout, each of which has a subclass: TextPanel, FeaturePanel, and LinkPanel. The two parameters for my function are the "kind" of window to create and its name ("linkString"), both of which are provided by external XML. I'm wondering if it's even possible to return the new Panel as an object...?

My code will probably explain this better than I can:

Code:
// create the new Panel variable ("addPanel") with a call to newPanel:
var addPanel = newPanel(linkList[i].attribute("kind"), linkString);
Code:
// newPanel function:

[Code].....

within the Panel constructor, the provided string (linkString / 'h') is set as the Panel's .name. I did not copy that function into the subclasses, since they inherit it - unless I'm mistaken.

View 8 Replies

ActionScript 3.0 :: Function Return More Than One Item Or Object?

Aug 16, 2011

I am trying to move text movies and textfields around a stage. This is a learning curve for me. I am confused by an example I have found on the internet.

[Code]...

View 6 Replies

Actionscript 3 :: Return An Object With An Update Data, That Is Pass In To A Public Static Function?

Dec 23, 2011

How can I return an object with an update data, that is pass in to a public static function?

GetDate.dayName(MyDate.setDate(1984,3))
//MyDate with new info (year, month) will be pass into GetDate.dayName
package hwang.time

[code].....

View 3 Replies

ActionScript 3.0 :: Send A Bytearray Object To A Javascript Function?

Aug 11, 2009

I need to be able to send a bytearray object to a javascript function or a java method, but I was wondering if I could do it using XMLHTTPRequest.

import asfiles.encoding.JPEGEncoder;import flash.display.Bitmap;import flash.display.BitmapData;import flash.external.[code]...

So I have a video that plays stream from a webcam,I will click a button and take a picture. I encode that picture using JPEGEncoder then I store it in a ByteArray.How do I send that data over to either a javascript function or a java class?I don't want to use the navigateToURL (URLRequest) method because that will redirect my page.Is there a way to send the data to a function while still staying on the same page?For example, make a asynchronous call to a javascript function or java method?

View 1 Replies

ActionScript 3.0 :: Parent Object Send A Function To All Its Extenders ?

Sep 29, 2011

Say I have an object call "Mother". Inside this Mother object is a function called "Come back all my children" And all my Child Objects extends Mother.

Is there a way one of the Child could call the function "Come back all my children" and this function will be evoked in ALL Child objects ?

I tried creating a "Come back all my children" function as static in the Mother object but I am unable to use the "this" keyword for this.

View 4 Replies

Flex :: Transform A String In Function And Concatenate With An Object?

Mar 2, 2010

I have the following code in actionscript 3:

var async:AsyncToken;
async = bridge.retornamenu();

The bridge is a remote object, instantiated. The retornamenu() is the function that I want the remote object open in amfphp.

However the retornamenu() is a dynamic function, which turns another function, but I can not run it at runtime,

example

var stringfunction:String = "retornamenu()" // this name is dynamic.
var async:AsyncToken;
async = bridge.stringfunction;

But this way does not work, not perform the function retornamenu();

View 1 Replies

Actionscript 3 :: Call Function Or Object Name In String Variable?

Mar 15, 2012

I need to call an object or function name with string variable.[code]it's working but, if I do something like below its not working [code]

View 2 Replies

ActionScript 2.0 :: Have A Function Draw A Box Around An Object By Finding The Objects Instance Name Via A String?

Jun 5, 2006

Is there a way to have a function draw a box around an object by finding the objects instance name via a string?

such as:

Code:
function BoxObject(object) {
//code to draw a box around the object
}

and then juts have an object with an instance name, like "my_mc" and then call the function on a keyframe like:

BoxObject("my_mc");

View 10 Replies

IDE :: LoadVars Send Always Return Undefined?

Apr 19, 2009

Flash file:

Code:
s.onSoundComplete = function(){
loadVars_out.songId = sa[cps].id;
loadVars_out.send("incPlayedNumber.php", "_self", "POST");

[code]....

View 5 Replies

Create And Send A Variable Called 'return'

Aug 21, 2010

create and send a variable called "return." But that conflicts with a word used in actionscript.[code]is there anyway to work around this naming conflict?

View 1 Replies

AS3 :: Flash - Send An Object To A Function Using The "every" Loop?

Aug 24, 2010

how exactly you send an object using the "every" loop in as3?

var myFunction:Function = function(obj:Object):void {
obj.height=400*Math.random();
obj.width=400*Math.random();
}

[code]...

which is in the AS3docs but it doesn't work

View 1 Replies

Php :: AsyncToken Return Basic String?

Dec 16, 2011

I'm trying to develop a Flex Mobile / PHP application, and I'm running into some trouble with the AsyncToken... Does it not just return a basic string?

For example... I'm wanting to just return a simple string result from my request - right now, it's going to return a basic output string from the method that's implemented. The backend part works (PHP), I've done all of that... It's this that's giving me some problems:

import mx.rpc.AsyncResponder;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;

[Code]....

View 1 Replies

ActionScript 3.0 :: Get A String Return By A Class?

Oct 8, 2009

I have a question about return..example:

Code: var date: Date = new Date(); trace (date)//Thu Oct 8 23:05:51 GMT-0300 2009 How i can get a String return by a Class? The default return with a normal Class is ([object Date])... Constructor can`t return values... how i can make that? :p

View 3 Replies

ActionScript 2.0 :: Converting String To Function Call On "unknown" Object?

Jul 20, 2010

I'm working on a function that replaces an existing movie clip with a symbol from the library and then designates an "updater" function for the new instance. I have the first part working as intended, but I'm not sure how to approach creating the "updater" function.I've considered using event listeners, but I'm not sure if that is my best option.The following is a excerpt from my code. This code is on the timeline of a movie clip. The movie clip is on the main timeline with an instance name of slideUpPanel_mc.

ActionScript Code:
var window_mc:MovieClip = window_mc; //window_mc as it exists on the timeline
var windowUpdateFunc:Function; //reference to updater function in window_mc

[code].....

View 1 Replies

ActionScript 3.0 :: Return Result From Function Called By Function?

Aug 4, 2010

I'm using an AMF service that was built by someone else. Basically what happens is that some info is passed to the AMF service and it returns true or false.I want to be able to pass in various info to the a function that calls the AMF service(submitTracking) and then get the true or false value returned in onResultSubmit to be passed back to submitTracking.

var screen:String;
var buttonnumber:String;
function submitTracking(screen:String, buttonnumber:String) {

[code]....

View 3 Replies

ActionScript 3.0 :: Convert And Return A Bytearray (string)?

Mar 15, 2012

I need to take a string and convert it to a bytearray. such that the return is of type ByteArray. I thought writeUTFBytes(String) would work cept that returns type Void.Im not seeing anything in the docs about returning a bytearray

View 4 Replies

ActionScript 3.0 :: Return Class Instance As String

Feb 1, 2009

Is there anyway to include a function or overrite something in a class that'll output a custom string when the object is called as a string?

So for example if I created a class named "myClass" and I instantiated it:

Code:
var myObject : myClass = new myClass();

When I:

Code:
TextControl.text = "blah blah, " + myObject;
myObject is getting casted as a string. Normally it would output:
"blah blah, [object myClass]"

Is there a built-in function that recast the object as string? Is there anyway for me to change that string output? I know I can just make a public toString() method in the class or something, but just wondering if there was something better.

View 3 Replies

ActionScript 2.0 :: Remove Hard Return From String?

Nov 18, 2004

I have a multiline textfield were users can type text. I split the text in words so I can compair them to see if they are a certain word. Some words don't pass the if statment even if they are the same (at leased to me). I found out it's because these words have a hard return in front of them. I need to remove the hard return, but I can't find out how. I tried to split the string on " ", but that doesn't work.

View 3 Replies

ActionScript 2.0 :: Return The Target Of A Tween Object From Within The Object?

Nov 7, 2006

Is there a way to return the target of a Tween object from within the object?

Code:
myTween.onMotionFinished = function (){
trace (this.target)
}

That's obviously not the way you do it, but that's what I want it to be...

View 9 Replies

ActionScript 3.0 :: Return The Name Of The Object That Is Under The Entire Bounding Box Of The Object

Feb 11, 2009

It seems that dropTarget only returns the name of the object that is directly under the mouse. Does anyone know whether there is a simple way for it return the name of the object that is under the entire bounding box of the object being dragged?

View 1 Replies

Arrays :: Flash - Searching For String And Return Index In AS3

Jan 20, 2012

I want to search an array to see if it contains a specific string, and then get the index of the result. For example, if I had:
array[0] = "dogs";
array[1] = "cats";
array[2] = "oranges";
I want to be able to search for "oran" and get 2 back.

View 1 Replies

ActionScript 3.0 :: Set A MovieClip Return Value By Passing A String Argument

Oct 3, 2009

I'm trying to figure out how to set a MovieClip return value by passing a string argument and using that string to define the child of a given movieclip. I'm doing something wrong because I keep getting null traced instead of home_mc.[code]

View 2 Replies

ActionScript 3.0 :: Return The Value Of A String Into A Dynamic Text Field?

Oct 18, 2011

Presently I have created 2 dynamic buttons. When I click on them I want them to return the value of a string into a dynamic text field. I am doing this using only as.....no timeline. Right now they are returning the value of sqaureMC and circleMC. How to I get them to add value of string?

View 7 Replies

ActionScript 2.0 :: Search + Return A New String Containing Parameter Along With A Couple Of Words

Oct 8, 2006

i'm trying to write a function but with no luck. seems my brain capacity's limited the function will take two parameters: a term to search for, and a string to be searched. what i want the function to return is a new string containing the term (the parameter) along with a couple of words before and after it (as found in the search string).

View 2 Replies

Actionscript 3 :: ByteArray Return Its Content As A String With Two Bytes Per Unicode Character?

Aug 13, 2010

var bytes:ByteArray = new ByteArray;
bytes.writeInt(0);

trace(bytes.length); // prints 4
trace(bytes.toString().length); // prints 4

When I run the above code the output suggests that every character in the string returned by toString contains one byte from the ByteArray. This is of course great if you want to display the content of the ByteArray, but not so great if you want to send its content encoded in a string and the size of the string matters.Is it possible to get a string from the ByteArray where every character in the string contains two bytes from the ByteArray?

View 2 Replies







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