Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Is There A "User Function"-Type Sorting Available In AS?


Hello again-

as always, I only drop by when *I* have a problem... I'm such a selfish bastard (is it allowed to even say "bastard" on here?)

Anyways. I know that (in PHP) there's a way to use user-created functions to sort an Array (usort & uksort) by custom comparisons- you pass the Array and the name of your function and it uses your own function to "re-organize" the array.

Is something like that also available / possible in Actionscript? Or do I have to write my own function where it loops through the array entries and writes them into a new array? I need it relatively quick so setting up my own might take too long.

The setup is pretty much this (just in case you're interested):
Code:
my_array[0]["name"] = "Bob"
my_array[0]["number"] = "11"
my_array[1]["name"] = "Peter"
my_array[1]["number"] = "22"
my_array[2]["name"] = "Justus"
my_array[2]["number"] = "33"
Now comes the part that makes me require a user function...
I have another array, that contains a custom order to be applied to the main array (my_array):
Code:
sort_array[0] = "22"
sort_array[1] = "33"
sort_array[2] = "11"
What I need is a function that will process "my_array" and re-order it so that the entries in "my_array" are in the order that matches the "number" field (from "my_array") to the order of the number values in the array "sort_array".

I hope the example makes sense... basically, what I need is (going by above's example) a result where "my_array" will end up ordered like this:
Code:
my_array[1]["name"] = "Peter"
my_array[1]["number"] = "22"
my_array[2]["name"] = "Justus"
my_array[2]["number"] = "33"
my_array[0]["name"] = "Bob"
my_array[0]["number"] = "11"
(ordered by "number" in connection to the sequence in which the numbers are in "sort_array")

It doesn't matter to me if it will create a new array- or if the keys will be retained or re-set... I just need the array to be sorted ^^;

Thanks for all you people's time and effort!

~Marcel




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-11-2006, 05:28 AM


View Complete Forum Thread with Replies

Sponsored Links:

Implicit Coercion Of A Value Of Type String To An Unrelated Type Function
Hi there

Why I can't use an "eval" function (i am not sure this is the right terminology) inside addEventListener (I put in yellow) ?

for (i=1;i<10;i++) {
var constructFunction1:String;
var constructFunction2:String;
constructFunction1="choix3"+i+"Handler";
constructFunction2="choix3"+i+"HandlerClick";
MovieClip(this["choix"+i]).addEventListener(MouseEvent.MOUSE_OVER,constructFunction);


Then error in the compiler:

1067: Implicit coercion of a value of type String to an unrelated type Function.

View Replies !    View Related
Sorting User-defined Numbers Largest To Smallest?
Hi,

I am looking for a way to sort numbers enterred by a user, prefferably in order smallest to largest or vice verser - but at very least to find the smallest & largest numbers of the ones enterred.

There are approximately going to be 15 numbers or so.

So for example:

Enterred A = 56
Enterred B = 7
....
....
Enterred H = 72

then it should display:

Enterred B = 7
....
....
Enterred A = 56
....
....
Enterred H = 72

when sorted or the other way round (largest to smallest).

this could be done with comparrisons but for 15 numbers it would be A LOT of comparisons.

Does anybody know an algorithm or a way of doing this more simply ?

Array.sort may do it but not sure if it works for numbers?

Any help is much appreciated!

View Replies !    View Related
Sorting User-defined Numbers Largest To Smallest?
Hi,

I am looking for a way to sort numbers enterred by a user, prefferably in order smallest to largest or vice verser - but at very least to find the smallest & largest numbers of the ones enterred.

There are approximately going to be 15 numbers or so.

So for example:

Enterred A = 56
Enterred B = 7
....
....
Enterred H = 72

then it should display:

Enterred B = 7
....
....
Enterred A = 56
....
....
Enterred H = 72

when sorted or the other way round (largest to smallest).

this could be done with comparrisons but for 15 numbers it would be A LOT of comparisons.

Does anybody know an algorithm or a way of doing this more simply ?

Array.sort may do it but not sure if it works for numbers?

Any help is much appreciated!

View Replies !    View Related
Anyone Can Help - Sorting Function On XML ?
Hi, I will be creating a pool of data stored using XML (Database may grow to 10000++) Is there any way where I can efficiency use to sort my data fast & quick. Initially, I store in an array and sort the data, but think it will be rather a slow process.

Anyone can help??
Thanks..

View Replies !    View Related
Helping Sorting Out A Local_data Function
Basically i want to be able to set what is effectively a cookie in flash. The example here shows what i have so far.

I think that all the pieces needed are there, and they are in the same place as they are in my movie. But they are not working.

So can someone help me sort out where the code needs to go etc.???

View Replies !    View Related
[F8] Problems Reading Text Present In Form Before User Type Anything
To be honest I am tempted to post this in the newbie section ><

I have a multiline text field saying "Enter your question here" and I have made doubly sure that there are no linebreaks or extra spaces.

However my code if(question_txt.text eq "Enter your question here"){} does not work and when I trace it there is a linebreak after the text for some reason.

If I change the form to be single line, it all works fine !?!

ehmmm... help

View Replies !    View Related
User Defined Base Class Linked With 2 Symbols Gives Error #1034: Type Coercion Failed
Hi, I have two movie clips in the library linked to the same base class, Container, with different class names defined in Properties. These clips each contain (nest) several other clips that are also linked to another base class, Contained. Is there something else that needs to be done to deal with nested clips like this? I'm not certain that nesting is an issue, but in a scenario with different symbols I could not replicate the problem. I've attached a simplified version of the problem .fla with the 2 .as files. I'm using the latest version of CS3. The error is: TypeError: Error #1034: Type Coercion failed: cannot convert Contained_AnteriorLeft@1c4ba431 to Contained_PosteriorLeft.

View Replies !    View Related
Defining A :Function Type Of Function
Hi All,

There may not be a way to do this, but I thought that I would be able to return a function call by doing something like this:


PHP Code:



//pass vars zoomTo(hotels[i]);//passes "port" correctlyfunction zoomTo(whichMov):Function {    callFunc = "move_"+whichMov; //receives "port" correctly    return (callFunc);}//trying to call this function from  zoomTo() above:function move_port() {    moveMap(-1600,-1200,300,300,1);} 




The variables are being passed correctly, however, I'm not sure how to call a function this way. Any help?

View Replies !    View Related
Fancy Box Type Moving Graphic Type Cool Efect But Im To Dumb Type Thingy
i am tring to make a box thinky simaler to the one on www.starvingeyes.com but cant even work out how to start it. is there anyone who can point me in the right direction or to a tutorial ?

the box has a graphic inside a grided box the sections of the graphic fade in and out as the mouse goes over them and displays random sections when the user is not moving the mouse over the box

i did find java tutorials for this effect but would much preffer it to come from flash as java is a bugger to get working on some machines

Any way thanks in advance for any help

Steven Green one_mad_punk@yahoo.co.uk

View Replies !    View Related
[type Function]
HI I am getting the multiple results from the loadVars in a dynamic text field. BUT i am stilll getting this [type Function] the end of the results.

How can I remove it please explain ASAP

CHEERS

View Replies !    View Related
Type Function?
I'm trying to trace depth of a mc.....


ActionScript Code:
onClipEvent (load) {
    trace(this.getDepth);
}


all it says is type function??

where do I go wrong??

View Replies !    View Related
Database Type Function?
I hope all you very capable folks can come up with a solution that I can understand!

I need to include a glossary (approx 100 words and definitions) in a flash file whereby the user can click on a word from an alphabetical list and the definition will pop up. Also will have clickable words scattered about in the text of various pages that they can click on. The client does not have the option of using a database program at this time. It has been done in the past using eval(), but maintaining the text file that loads in is a nightmare since they have to renumber it each time they add a word. I tried loading it into an array from a file built in "Excel", and (with a few minor replacements in "Word"), it worked fine, but took WAAAYYYY too long!. Is there an easier way to go about this? The documentation advises not to use eval() anymore, but I don't know how else to achieve the same functionality. If you are going to tell me to use XML, be patient, that's new territory for me.

Thanks for any help you can give me.

View Replies !    View Related
[Type Function] Return? Wtf Is This?
I have script that creates an array of numbers, randomly choses one from that list, assigns this number to one of the MC's depth, removes it from the array, then moves on to next MC. The purpose is to randomly generate Depth levels.

v_?? are variables
a_?? array
c_?? Clips (MC's)
i_?? interger counters
f_?? functions

when I "trace" the result for the FishA, it displays [Type Function], OR reports the depth is -16383 (or some ridiculous #)

what have i done wrong? What does [Type Function] mean?

onClipEvent(load){
v_Depth = 0;
a_Depth = new Array();
for(i_Count = 0; i_Count < 30; i_Count ++) {
a_Depth [i_Count] = i_Count;
}
function f_SetupDepth(fv_MC) {
v_Depth = random(a_Depth.length);
trace(v_Depth);
_root[fv_MC].swapDepths(Number(v_Depth));
a_Depth.splice(v_Depth,1);
}
f_SetupDepth(c_Column1);
f_SetupDepth(c_Column2);
f_SetupDepth(c_Column3);
f_SetupDepth(c_Column4);
f_SetupDepth(c_Column5);
f_SetupDepth(c_Column6);
f_SetupDepth(c_FishA);
}

View Replies !    View Related
Output [type Function]?
i get the output window popping up when i rollover a button...it says [type Function]...what does this mean...?


//code on the button
on (rollOver) {
setProperty("_root.mv01", _xscale, "200");
}
on (rollOut) {
setProperty("_root.mv01", _xscale, "100");
}

View Replies !    View Related
[type Function] Output
Hi,
I'm trying to debug my code and Im seeing an out put that is:

FIRST IMAGE ---------
http://www.frustrated-inc.com/comm/c_zooLepard_v.gif loaded! LAYER: 1
--------------------
[type Function]

... I expect all the stuff before the: [type Function]
could someone explain to me what this is.. Ive looked all over and have been unable to find any reference for this output.

self taugh actionscripter...

grateful for any assistance : )

Kim

Just trying to understand what [type Function] actually is....

View Replies !    View Related
[type Function] Returned
I'm trying to display the velocity of a movieClip "Glider" in a dynamic text field.

In the movieClip "Glider":

Code:
var _Vx:Number = 1; //Set to 1 for testing purposes
var _Vy:Number = 1; //Ditto

function _V ():Number {
var v:Number = Math.sqrt(_Vx ^ 2 + _Vy ^ 2);
return v;
};
And in the scene:

Code:
onEnterFrame = function() {
Out.text = "";
Out.text += "Vx=" + _root.Glider._Vx + " ";
Out.text += "Vy=" + _root.Glider._Vy + " ";
Out.text += "V=" + _root.Glider._V + " ";
}
This gives me an output of:
Vx=1 Vy=1 V=[type Function]What am I doing wrong and how can I fix it?
Thanks

View Replies !    View Related
Variable Of Type Function
Hi,
Actionscript question - what's the rationale behind the fact that one is able to create a public variable of type function in a class, then define that function later at runtime?

The CellRendererAPI requires that any CellRenderer class declare (but not define) a set of functions & properties.
It's bugging me why this is not resolved through inheritance.

Thankyou.

View Replies !    View Related
[type Function] Error
Can anyone help with a switch/case problem?

I am using Flash8 and saving as mx2004 (if that helps matters any)

I keep receiving a [type Function] error in the dynamic text field, and cannot figure out for the life of me why!

here goes:

function totaltax() {
var pone:Number = Number (priceone_txt.text);
var ptwo:Number = Number (pricetwo_txt.text);
var salestax:Number = Number (salestax_txt.text);



var caamount:Number = (pone + ptwo) * .085;
var catotal:Number = (pone + ptwo + caamount);

var maamount:Number = (pone + ptwo) * .05;
var maship:Number = 5.00;
var matotal:Number = (pone + ptwo + maamount + maship);

var txamount:Number = (pone + ptwo) * .045;
var txtotal:Number = (pone + ptwo + txamount);

var scamount:Number = (pone + ptwo) * .05;
var sctotal:Number = (pone + ptwo + scamount);


trace(shipstate_txt.text);
shipstate_txt.text = shipstate_txt.text.toUpperCase;

trace(pone);
trace(ptwo);
trace(shipstate_txt.text);

ship = shipstate_txt.text;
switch(ship) {
case "MA":
salestax_txt.text = maamount;
shipping_txt.text = maship;
grandtotal_txt.text = matotal;
customer_txt.text = "Your Total is";
break;
case "CA":
salestax_txt.text = caamount;
shipping_txt.text = caship;
grandtotal_txt.text = catotal;
customer_txt.text = "Your Total is";
break;
case "TX":
salestax_txt.text = txamount;
shipping_txt.text = txship;
grandtotal_txt.text = txtotal;
customer_txt.text = "Your Total is";
break;
case "SC":
salestax_txt.text = scamount;
shipping_txt.text = scship;
grandtotal_txt.text = sctotal;
customer_txt.text = "Your Total is";
default:
final_txt.text = "You did not enter a valid state!";
}
}


Thank you in advance!

View Replies !    View Related
GetBytesLoaded: [type Function]
Hello,

I'm trying to load PHP data into a Flash movie, and it worked a couple of times. But now I get the following message when I try to write the loaded number of bytes to the screen:
"getBytesLoaded: [type Function]"
"getBytesTotal: [type Function]"

This is what I do:

PHP Code:



function writeStringFromDB(TextID,Language,ButtonID)
{
    var    stext = new LoadVars();
    stext.TextID = TextID;
    stext.Language = Language;

    var tstring = new LoadVars();
    stext.sendAndLoad("fetchText.php",tstring,"POST");
    tstring.onLoad = setText(tstring,ButtonID);
    Debug.text += "getBytesLoaded: " + tstring.getBytesLoaded + "
";
    Debug.text += "getBytesTotal: " + tstring.getBytesTotal + "
";

    function setText(textOBJ,ButtonID){
        Debug.text += textOBJ.toString();
    }





And the data returned isn't found in the object, the object seems empty:
PHP script looks like this:

PHP Code:



<?php
echo "TextString=TestTestTset";
?>




Thanx,
Marcel

View Replies !    View Related
Strict Data Type Function
how would you call this variable??


Code:
var myFunct:Function = function():Void
{
trace("function called");
}

View Replies !    View Related
Avoiding 'onLoad=[type Function]'
Hi,

I have a dynamic text box that retrieves text from a PHP file that in turn retrieves text from a mySQL database. Sometimes the PHP file may necessarily display no text if the mySQL database is empty. However, when the dynamic text box in Flash tries to retrieve text from an empty PHP file the dynamic text box displays onLoad=[type Function]. Is there a way of making the dynamic text box display nothing in such circumstances?

I have attached the actionscript the dynamic text box uses to retrieve its text and also the PHP code used to retrieve text from the mySQL database.

Many, many thanks,

leao

Actionscript
code: path = "http://www.stpatrickscommunity.org/admin/text/landline.php";
lv = new LoadVars();
lv.onLoad = function(){
str = unescape(this);
str = str.split("=&onLoad=[type Function]").join("");
landline.html = true;
landline.htmlText = str;
};
lv.load(path);

PHP

PHP Code:



<?php
header('Content-type: text/html; charset=utf-8');
mysql_connect("mysql.myhosting.com","stpatri_user","password") or die(mysql_error());
mysql_select_db("stpatri_table") or die(mysql_error());
$result = mysql_query("SELECT * FROM text")
or die(mysql_error());  
$row = mysql_fetch_array( $result );
$str_encoded=urlencode($row['landline']);
echo "$str_encoded";
?>

View Replies !    View Related
How Can I Pass A TYPE As A Parameter Of A Function
PHP Code:



public function SeatMe(manager:IManager):void
{
    /*if (manager is IAssetManager)
    {
        if ( _assetManager == null)
        {
            _assetManager = manager as IAssetManager;
        }
        else
        {
            throw new Error("Waiter.CanYou.SeatMe()::I am sorry sir, but Mr. Asset Manager already exists");
        }
    }
    if (manager is IWorldManager)
    {
        if (_worldManager == null)
        {
            _worldManager = manager as IWorldManager;
        }
        
    }*/
    
    if (checkTypeManager(manager, _assetManager, IAssetManager, "Asset Manager"))
    { }
    else if (checkTypeManager(manager, _worldManager, IWorldManager, "World Manager"))
    { }
    else
    {
        throw new Error("Waiter.CanYou.SeatMe()::I'm sorry sir, but we don't allow you kind here");
    }
    
}
        
private function checkTypeManager(manager:IManager, targetStaticManager:IManager, targetType:Class, targetString:String):Boolean
{
    var result:Boolean = false;
    if (manager is targetType)
    {
        if (targetStaticManager == null)
        {
            result = true;
            
            targetStaticManager = manager as (targetType as Class);
        }
        else
        {
            throw new Error("Waiter.CanYou.SeatMe()::I'm sorry sire, but " + targetString + " already exists");
        }
    }
    
    return result;
}




Hey guys I wante to be able to take the code in the comments ( if its a type of manager then set it to var )

and make a general function to handle this process. Is it possible? Below my comments is a general solution I envisioned.

thanks again ^_^

View Replies !    View Related
Function Can Return Multiple Type
Hi there.

Ok, I would like to know if someone know how to achieve this.
I have a superclass (singleton) with a static function returning the type of the class.

ActionScript Code:
//  create the singleton
    public static function createWorld(owner:MovieClip):superClass {
    //  init the superClass
        superClass.instance.init(owner)
        return superClass.instance;
    }

I have a child class which is inherit from the super class.

The thing is I want to be able to create my childClass instance like that

ActionScript Code:
var gameworld:classes.childClass = childClass.createWorld(this);

but I have a type mismatch as it return the super class type.

Any idea?
I know that I could get rid of the return type and it will be ok, but I wonder if there is another way to achieve what I want.

Cheers

View Replies !    View Related
Why I Always Get This Message At Output [type Function]
why i always get this message at output [type Function]

what does it mean?

also what does nan stand for?

View Replies !    View Related
Avoiding 'onLoad=[type Function]'
Hi,

My dynamic text boxes retrieve text from PHP files that in turn retrieves text from a mySQL database. Some times the PHP files may necessarily display no text. When my dynamic text boxes in Flash try to retrieve text from such empty PHP files the dynamic text boxes display onLoad=[type Function]. Is there a way of making the dynamic text boxes display nothing in such circumstances?

I have attached the code used to retrieve text into the dynamic text boxes below.

Many, many thanks,

leo


ActionScript Code:
path = "http://www.stpatrickscommunity.org/admin/text/address.php";
lv = new LoadVars();
lv.onLoad = function(){
str = unescape(this);
str = str.split("=&onLoad=[type Function]").join("");
str = str.split("
").join("<br>");
address.html = true;
address.htmlText = str;
};
lv.load(path);

View Replies !    View Related
ExternalInterface Handling Function Type
Hi All

I've had a look around the web, and I can't seem to find an answer to this.

Does anyone know why if you call Actionscript from Javascript, via the ExternalInterface class, and you pass in a Function type, it's value turns to null in the Actionscript? i.e.

javascript:


ActionScript Code:
var testFunc = function(){
    var test = "blah";
}
document.getElementById("flashMovie").flashFunction(testFunc);

Actionscript:


ActionScript Code:
ExternalInterface.addCallback("flashFunction", callMe);

public function callMe(param1:*):*{
    trace(param1)
}

trace outputs 'null'?

Is this a permanent feature of ExternalInterface, or a fixable bug?

Also, any objects you pass as an argument are copied, rather than passed as a reference, so any changes you make to the object in the Actionscript are not reflected in the Javascript. I have no idea what the ExternalInterface is doing with these parameters, so again, I wonder if this fixable or not.


Thanks

Darren

View Replies !    View Related
ComboBox [type Function] XML Problem
What I'm trying to accomplish is populating a ComboBox component's labels and data using an Array that's created from an XML data source. I know that I can populate the ComboBox in ActionScript using this:
------------------------------------------------------------------------
comboBox.labels = ["itemA",'itemB","itemC"];
-OR-
var cbArray:Array = ["itemA",'itemB","itemC"];
comboBox.labels = cbArray;
------------------------------------------------------------------------

However, I'm running into problems when the Array is created from my XML datasource, like this:
------------------------------------------------------------------------
for (var g:Number = 0; g < aChildren.length; g++) {
var aItem:String = aChildren[g].firstChild.firstChild;
cbArray.push(aItem);
};

comboBox.labels = cbArray;
trace(cbArray);
------------------------------------------------------------------------

I've left all of the XML details (load, onload, etc.) because I don't think that the problem is there. In my example, when I test the movie, the trace(); function displays the correct info, but the comboBox component is populated only with an identical number of instances:
[type Function],[type Function],[type Function],[type Function],[type Function]...

I couldn't find a thread anywhere with my particular problem. Any ideas?





























Edited: 03/12/2008 at 07:42:51 AM by dextrometh

View Replies !    View Related
Dynamically Setting Function Type Through Xml
I have a number of functions and I want to execute 1 based on the entries in a .xml file

part my xml file reads as follows

<funcType>thisFunc</funcType>

In my .fla I have defined thisFunc along with a number of similar functions

I want to execute the function as follows

chosenFunc=Node.childNodes[0].childNodes[0].nodeValue;//points to thisFunc in the .xml file

chosenFunc(); // This should execute as thisFunc ()

Problem is this doesn't seem to be working. Am I trying the impossible?

View Replies !    View Related
Can Anyone Tell Me How To Make Type Ahead Function?
Hi, I have searched the net and come across articles on how to make a type ahead (auto suggest) search bar but not being a programmer it confuses me and I can't even get it to work copying and pasting code.

Do I need a dynamic site for this tool? can anyone point me in the right direction? :-s

View Replies !    View Related
Static Function Call Through Type Reference
I'm attempting to call a static member function of a class without instantiating it via a type reference as returned by getDefinitionName.


Code:
var typeRef:Class = getDefinitionByName(__class) as Class;
var width:int = typeRef.getWidth();


This isn't working, I'm getting a syntax error:

1061: Call to a possibly undefined method getWidth through a reference with static type Game.GameLogicisplayObject

I've googled quite a bit and I'm not seeing anything relating to this, is this even possible?

View Replies !    View Related
Function To Find Variables Data Type?
Is there a way to find a variable's data type?

I've created a QuickSort routine for an associative array. Right now it's just sorting alphabetically. I send it a 'column name' and it sorts by that 'column'. I want to find by the variable name(this is all in a class file) what that variables type is so that I can handle numbers and dates.

View Replies !    View Related
Can I Pass A Class Type As A Function Parameter?
So, in AS2, I had a function that would create different movieclips based on variables I passed in (because attachMovie() took the name of the movieclip as a string - e.g. attachMovie("man",...) or attachMovie ("car"...)).

In AS3, it's done more correctly now, with a var mc = new Man() or new Car().

Is there a way for me to pass the class type (Man or Car) as a function parameter to a function:

e.g.

public function MakeMovieClip(classType:<something>):MovieClip {
return new classType();
}

or do I need to basically make a giant switch/case block that switches based on strings (which is what I'm currently doing)?


Thanks,

--
Ken

View Replies !    View Related
Sorting Classes (Sorting Algorithms)
I am going to start working on the sorting algorithms found at this site http://www.cs.ubc.ca/spider/harriso...rting-demo.html, the reason for this thread is to ask if anyone would like to help.

Reasons:
there is ALOT of code that needs to be converted to ActionScript 2.0, not only the main class, but each algorithm that extends it, anyway, i'm going to do this, I would just enjoy having help. Thank you in advance.

-Michael

View Replies !    View Related
Sorting Classes (Sorting Algorithms)
I am going to start working on the sorting algorithms found at this site http://www.cs.ubc.ca/spider/harriso...rting-demo.html, the reason for this thread is to ask if anyone would like to help.

Reasons:
there is ALOT of code that needs to be converted to ActionScript 2.0, not only the main class, but each algorithm that extends it, anyway, i'm going to do this, I would just enjoy having help. Thank you in advance.

-Michael

View Replies !    View Related
Control Text With Audio (closed Caption Type Function)
I was not sure which forum this should go in, so I'm hoping General is the best place.

What I need to ultimately do here is create a "closed caption" type of system. The flash utility will be tied into a database. The ultimate goal is that an audio file in a foreign language can be inserted and text pulled from the database. The text should "highlight" as the audio is being played..

That is the tricky part. Simply masking the text and highlighting it is simple.. but how to get the textual words to match up and highlight in time with the audio words. Does this need to be with time stamps or can I use a special character?

ie: Can Actionscript recognize time stamps as the seperator. Could I have the text in the database look like this

"[00:00]I [00:01]would [00:02]like [00:03]to [00:04]buy [00:05]a [00:06]hamburger"

Obviously this seems not to be a great idea, as you will have to get it down to the millisecond as most people don't take herky jerky enough for each word to take a full second to get out.

Keep in mind, items may be added in the future and having a developer make changes to the system everytime a file is added is not an option.

View Replies !    View Related
How User Put Math Function And Flash Use It
Evening Guys,

Am hoping someone on here is able to help me with this one.

i am want to make user put function such as X^2 +5X +6

in inputtext and user also put the X (number)

i made Button calcate to replace x (number) into the function . what action

script code can i put it? . and can i make it by component?

i attach Calculte.fla for flash mx pro 2004 and attach also calculta2.fla for flash mx

thank you

View Replies !    View Related
Function To Detect Any And All User Input
I want to trace all UI events mouse movement button clicks, and more...

How?

View Replies !    View Related
Function To Detect Any And All User Input
I want to trace all UI events mouse movement button clicks, and more...

How?

View Replies !    View Related
Scope Of A User Defined Function
i want to manipulate the value of a variable passed as a parameter of a function, the problem is there is some sort of scope issue that won't update the variable outside the function. here is the example:


Code:
//there's the variable i want to manipulate
fakeVar=100;

function mult(whichVar){
//let's multiple the variable by 2.
whichVar*=2;
trace(whichVar) // traces 200...correct.
trace(fakeVar) //traces 100, the original value, not correct
}

box.onRelease=function(){
//call the function with the variable i want to update.
mult(fakeVar)
}
the problem is that the function passes the variable correctly and uses it in the script, but when the function ends the variable i passed in isn't updated to the new value anymore as demonstrated by the traces...

any clue how to make a function change a value of a variable outside its scope?

View Replies !    View Related
Can We Call A User Defined Function From Javascript ?
Hi!
Can we call a user defined function in a flash movie from a java script call. to my knowledge it(javascript) doesn't let us call user defined function. But....I badly need it to call one!
Is it possible ?

Thanks!
-mav

View Replies !    View Related
Execute A Flash Function When User Closes IE/Swf
Hello Guys, I am builing a chat application (not with Comm server)that sends a history of the current session to the database. Now If the User closes down his/her browser, how might I send the sharedObject.data.sessionHistory to the database?


I tried..

_root.onUnload=function(){
//code
}

but it didn't work.


Any suggestions?

View Replies !    View Related
Font Color In User Defined Function
Hi,

I am loading text from an XML file with 500 records. This works fine, but these records average three links in each one. I am forced to create user defined functions for most of these links due to the length of the url. I would like to add the font color blue to each of the functions instead of inserting over a thousand font tags into the xml document.

I hope that's clear. Here's one of functions:

function L19550() {
getURL("http://samplelinkthatgoesonforever.htm");
}

The link works, but it would save me a ton of work if I could include the font color inside each of these functions.

Thanks a bunch,
Debbie

View Replies !    View Related
Set The Paramters Of A Function Based On User Input
can you set a function's parameters equal to a variable?

for example

var number:Number = 3;
function args(.....)
{
blah, blah, blah;
}

but i want the arguments to adjust based on the value of the variable number. is this possible?

View Replies !    View Related
[F8] Function() When User Closes Flash Movie
Is it possible to detect when either a flash movie is closed or when the bowser window containing the flash movie is closed and then running and action that saves variables?
I have looked at onUnload but can't make this work for the entire movie.

Thanks

View Replies !    View Related
Calling A User Defined Function In Imported Swf?
I'm a c# dev and done lots of PHP, but this is confusing the **** out of me, i cant figure out how to call a simple function.

This is the deal. i am making a menu that also has a mp3 player on it, and when a user clicks a "video" link on the menu, it pauses the mp3 player.

The menu uses actionscript and the layer 1 : Frame 1 simple includes this external like this - > #include "menu.as"

The mp3 player is purchased, i dropped it into the menu, i imported all the stuff and i dropped it in. If i play the video as a "test movie" it works perfectly, so i know that the functions are executing as expected.

What i need to do is call my child object with the function that is included within it called "pauseplayer".

From my actionscript "menu.as" - i expected to be able to do this.

if(this.mc_Text.tText.text = "THEN")
{
//This is where we need to stop the mp3 player (set it to pause).
mp3_player_without_skin_small_mc.pauseplayer();
}

But this is not working, no matter if i make the function in the child swf public or what not. The child is showing up as a Symbol definition and its really confusing how to use the internal functions to that movie.

PLEASE help me.

View Replies !    View Related
Font Color In User Defined Function
Hi,

I am loading text from an XML file with 500 records. This works fine, but these records average three links in each one. I am forced to create user defined functions for most of these links due to the length of the url. I would like to add the font color blue to each of the functions instead of inserting over a thousand font tags into the xml document.

I hope that's clear. Here's one of functions:

function L19550() {
getURL("http://samplelinkthatgoesonforever.htm");
}

The link works, but it would save me a ton of work if I could include the font color inside each of these functions.

Thanks a bunch,
Debbie

View Replies !    View Related
Can VB Call A Flash's User Defined Function?
Hello,

I know there are a lot of questions about VB-flash communication, but unfortunately, they don't match my problem

I have a function in Flash, named processIt()

I want to call this function by VB.
Code:

Call ShockwaveFlash1.processIt(); => doesn't work
but:
Call ShockwaveFlash1.SetVariable("myVar", "aaa"); => will work

Could you explain me why? An please give me an example of calling user defined function.

Thanks a lot,
Sathish

View Replies !    View Related
Function Waits For User Input From Attached Mc?
How would I craft a function that attached a movieclip and then waited for the user to click something in that clip before it would continue?
:roll: :P

View Replies !    View Related
Previewing The Movie, The Code MovieClip.getDepth Provoke [type Function] Message
I've created several movies using duplicatemovie, each one with a determined depth, as it's demanded.

Then I simply used: trace(copiedmovie1.getDepht)in a frame after
these movies were created.
In the preview, the trace window displays this message
[type Function]
I don't understand what I'm doing wrong. I supposed to obtain the integer asociated with this movie duplication.

View Replies !    View Related
Calling A User Defined Flash Function From A Web Page
Can someone tell me if this is possible. I've got a flash navigation movie in the top frame of a 2 frame web page. Inside the swf I've written a function called "open menu" that takes 3 parameters and does what it sounds like it does within the flash navigation.
My question is ..
Can I call this function and pass in parameters from an html page and have the flash navigation react the same way as inside the swf itself ? I've got an "href only" nav bar on the bottom of the page in the main frame that has
the same navigation elements as the flash navigation and I'd like the top navigation to react accordingly.

Is this possible and if so how.
Thanks in advance

View Replies !    View Related
How To Control Flash's User Defined Function From JavaScript?
please help,...i can send variable from javascript...but dont know how to make flash do function

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved