Flex Alchemy - Returning A ByteArray From C Function?

Oct 28, 2009

I am using Flex's Alchemy library to generate SWC's out of C files. I have a byte array (unsigned char buffer[size]) in the c-layer that I'd like to return to the ActionScript layer as a ByteArray. Do I have to iterate through the array and explicitly call AS3_Set on each element or is there a way to just return the entire C array at once?

View 2 Replies


Similar Posts:


Flex :: Pass ByteArray To C Code In Alchemy?

Feb 3, 2011

I want to pass a byte array object from flex code to C code.How to do that?

View 3 Replies

Actionscript 3 :: Alchemy ByteArray Float Conversion From Sound Extract?

Apr 6, 2011

I'm trying to do something simple: send a byteArray to a C library, fill up a buffer and read the memory, but I think I have float conversion problems.

Here is what I do in AS:
var memory:ByteArray = gstate.ds;
// get sound
var soundBytes:ByteArray = new ByteArray();
_source.extract(soundBytes, 4096);

[Code]...

View 1 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

ActionScript 3.0 :: Flex Returning Values In Function Parameters

Apr 12, 2010

In C you can pass a reference to a data item as a parameter to a function. then within the function you can write to that address thus passing back a value to the caller. Can you do anything similar in AS3?

I know you can use the return statement but I want to return a status by that mechanism plus a value in a parameter.

View 10 Replies

Flex :: Arrays - Write Function Object To Bytearray?

Jan 1, 2011

I have byte array, and I want to write into it a Function object, like the following:

var func:Function = function f(event:Event):void
{
trace('hello');
}

[Code]....

View 1 Replies

Actionscript 3 :: Return Values From Calling A Function Using Lua Alchemy?

Jan 17, 2011

Im calling a function in lua from actionscript using callstack : Array =

luaAlchemyInstance.doString("luafunction");

my function should return some values

function luafunction()
return true, 125
end

When i look at the callstack array returned by the function in as3,I recieve only the success/fail part.The array length is 1, true, and contains none of my return values.

View 3 Replies

ActionScript 3.0 :: Function Returning Array And Declaring A Function With Event And Variable?

Jul 27, 2009

is it possible to declare function this way

ActionScript Code:
function startShake(e:MouseEvent, num1, num2):void

what i mean is it possible to send to the function not only en event but also a variable and a second question how can i access

ActionScript Code:
function stopShake(e:MouseEvent):Array

this array that function return.

View 1 Replies

Flex :: Looping OGG Files With Adobe Alchemy

Jul 30, 2010

I'm trying to use Adobe's OggVorbis library. But I can't seem to get the Sound object to loop. I even tried looping the _sound object inside the AudioDecoder.as in the "com.automatastudios.audio.audiodecoder" package. Do you really have to reload the file and stream it over and over?

View 1 Replies

Flex - Return Byte Array From Alchemy C?

Feb 3, 2011

I have written a alchemy code for reading the byte array that i have passed from flex.

When i print the value i get the error cannot convert "OggS" to flash.utils.ByteArray

Alchemy Code

[Code]....

View 1 Replies

Flex :: Adobe Alchemy Byte Array Reading?

Feb 3, 2011

I am trying to send a bytearray extracted from a file to the C code and return that bytearray again from the C code..I am printing the contents of the return value from C in a text view contents.text but all i can see is the byte array object "OggS". I can't see the contents of the byte array. Can anyone say where i am going wrong?.. I have posted the C code and the AS code.

AS Code:
private function copyByteArray(content:String):void{
try{

[code].....

View 1 Replies

Php :: Calling A Page With MySQL Query From Javascript Function Then Returning Results To Another Javascript Function

Jul 8, 2010

I am refactoring some code. I have a PHP page that contains a MySQL query and stores the result in a PHP variable $my_result. This result is then echoed to a Flash SWF during embedding with SWFObject. I now want to call this PHP page that makes the query from a javascript function like so - one change I have made to the PHP is that instead of storing the result in a variable $my_result I am echoing the result. Javascript function to call the PHP page and make the database query

[Code]....

View 2 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 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 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 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 :: Class - Returning From Function?

Jun 28, 2010

I want to make class which will import picture into UILoader and then will show it. It looks like that:

ActionScript Code:
package mob.kopertownik
{
import fl.containers.UILoader;

[code]....

And into the *.fla file I have got something like this:

ActionScript Code:
var myPicture:Picture = new Picture();
myPicture.CreatePicture(fileRef.name);

When I have got everything ready and the all requirements are fulfilled there is nothing happening.

View 9 Replies

ActionScript 2.0 :: Returning Values From A Function?

Oct 12, 2005

I need to load data from a database, so I created the following function and placed it in frame 2 on the main timeline.

Code:
getQuestionSet = function (category:String, subject:String, level:Number, count:Number):Array {
var questionSet:Array = new Array();
var writeV:LoadVars = new LoadVars();

[Code]...

Whenever I try to call the function, it fails to set the value of the questions array. It always appears empty(questions[0]-questions[10] have the value undefined). But, if I check the values from within the function after I have set them, it works, so I know that it is receiving the values. What am I doing wrong?

Code:
questions = getQuestionSet("Art and Music", "Art", 1, 10);

Here is an example of how I have would call the function.

View 7 Replies

ActionScript 3.0 :: Classes Returning Value From Other Function

Sep 3, 2009

I have a question regarding classes.[code]What i want is that clue() should return me the value of NetStatus which is generated in returnResult() when this function is invoked.Now in this case var "f" will become undefined because Clue() is not returning anything, so how can i find a way that value of NetStatusEvent.NET_STATUS (in this case) will be returned from Clue().Although i can use ENTER FRAME EVENT to check when it has generated a status but i'm sure that there must be a better way.

View 1 Replies

ActionScript 3.0 :: Returning Object From A Function?

May 30, 2010

I am new to AS3 and need to gather data from an XML file, parse it and then return all the vars to be used globally. How do I return an object like in the code below?

Code:
var dSession:Object = new Object();
function parseXMLData(incomingData:XML):Object

[code].....

View 7 Replies

Flex :: Adobe Alchemy Tool Create Faster Running Flash Byte Code Than The Compiler?

Dec 8, 2009

I have seen a few blog entries on this and have had a discussion or two with my team mates but I would like to see what the stack overflow community thinks.

So why does the Adobe Alchemy Tool create so much faster running flash byte code than the flex compiler?

Also, when will the flex compiler be able to make similar performance gains? Will it require programmer specific use of special Array's or something of that nature to get the same performance?

View 2 Replies

ActionScript 3.0 :: Recursive Function Returning Null Value

Feb 7, 2011

I've been trying to implement a QuadTree to store a two-dimensional array representing a terrain. I generate the array first, then I use the below function to generate a QuadTree for the array.

[Code]....

View 5 Replies

ActionScript 3.0 :: Returning Value To Parent Function From Child

Aug 29, 2011

I need to get the value inside a handler..
ActionScript Code:
public function verifyUser(p:String):String{
var verify:String
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("verify.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
[Code] .....
It's always returning 'null'. because its not waiting for the completehandler to be completed and just passes the null value of verify..

View 4 Replies

ActionScript 3.0 :: Returning A Function Parameter As Variable?

Sep 21, 2011

ok so i've been stuck on this for a while...What i'm trying to do is create a function that updates a global variable (randomVar) that is itself a parameter in the function e.g

[Code]....

Basically, i thought randomVar and vari were the same so when vari was changed randomVar would too but that's not the case. So how do i make the parameter equal the new value(5). I want to repeat the function using different variables so putting randomVar = vari in the function is not possible.

View 5 Replies

ActionScript 2.0 :: Function Call Keeps Returning Undefined?

Oct 3, 2004

I have 5 buttons that onRelease (= when clicked) calls the same function with each a different variable.

contentLoader(profile);
contentLoader(projects);
and so on.

the function is:

function contentLoader(sName:String) {
trace(sName);
}

Now the trace returns 'undefined'...I just do NOT see it anymore The idea behind is that I want to use a moviecliploader to load in the content corresponding with the clicked button (projects.swf, so it'll use myMCL.loadClip(sName + ".swf"); That trick always worked, but like I said, it keeps returning undefined. Did I make a mistake by strict data typing sName as a String?

View 2 Replies

ActionScript 3.0 :: Returning Multiple Objects From Function?

Jun 22, 2010

I have a function that returns an object full of data pulled when an XML file gets parsed. But I also need to use an array object with additional data. That array also gets built in the same function. Is there a way to return both? I am trying to get both the "Obj" and "SlideTime[idx]" data to use as globals.[code]

View 4 Replies

ActionScript 3.0 :: ByteArray To BitmapData In 1 Function?

Jan 9, 2010

I need a function to change an ByteArray to BitmapData in 1 function:

makeBitmapData(bytes:ByteArray):BitmapData

Is this possible? Cause all I can find about this is first put the bytes in a loader. add listener to the complete event and then call a function that make the bitmap/bitmapdata. can this also be done in 1 function?

View 5 Replies

ActionScript 3.0 :: Returning Variables From mouse Event Function?

Sep 19, 2008

I am working with code where the variable "k" is a counter. I stripped out the extraneous stuff from the code below - so essentially when the function onExamPlusClick is called, the counter "k" and the minutes of an activity in an array both increment (as well as other things not shown). I'd like to return "k" as well as "activity[0].minutes" to the main program. Since the function is a MouseEvent, I'm unable to change "void" to "number"... and not sure how to return (pass) those variables back to the ain program.

View 3 Replies

AS3 :: Flash - Returning A Variable From An Event Listener Function?

Sep 28, 2011

I'm trying to return XML from an event complete back to the main function, but can't figure out how to do it.Here's the functions I'm calling:Main File:

public var mySendAndLoad:SendAndLoad = new SendAndLoad();
mySendAndLoad.sendData(url,variables)
The mySendAndLoad class:

[code]........

View 3 Replies







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