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




If Do Not Compare But Execute....?



Hi everybody

I have a problem while scripting a little preloader. Everything goes well until I want a comparison to be made with a "if". I don't know why but my if do not combare but execute what i have to compare. For example:

if (a._width=b._width){
gotoAndPlay(4);
}

if i execute, it will do this : the width of a will be equal to the width of b.... Is there somebody who know what is wrong.
thanks.

Vakarm
here's my frame script:


var vcharge=getBytesLoaded();
var vtotal=getBytesTotal();
var vpourcent=math.ceil((vcharge/vtotal)*100);
//vfondbarretotal is the width of the background of my loading bar.
mcbarre._width=(vfondbarretotal*vcharge)/vtotal;

if (mcfondbarre._width=mcbarre._width) {
gotoAndPlay(4);
}
gotoAndPlay(2);



FlashKit > Flash Help > Flash General Help
Posted on: 10-06-2003, 03:58 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How Do I Compare A Var That Is NaN?
I have a text field where you unput numbers.
If using

ActionScript Code:
if(Number(myNumber) == 0 or Number(myNumber) == null){
trace("YES");
}


When the movie starts (my text field is empty) the field is considered a 0 so it traces YES, but if I type a number then erase everything in the field, the field has a value of NaN- how can I check to see if something is NaN, I assumed that was null.

How To Compare Two Strings?
Hi folks,

I've got two movie clips with a dynamic textbox in each.
I need to campare the two strings they hold, I must know if the text is the same or not.

thanx in Advance,

ZooMann

Compare Two Dates Together
hello,

i have an user inputfield for a date in the format DD.MM.YYYY

now i want to compare the date the user inserts to any other date from a variable or an array

lets say i have a date in a variable: 12.12.1986

the user insert his (any) date for example 04.03.1934...
now i want compare this two dates so the output should be

user date < date in var

i should be a flexible solution so i can use it with an array of dates an check it whit a loop if it is < or > than the inputdate

any ideas? thx

sorry for my english

greetings from austria the homecountry of ****ing "terminator" arnie blackenegger
peter

Compare 3 Or 4 Variables?
What is the quickest way to compare 3 or 4 variables (containing numbers) to see which contains the biggest number?

Thanks

Compare These SWF Compressors
Which of these SWF Compressors is the best?

- SWF Compressor
- Swift Compress
- Optimaze (tried it, no luck)
- SUGGEST YOUR OWN...

[F8] How Do I Compare The Old Value And New Value Of The Same Variable?
Say I have a couple buttons, that when pressed give different values. How can I somehow compare an old value to a new value? Not sure how to set that up.

myBtn1.onPress = function()
{
myValue = 1;
}

myBtn2.onPress = function()
{
myValue = 2;
}

function checkValue()
{
// How can I do this part??
if (myValueNEW < myValueOLD)
{
// Do something
}
}

Thanks for any advice on this rookie question.

[CS3][AS2] How To Compare Strings?
Hi,

I am developing a terminal-like flash applet and need some help.

Here is the layout:
http://img.skitch.com/20080404-un685...c8b24prdhu.jpg

So when the user clicks in the box, types "M" (without quotes), and presses the "go" button, I would like it to check if the string in the box is "M", and if true, go to frame 2.

Here is the Actionscript for my "go" button:


Code:
on (release, keyPress "<Enter>") {
if (command == "M") {
gotoAndStop(2);
} else {
}
}


<< by the way, the box's var is "command" >>

All help is greatly appriciated.
Thank you to anyone who replies!

[F8] Compare - Two Arrays
Hi!

I'm workin on a search function for a record archive, and got two arrays.

array1: contains all the record ID's.
array2: contains the result of a search (record ID's).

For exampel if we got 10 records, and got 3 search-hits.

I need to know what position these hits are in array1?

Regards,
S-fish

Compare Two Strings
please tell how to compare two strings

For Eg:

var str1:String = "1234567";
var str2:String = "(xxx) xx-xx";

Here I need to compare str1 and str2 and make str1 to "(123) 45-67"
Here "x' is to specify a number.
Or tell how to convert str1 to "(123) 45-67" which is of str2's format.

Compare X/Y Positions
Now, the idea is that it works OK when I test the movie on the computer I wrote the script. When I got home and tested the movie, it didn't work (exactly the same code) and it also doesn't work when I post it on the net. So, something very weird is going on and I don't know what's wrong. Can you help me on this?

Thanks.

Here is the code:









Attach Code

onClipEvent (load) {
this.onPress = function() {
this.startDrag(false,0,0,440-this._width,350+30-this._height);
};
this.onMouseMove = function(){
if ( _x < bubbleX ) {
if ( _y < bubbleY ){
gotoAndStop (4);
}else{
gotoAndStop (2);
}
}
if ( _x > bubbleX ) {
if ( _y < bubbleY ){
gotoAndStop (5);
}else{
gotoAndStop (1);
}
}
};
this.onRelease = function() {
this.stopDrag();
};
}

How To Compare Numbers?
I have huge problem with pomparing numbers under Flash CS3 in AS2 mode.
Operation:

parseFloat("965.95")==965.95

produces FALSE when swf is played via the browser and produces TRUE when
played under Flash Player directly. How it behaves under AS3 - I don't
know, I haven't done any tests.

Windows XP Pro
IE 7

Does anybody can suggest workaround?

Compare Arrays
Hi,

I have 2 arrays that contain the same values but in a different order. i'd like to reorder the first array like the second one but i have no ideas how to do that easily.
Thank's for your help.
Chris

Compare Strings
I have this textfile with a lot of words in it.
One word on each line.

How can I compare a flash string to the lines in the textfile?
I want to know if the string matches any of the lines in the file.

Compare Arrays
Hi,

I have 2 arrays that contain the same values but in a different order. i'd like to reorder the first array like the second one but i have no ideas how to do that easily.
Thank's for your help.
Chris

How To Compare .fla Files
I have two .fla files one seems corrupted with one movie clip, is it a way to compare and copy over? I am new to flash, please be detailed. Thanks ahead

Date Compare From XML
Hello,

Is the an obvious way to do this....cuz I'm banging my head on the wall here.

I have a XML doc that has a date-time value. I want to compare that date against now. If XML date is in the future, proceed to next frame kinda thing. What format does a date-time have to be in order to convert it to a date object in Flash?

When I do:
myDate = new Date();
I get something like this: Thu Mar 4 21:40:29 GMT-0500 2004

How can I compare that to my time stamp coming from XML? Cuz when I try to convert a string to a Date I get "Invalid Date"

I tried this but no luck:

From the XML doc:
2004,04,28,12,47,52,00

AS code:
alertDate = alert_xml.firstChild.childNodes[0].firstChild.childNodes[0];
tempS = new String(alertDate);
tempD = new Date(tempS);

returns "Invalid Date"


BUT.....This works:
tempD = new Date(2004,04,28,12,47,52,00);
returns: Fri May 28 12:47:52 GMT-0400 2004

How come I can't (haven't figure'd out yet) use my XML value and convert it to a date?

Thanks and bows in advance!

Dman



String Compare
im trying to compare two strings and the examples i've found in help files and tutorials dont seem to be working properly. here's what i have so far:

buttonSelected = "about";

if ( buttonSelected == "about" )
gotoandplay(3); //do something

this doesnt seem to be working. the instance always returns false. currently i have some buttons and when you click on the "about" button, it stores the string in the variable buttonSelected. when any of the buttons are selected, i want it to play an animation (the same animation for all the buttons), then go to the appropriate fame. does it make a difference how/where/when the variables are created? thanks

Dataset Compare
Hi All,

I want to compare two dataset and retriece the values according to the condition.

Problem, is two datasets are of different length and approx 2000 rows in each.

Can anybody give a sampel code to get rid of this problem,
Thanks,
Srigiri

Compare Arrays
Hey..

I use this code to search for all the MovieClips on the stage
and I can check for specific MovieClips and then assign actions.

ActionScript Code:
function sortStage(mc:MovieClip){
    for(i in mc){
        var mcArray = mc[i];
        if(typeof (mcArray) == "movieclip"){
// Here I can check if the current MC is the "usa_mc"
// This assigns the actions below to the usa_mc
            if(mcArray == _level0.map_mc.usa_mc){
            mcArray._alpha = 30;
            mcArray.onRollOver = over;
            mcArray.onRollOut = out;
            mcArray.onRelease = hit;
            }
        }
    }
}


how ever I wanna check if the "mcArray" equals to a entry in another Array.. like:

ActionScript Code:
var activeArray:Array = [_level0.map_mc.usa_mc, _level0.map_mc.sweden_mc, _level0.map_mc.uk_mc];
 
function sortStage(mc:MovieClip){
    for(i in mc){
        var mcArray = mc[i];
        if(typeof (mcArray) == "movieclip"){
// I wanna assign the actions to ALL OF the entries of "activeArray".
// This code below fails of course.. how can I achieve this though=?
            if(mcArray == activeArray){
            mcArray._alpha = 30;
            mcArray.onRollOver = over;
            mcArray.onRollOut = out;
            mcArray.onRelease = hit;
            }
        }
       
    }
}


How do I check ONE entry at the time and not compare the complete Array,
since when

ActionScript Code:
if(mcArray == activeArray){
 // [i]mcArray [/i]spits out ONE mc at the time but [i]activeArray [/i]spits out all entries at once.
}



Can anyone point me into some help?

Is it clear what I´m trying to achieve?

Compare 2 XMLs
Hi

Is there any way in ActionScript that I could compare 2 XML having same structures for same values?
For Example :

There 2 XMLs (say A,B)

A :

<Test>
<TestForm name="Wiki">
<Version id='123'/>
<Version id='124'/>
</TestForm>
<TestForm name="Web">
<Version id='123'/>
<Version id='124'/>
</TestForm>
</Test>

B :

<Test>
<TestForm name="Wiki">
<Version id='123'/>
<Version id='128'/>
</TestForm>
<TestForm name="Web">
<Version id='129'/>
</TestForm>
</Test>


We compare these 2 xmls and generate a new XML which is a intersection of the above 2.

Result:

<Test>
<TestForm name="Wiki">
<Version id='123'/>
</TestForm>
</Test>


Could anyone help me in this?

Thanks in advance
Daisy

Compare Arrays
Is this possible?...I have two arrays. Array A, that contains 3 elements(a,b,c) and Array B that contains 3 elements(1,2,3). I want to make a conditional statement that compares the two arrays.

if (ArrayA == ArrayB) { //where the corresponding elements values are equal.

In other words...
a=1
b=2
c=3
All 3 elements in the Array match and will return "true".

I am trying to compare the _x and _y positions of multiple objects as in a jigsaw puzzle, upon completion. :?

Date Compare
How would I, using the getDate function or otherwise, compare today's date with an expiration date set within the script... Once the expiration date is reached, a certain event occurs. But before that time, another event would occur. Perhaps the best way to accomplish this is not with the getDate function, so your suggestions are welcome. Thanks!

Compare String Into Array
how can a compare a string to the same string in my Array to know is position


Thx
Eric

Compare Values And Sort
I have a multiple choice type of quiz set up where the user ranks items based on their importance. So, each time the user ranks an item over another, it gets a point. I have this set up just fine. At the end of the quiz I have 9 variables, all with different values. How can I sort them according to their value from high to low (keep in mind some may have the same value). Any ideas?

How Does Flash MX Video Compare?
Hi there,
Does anyone have any views on how using Flash MX video compares with other options like Quicktime?

Compare These Optimization Alternatives
Hi All-

I've learned the hard way that files with embedded sounds are ridiculously large. Sooo, I've learned a couple of alternatives to load external sound, which I will list below. Here are my questions for the experts in the group:

1) Which method listed below is best to link to load external mp3s?
2) Will I be better served for progressive downloads if I create a pre-loader with a movie placeholder that loads the movie externally, or have the pre-loader in the same swf?
3) Should I create a preloader that loads that an external movie (movie#1) and should movie #1 load movie #2 with the sound file?

I would greatly differing opinions! Thanks so much!

Here are the options for external:

I have read about two different methods to load an external swf file -

1) Create a new swf with only the sound clip in it. Load it into the new movie using loadMovieNum.
2) Create an empty symbol and load external mp3 via mysound.loadSound("somesong.mp3", true)

[F9] How To Compare Two Dates (and Time)?
Hi ,
How do i compare two dates to know which one is later?

Thanks

Datagrid Matching/Compare Help
i've been searching and trying for weeks on how to compare values of two seperate datagrids.

for example lets say i have a datagrid named mg_dg like this:

PHP Code:




var myDP:Array = new Array ();
myDP.addItem ({id:1, firstName:"firstName_1", lastName:"lastName_1"});
myDP.addItem ({id:2, firstName:"firstName_2", lastName:"lastName_2"});
myDP.addItem ({id:3, firstName:"firstName_3", lastName:"lastName_3"});
myDP.addItem ({id:4, firstName:"firstName_4", lastName:"lastName_4"});
my_dg.dataProvider = myDP;







let say i have another datagrid named mg_dg2 like this:


PHP Code:




var myDP2:Array = new Array ();
myDP2.addItem ({id:1, firstName:"firstName_1", lastName:"lastName_1"});
myDP2.addItem ({id:2, firstName:"firstName_2", lastName:"lastName_2"});
myDP2.addItem ({id:3, firstName:"firstName_3", lastName:"lastName_3"});
myDP2.addItem ({id:4, firstName:"firstName_5", lastName:"lastName_5"});
my_dg2.dataProvider = myDP2;







so if you noticed with my_dg2 that the there is firstName_5 and lastName_5 but there is not one in the my_dg datgrid.
if i were to select from my_dg2 firstName_5 and lastName_5...what i'm looking do is something along the lines of this:


PHP Code:




var dgListener:Object = new Object ();
dgListener.cellPress = function (eObj:Object) {
        //if the selected row values from my_dg2 matches any of the row values in my_dg...
        trace("match found");
        else
        trace("no match found");
        //proceed to do something else
};
mg_dg2.addEventListener ("cellPress",dgListener);






so it would output "no match found".


i've even spent countless hours trying to hack this out:
http://waxjelly.wordpress.com/2006/0...t-flash-as-20/

this is sorta what i'd like to accomplish but not in the sense of using a textinput component.
it filters the datagrid of the text typed into the textinput component.


any help on how to achieve these results or could come up with a better more intuitive solution to this will greatly be appreciated.
thank you

Compare Array Index
i have two arrays with the same number of index items. the first array contains buttons i have on stage, and the second array contains MovieClips.

i have a function that sets a variable called "activeButton" equal to the last clicked button in the menu.

what i want to do is animate the MovieClip which is contained in the same index of the second array as the currently "activeButton". for example: activeButton = company_btn. the index of company_btn in my first array is [2]. i want to animate the MovieClip in the second array with the index of [2].

is there a way to compare the equality of an index between two arrays? or do i have to get clever with some variables.

thanks
kurt

Length Of Array Value Compare
Hi all

I've got 5 arrays and during the flash movie each array can be assigned different "points" changing the array .length

At the end I want to get the array with the longest length and then I can set the result.

Any ideas??

Thanks
Tom

String Compare Problem
Code:
v2="city";

nextProjectArr=[
[["city"],["a", "b", "c", "d"]]
];


for (i=0;i<nextProjectArr.length;i++) {
trace(nextProjectArr[i][0]);//shows city
trace("v2 is "+v2);//shows city

if (nextProjectArr[i][0] == v2) {
trace("v2 "+v2);
}
else trace("no");// shows no
}
Why would if (nextProjectArr[i][0] == v2) trace 'no' instead of 'city' ???

thx

Compare Values In Arrays
I have two Arrays. One that is a complete list of content that needs to be played. Another is an Array of content that should be filtered. I want to remove elements in the masterPlay if it's company name is == the company in the filtered array.

Is that possible?

For Loop To Compare Arrays
I'm trying to compare my two arrays, so I can create an if statement to say how many numbers have been compared. Any ideas? Here's my code


Code:
import uk.ac.uwe.multimedia.lottery.LotteryDraw;

import flash.text.TextField;
import flash.text.TextFormat;

var lottoDraw:LotteryDraw = new LotteryDraw();

lottoDraw.chooseNumbers();

var everyBall:Array = new Array();

var userInput:Array = new Array();



for(var i:int = 0; i< 6 ; i++) // creates numbers up until it has reached 6 numbers created

everyBall.push(lottoDraw.getNumber(i)) //run function getNumber for variable lotto

everyBall.sort(Array.NUMERIC); // puts the random numbers in numerical order

everyBall.push(lottoDraw.getNumber(6)); // bonus ball - has to be separate from other numbers
trace("The Lottery numbers are: " + everyBall); // makes the text appear
The rest of my code is jsut to do with text boxes and such.

Thanks for any help!!

Randomize An Array And Compare
I need help!!!

I want to create a multidimensional array that holds recipe names and ingredients and then I need to randomize a recipe name out of the array and compare it to ingredients entered interactively.

Large Array(recipe array)

NameIngredientingredientingredient
NameIngredientIngredientIngredient
NameIngredientIngredientIngredient



I want each element in the large array to be it’s own array and to be selected randomly . Then I want to compare the ingredients in that array to a list of ingredients entered interactively and check for equality

MyArray = = List

Finally I want that array element to not be used again...and then loop the recipe array again until it reaches X amount of times and stops.

Please help Me..... I'm new to this

Quickest Way To Compare Variables
i need to compare say, 10 variables (numbers) to find out which are within 600 of each other... any ideas???
i have tried

Code:
if(var1-var2<600) {
}
for each value...
but that was really bad

Math: Compare Value Of An Expression Without + Or -
Hi there,
from math class I remember a way to compare just the value of an expression, so that -1==+1 would compare as equal. How do I write this in actionscript? somebody who knows about other programming languages told me about using the pipe sign "|" around the expression but that doesn't work in actionscript.

thanks in advance,

Compare SWiSH To MX 2004
hi im totally new here and I have no idea really how to use flash but I want to soo bad so anyways

if it's possible can someway tell me how flash is kinda the same as SWiSH? so i can get a better idea of how to use it...(sorry if i sound demanding)

and

How To use Flash MX 2004 Professional tut's? anybody know where i can see some? -thanks

well gotta jet...bye thanks a lot

Dynamic Text Compare
Im trying to fix some kind of quiz thingy, but I get stuck on looking whats in a dynamicly loaded text area.

So, i have a dynamic textfield that gets its content from a php file.
Now I am trying to "read that textbox" and pass the readed text to use within some other function.

basicly i mean something like this:
dyn loaded text
read dyn loaded text
if dyn loaded text == "something"
nextFrame();

if someone knows how, plz let me know how
Thx allready

Compare Non Dyamic Objects
Anyone know a good way to filter an array of non dynamic objects using an object as a key? So I have a Tom object and I want to find all the people objects in an array of people that matches the Tom object. Match them based on public properties of the object.

I need some way to compare object properties to each other, but I can't seem to use a for in loop because the objects aren't dynamic it's a custom class with public properties set in the constructor.

I'm guessing I would need to use describeType, with something like Fuzzy Match does (http://www.kirupa.com/forum/showthre...ompare+objects). Just can't seem to wrap my head around it. If anyone has any insight into a method of doing this I would be very grateful.

Thanks!

Jesse

Datagrid Matching/Compare Help
i've been searching and trying for weeks on how to compare values of two seperate datagrids.

for example lets say i have a datagrid named mg_dg like this:

PHP Code:



var myDP:Array = new Array ();
myDP.addItem ({id:1, firstName:"firstName_1", lastName:"lastName_1"});
myDP.addItem ({id:2, firstName:"firstName_2", lastName:"lastName_2"});
myDP.addItem ({id:3, firstName:"firstName_3", lastName:"lastName_3"});
myDP.addItem ({id:4, firstName:"firstName_4", lastName:"lastName_4"});
my_dg.dataProvider = myDP; 




let say i have another datagrid named mg_dg2 like this:


PHP Code:



var myDP2:Array = new Array ();
myDP2.addItem ({id:1, firstName:"firstName_1", lastName:"lastName_1"});
myDP2.addItem ({id:2, firstName:"firstName_2", lastName:"lastName_2"});
myDP2.addItem ({id:3, firstName:"firstName_3", lastName:"lastName_3"});
myDP2.addItem ({id:4, firstName:"firstName_5", lastName:"lastName_5"});
my_dg2.dataProvider = myDP2; 




so if you noticed with my_dg2 that the there is firstName_5 and lastName_5 but there is not one in the my_dg datgrid.
if i were to select from my_dg2 firstName_5 and lastName_5...what i'm looking do is something along the lines of this:


PHP Code:



var dgListener:Object = new Object ();
dgListener.cellPress = function (eObj:Object) {
        //if the selected row values from my_dg2 matches any of the row values in my_dg...
        trace("match found");
        else
        trace("no match found");
        //proceed to do something else
};
mg_dg2.addEventListener ("cellPress",dgListener); 




so it would output "no match found".


i've even spent countless hours trying to hack this out:
http://waxjelly.wordpress.com/2006/0...t-flash-as-20/

this is sorta what i'd like to accomplish but not in the sense of using a textinput component.
it filters the datagrid of the text typed into the textinput component.


any help on how to achieve these results or could come up with a better more intuitive solution to this will greatly be appreciated.
thank you

Compare An Instance To Itself In Its Own Method?
How can I compare an instance, in this case in an array (eg myInstances[3]) to check whether it is itself in its own method.

Example (This is what I've been trying that hasnt been working):

Parent

Code:
myArray[i] = new Class;

...

myArray[j].checkSelf( myArray[i] );
Class

Code:
function checkSelf( a_instance ) : Boolean
{
if( a_instance == this ) return true;
}

Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp

Compare 2 Values In If Statement
hi

whats wrong here?


Code:

if (_root.txt_1_a == _root.section_btn){
trace("match");
}
trace(_root.txt_1_a);
trace(_root.section_btn);
the output is:

item_1
item_1

but if I do it like this it does work..


Code:

if ("item_1" == "item_1"){
trace("match");
}
trace(_root.txt_1_a);
trace(_root.section_btn);

the output it this:

match
item_1
item_1

Compare SWiSH To MX 2004
hi im totally new here and I have no idea really how to use flash but I want to soo bad so anyways

if it's possible can someway tell me how flash is kinda the same as SWiSH? so i can get a better idea of how to use it...(sorry if i sound demanding)

and

How To use Flash MX 2004 Professional tut's? anybody know where i can see some? -thanks

well gotta jet...bye thanks a lot

Dynamic Text Compare
Im trying to fix some kind of quiz thingy, but I get stuck on looking whats in a dynamicly loaded text area.

So, i have a dynamic textfield that gets its content from a php file.
Now I am trying to "read that textbox" and pass the readed text to use within some other function.

basicly i mean something like this:
dyn loaded text
read dyn loaded text
if dyn loaded text == "something"
nextFrame();

if someone knows how, plz let me know how
Thx allready

Datagrid Matching/Compare Help
i've been searching and trying for weeks on how to compare values of two seperate datagrids.

for example lets say i have a datagrid named mg_dg like this:

PHP Code:

var myDP:Array = new Array ();
myDP.addItem ({id:1, firstName:"firstName_1", lastName:"lastName_1"});
myDP.addItem ({id:2, firstName:"firstName_2", lastName:"lastName_2"});
myDP.addItem ({id:3, firstName:"firstName_3", lastName:"lastName_3"});
myDP.addItem ({id:4, firstName:"firstName_4", lastName:"lastName_4"});
my_dg.dataProvider = myDP;


let say i have another datagrid named mg_dg2 like this:


PHP Code:

var myDP2:Array = new Array ();
myDP2.addItem ({id:1, firstName:"firstName_1", lastName:"lastName_1"});
myDP2.addItem ({id:2, firstName:"firstName_2", lastName:"lastName_2"});
myDP2.addItem ({id:3, firstName:"firstName_3", lastName:"lastName_3"});
myDP2.addItem ({id:4, firstName:"firstName_5", lastName:"lastName_5"});
my_dg2.dataProvider = myDP2;


so if you noticed with my_dg2 that the there is firstName_5 and lastName_5 but there is not one in the my_dg datgrid.
if i were to select from my_dg2 firstName_5 and lastName_5...what i'm looking do is something along the lines of this:


PHP Code:

var dgListener:Object = new Object ();
dgListener.cellPress = function (eObj:Object) {
        //if the selected row values from my_dg2 matches any of the row values in my_dg...
        trace("match found");
        else
        trace("no match found");
        //proceed to do something else
};
mg_dg2.addEventListener ("cellPress",dgListener);


so it would output "no match found".


i've even spent countless hours trying to hack this out:
http://waxjelly.wordpress.com/2006/0...t-flash-as-20/

this is sorta what i'd like to accomplish but not in the sense of using a textinput component.
it filters the datagrid of the text typed into the textinput component.


any help on how to achieve these results or could come up with a better more intuitive solution to this will greatly be appreciated.
thank you

DATE COMPARE FROM XML REVISITED
Hi:

I am having the same problem as the one in thread250-791975. There was no answer posted then and I wonder if someone could give me a quick help.

I am extracting a date from an XML node in the form of: 2004,7,29. When I tried to convert it to date using the format below I get an "Invalid date" error:
         x=new Date(myxmlnode)
But if I use a literal format like this, I have no error:
         y=new Date(2004,7,29)  // yields the date

Also, when I trace myxmlnode, it yields the right output:       2004,7,29

I need to use that to determine the number of weeks between that date and the current date. Please help!

Array Data Compare HELP
I generate a total list of words from different arrays. The user can then toggle these listed words on and off. Doing so either adds/deletes them to a new specific users array.

My issue comes from when I regenerate the total list. I'd like it to compare values with the specific users array and toggle the words on/off as the user had previously selected.


I can trace the new array, and the values I need to "highlight", but I'm getting lost as to how to regenerate my list and compare all the different values in the list.

In the main loop (the complete list of words) I've tried to set up a temp value of the current word :

Code:
var tempValue:String = new String (largeArray[i]);
Then run a smaller loop of the shorter "new" list specific to the user:

Code:

for (var i:Number=0; i<newUserArray.length;i++){
if(tempValue == newUserArray[i]){
trace("I'm in the array");
} else {
trace("I'm not in the array");
}
}
...but I get nothing but "resource" errors.

Compare SetPixel32 And GetPixel32
Alright I'm frustrated because I know the answer is simple.

alright, so I have a bitmap data object. I am setting pixel with setPixel23. I want to check a pixel I have already set to see what color I set it to.


ActionScript Code:
var colorWhite:Number = 0xFFFFFFFF;
bd.setPixel32(x, y, colorWhite);
if(bd.getPixel32(x, y) == colorWhite){
    trace("success");
}


why doesn't this comparison work, and what is the correct way to compare?

thanks

Compare Date Objects
I need to know the best way to compare two date objects. Say I have a Date instance that contains the current date and I compare it to another one to figure out whether it's in the past or future. I obviously can't simply compare them with a ">" or "<" operator.

This is probably a no-brainer but I never had to do this before since I usually do all of my date stuff on the server.

Thanks for your advise.

Copyright © 2005-08 www.BigResource.com, All rights reserved