ActionScript 2.0 :: Use An Array To Match Up With A Variable From An .asp Page
Jul 14, 2004
i'm trying to use an array to match up with a variable from an .asp page.. that is, i want to load a particular .swf file based on that returned variable.I'm not sure that loadMovie even supports this kind of tomfoolery...
Code:
var swfs2Load=new Array("sin.swf","flirt.swf","entertainment.swf","dizzyfunk.swf","aura.swf","privilege.swf","envy.swf");
function dayTest(){
_root.maincontent_mc.loadMovie(swfs2Load[getData.day])[code].....
i'm trying to use an array to match up with a variable from an .asp page.. that is, i want to load a particular .swf file based on that returned variable.I'm not sure that loadMovie even supports this kind of tomfoolery... anybody out there who be's smarter than me know?
Code: var swfs2Load=new Array("sin.swf","flirt.swf","entertainment.swf","dizzyfunk.swf","aura.swf","privilege.swf","envy.swf"); function dayTest(){ _root.maincontent_mc.loadMovie(swfs2Load[getData.day]) } getData = new LoadVars(); getData.load("whatday.asp", getData, "GET");
I have two arrays. One contains numbers and the other contains strings. I want to do a sortOn(DECENDING) for the number array and then have the string array sort to match. if my string array is
I want to make a mail script. The user will enter the recipient's name, which is linked to variable "name". I've got a variable, EMAILA which is ActionScript Code: var EMAILA { Cem : "cemgokmen97@gmail.com", Muhittin : "gokmen@itu.edu.tr" }
And on the SEND button, I have this code : ActionScript Code: on(release){ if(name){ getURL('mailto:'EMAILA[name] }}
But for some reason when the mail client opens, the address does not appear in the "To" box.
If you have an array with six numbers, say: public var check:Array = new Array[10,12,5,11,9,4]; or public var check:Array = new Array[10,10,5,11,9,4]; How do you check for a match (of a pair?)
Code: var s:String = '%include %unquote(&open.gtestit&close);'; var re:RegExp = /([%&]?w+)/g; var a:Array = s.match(re); trace(a.join(' '));
I'm splitting the string up into words (w) where the word might have an optional % or & in front of it. The output is what I expect:
Code: %include %unquote &open gtestit &close
Is there a way to get the index of each matched string in one call? I know I can walk the original string using the resulting array and get indexes, but was hoping there was something similar to MATCH(). Something like:
I am using a dictionary variable to match up a drop and drag exercice.
var dict = new Dictionary (); dict[box_a]=s1; dict[box_b]=s2; dict[box_c]=s3; dict[box_d]=s4;
question 1: at the end i would like to check if box_a== with s1 and so on .... how would I do that
for each( var item in dict) { item.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); item.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);[code]....
question 2:I would like box_d to accept also s3 how would i do that if i do
dict[box_d]=s4; and dict[box_d]=s3; it wont work because it matches it with the last equal.
[code]I want to input a number and find a match for the number, returning the values on the row in to specific fields for each number. For example, if I input the number 10 in an input field, I want the number 1.2276, 0.00100, 106.38 and the rest of that row to output these values I have seen so many options, don't know where to start.
How to compare a string with strings inside an array for a match? I have a file in which each sentence (or word) (generally string) is present in a new line. Opened the file and read the contents to a string.
Code: private function readHandler(event:Event):void{ _str = _readStream.readUTFBytes(_readStream.bytesAvailable); _strArray = _str.split(" "); //contains each string that appears in a new line _length = _strArray.length; [Code] .....
But this doesn't work. Seems like if(_input == _strArray[i]) never gets executed even if they are equal. What might be the problem. Is there some better way to so it?
I'm stuck on this tutorial trying to learn how arrays functions. My task is to declare a variable, write an array, loop through the array and output the match in a textfield already created on stage. This code does that, but it gives me the match in number, instead of writing the name I get the number from the array, 2. How can I get the textfield to display the name Stian?
var bestevenn:String = 'Stian' var mineVenner:Array= new Array();mineVenner[0]='Janne';mineVenner[1]='Liv';mineVenner[2]='Stian';mineVenner[3]='Henri
I'm trying to login to a password protected php page through a form in flash.When the user provides correct information the flashmovie opens a php-page, but how do I protect the php page from unautorized accesses?Can I send a variable containing the user/pass given?but then everyone who checks history can access the page without even having to access the flash page..
Let's say I have array foo and a positive integer y, where foo.length > y.I want to remove elements from foo so that foo.length becomes y (or very close to it).Also, I need to preserve the first and last element of foo. The indices of the removed elements must be spaced apart as equally as possible. Foo can be sliced, or it can be used to create a new array.
Example: if foo = [a,b,c,d,e,f,g,1,2,3,4,5] and y = 6, then trimmedfoo could be [a,c,e,g,2,4,5] or maybe [a,c,e,2,4,5], but not [a,c,e,g,2,4] because the last element of foo is missing.
I'm going to post the full code of the two functions, disregard the "fluff" unrelated to the two functions as it is all working flawless, I've tested this HEAVILY and cannot understand why it keeps setting the entire array to undefined!
Code: // processReplace Function function processReplace(transferFiles) { var processArray:Array = transferFiles.slice();
[Code]....
Basically it's supposed to check to see if the file exists and return as true if it does and add it to a replace array, then the replace array is processed into a single string and put into a dialog box through the flash wrapper prompting them to "replace the files or not".
It makes the replace array just fine, it actually even has the right "count" in it but it's setting all the "filenames" to undefined because of the exists = processSearch function.
I even tried to make a new array and run the search just from that one and set the values from the old one and it's still failing.
Is it because of the "break" or can anyone figure it out? Iknow it's hard because you can't use the code
I want to change the value of a variable listed in an array using the array. for example:
Code: var theVariable:Number = 15; var theArray:Array = [theVariable]; now if I try this
Code:
theArray[0] = 20;
I just get an array with 1 value of 20 in it and it no longer references theVariable what i want to do is change the value of theVariable with out removing it from the array but referencing it from the array in a loop or something.
i'm trying to build a flash site and ran into a problem... i have a gallery page with a bunch of page numbers at the top. when you click on one, a movieclip loads of some images coming in.so the problem i'm having is that i made a little animation for when you roll the mouse over the page number (they scale up when the mouse is over, scale back when the cursor moves away)... what it's doing is when you roll over, it goes to a certain frame in the timeline and plays that animation.that's all working cool, but i need it to not do that once it's clicked on. so basically when you actually click on a page number, the over script should stop until you go to another page... here's the code i've written,
function over(event:MouseEvent):void { this.gotoAndPlay(30);} function out(event:MouseEvent):void {[code].....
I have created a video player interface which loads external flv's. Now I'd like to integrate this into a live site, a site that I have not built myself.
There will be a list of clips on the page, the list is taken from a mySql database and displayed with info, a thumbnail and a link. When you click the link, a popup window is supposed to be launched and in it the video clip will be played inside my player.
How do I get the "i" in the "onRelease" function to match with the "i" in another array? When I click the "ch_mc" button, the aVar array all returns "0".
nor = new Array(); nor[0] = a_mc; nor[1] = b_mc; nor[2] = c_mc;
I've got a flash course that needs to pass the current screen number from the course to the mySQL database. The person who built the back-end built a php page that I can pass the number to and it will get written to the db but I'm not sure how to "send" that in the background.He told me that I just need to call the index.php page like: [URL]So, would I use URLRequest for something like that?
Code: var vars:URLVariables = new URLVariables(); vars.theData = data; var req:URLRequest = new URLRequest("www.url.com/index.php/user/bookmark/"+slideNum);
I am trying to call an aspx page, have it hit the database, and return a string of text to my actionscript.
Here is my actionscript code:
It crashed on the line 'gameText = urlLoader.data.theText;' with the error of 'Error #1010: A term is undefined and has no properties.' so i guess urlLoader.data.theText is coming back null.
Here is my .aspx page code:
When I run the .aspx page separately, it returns what I want it to: '&theText=This is my test text'. I think I may be missing the big picture here somewhere.
I went to pass a variable to an ASP page, the ASP will filter a recordset based on that value. I want the results of that filter to be passed back to my Flash page. I am, of course, using LoadVars() in the following way:
Code: getserver="[URL]"; formdata = new loadVars(); formdata.SRV_NM=GA016DBB;//this is the variable I want to pass to my asp page for filtering replydata= new LoadVars(); //this next section may be my problem if(replydata.onload){ trace("yes!"); formdata.sendAndLoad(getserver, replydata, "POST"); } else { trace("no"); }}
here's another one about passing data to an asp page. I'm trying to pass a variable through a string to an asp page. I cannot understand why this is not working. Here is my code:
this.btn1.onRelease = function (){loadVariables("http://www.mywebsite.com/paragonstats/flashprogress.asp?pagename=introduction","POST"); }
If I paste my url in a browser, it triggers the asp page as it should. But this code is not working from flash. If I use getURL, it works, but it opens another browser window or redirects my movie. I'm just trying to track click through statistics. I've even set up a movie with just one button on the root with this code and it won't work.
I am trying to set up a form in a flash movie that will post the users entry to a php page. I then need the php page to re-direct the user to a page to show a result.
I have the following AS in the flash form. It seems to post to the php page but from within the flash movie. Rather than taking them to the php page, as a non-flash form post would.
on (release) { loadVariablesNum("search.php", 0, "POST"); }
Is there a way I can get the flash form to post to the php page in the same way a non-flash form would post.
Hope this makes sense! Basically, when the user clicks the submit button, I need the browser to load another php page that gets the user's input via post.
[Flash MX 2004] Anyone noe how to send a variable value from flash to a php page? I have a score's value which I need to send it to the php page n update into the database.
I have a sliding, drop down menu sidebar thingy. The user clicks a button and my slick little eye candy flash movie has a secondary navigation list slide down while any buttons underneath slide down as well. Then when you click on another button it slides back up and the new button's secondary nav slides down. nuff said.what I would like to have happen is that when a user clicks on a secondary nav button and a new html page loads, I would like it to appear that the secondary nav slider has stayed down on the newly loaded html page.this means passing some kind of variable to my flash movie so that it can tell which page the user is on and react (go to a particular frame)