Making A List And Checking It.
I'm making a simple Memory game, and I've gotten so far as too make a script that dumps 20 cards on the scene. Every two cards must be associated with a picture, so I made ten frames within the card.
The problem is that I must make sure only two cards per picture are choosen, and to do that I need some kind of list that says which cards or numbers already have been picked. Any ideas?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 04-18-2007, 11:47 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
List Checking
i would like to write a conditional actionscript to find whether x is one of the value in the members of a certain list. according to the result (1/0) , i will call diff lines of actions
for example, i set
list=[12,13,19,40,80]
now i want to check
if
x= one of [12,13,19,40,80]
then run:
task1()
if
x!= one of [12,13,19,40,80]
then run:
task2()
how should i work out the conditional scripts
Thanks for your attention!
Checking Display List
what is the best method to check if a certain object is on the display list ?
Thanks for any advice.
Checking If An Object Is On The Display List.
Is there a way to check if an object is on a display list?
I have a display object container and it has children. When I remove the display object container, I want to have the child check if it's parent exists then have it remove itself.
Checking Existence Of Item In List?
Hello there!
I try to solve a - probably quite simple - problem. At least I hope that this can be achieved rather simple:
The problem concerns the List Component. How can I check if an item I'd like to add is already part of the list? I'd like to avoid having double entries and if possible would like to check that either through a function that goes through all the items or through a direct command if this is possible (the keys would be the same). Is there a script perhaps somewhere to which someone could point me to?
Many thanks in advance for your time helping me
Artimidor
Checking A List Of Vars For Similar Values ?
This one's a little hard to explain.
here goes...
I have a list of variables imported from a dbase/textfile. Looks something like this:
&title1=blablabtitle&content1=blabcontent&date1=au gust 2002&title2=balbalb&content2=balbalmorecontent&dat e2=march 2003&title3=...&content3=...&date3=august2002&item count=3
Its a list of, let's say 50 items. These items provide content for dynamically generated movieclips on a timeline-like interface.
Some items share a same date (e.g. august 2002). when there's two things in a same month, I need to generate two movieclips that pop out of my timeline...
I need something that tells me:
august 2002 --> 2 items
september 2002 --> 1 item
november 2002 -->3 items
december 2002 --> 1 item
how should I do this / what technique should I use ?
hope this makes a little sense...
thanks
Making A List With MCs
As per an earlier post, I wasn't able to find any way to control the list component as well as I need to. So, I am looking at an alternative, in a way creating my own list using MC.
So, I have a main movie clip on the stage called "mainMC" and inside that I have another movieclip called "textMC" and inside that I have a dynamic textbox named "data".
Now I am pulling data from an XML document and based on that I want to create a list using the above MCs.
Code:
...
count = myXML.firstChild.childNodes[i].childNodes.length;
for(p=0;p<count;p++){
_root[mainMC].duplicateMovieClip("textMC", "text"+p, _root.mainMC.getNextHighestDepth());
//Now I need to adjust the ._y value to move the duplicated MC down each time.
...
So, my duplication isn't even working, and I am not sure how to call the duplicated MC after to move the Y value.
Any assistance would be great!
Making List Of Variables
I am cuurently working on a simply list for a client where you enter you e mail and name and then you can choose from a list of films that you are interested in. The variables/films choosen then becomes the message for to my client. The problem is that I want the variables to be listed after each other on separate lines.
Like so
film1
film2
film3
and so on..
What I am now doing is setting the message variable like this:
message="message"+"film"
This makes a list like so
film1film2film3
So the thing is to make each new variable added on a new row?
How do you do this?
Making An Inventory List
How could I make an inventory list. Such as clicking a button and have it add itself to the inventory, then click a "clear" button to remove it.
I am pretty good with actionscript, but have never tried this before.
Thanks,
Blaine
What Is Your Favorite? ... Making A List
I am trying to create a favorites list. When one clicks on a mc have the value go to a dynamic text field (multiline) – this works. What I need to know is how to add the second selection to the next row. Right now it only shows the last selection, overwriting the previous selection. I tried +newline and /n but it didn’t work.
I also searched the forum for similar, but didn’t come up with much…
_root.favlist = 0; //init dynamic text field var called favlist
orange.onPress = function () { //mc orange
_root.favlist = "orange";
grape.onPress = function () { //mc grape and so on…
_root.favlist = "grape";
I am also open to other ideas... have the first click go to 1. second to 2. and so on for all 5 fruits (or movies, bands,... the list could go on -hee hee)
Thank you,
A
Making A List In Flash
Hi, I have a Flash question I hope someone can help me with.
I am a novice programmer and actionscript user (to say the least) and I was hoping someone could point me in the right direction.
I am making a just for fun kind of site that I will send to just my friends getting them to sign up to play football on Thanksgiving. The idea I want to use is when one of these 12 guys gets to site they can enter their name in a text field acknowledging they want to play and then their name would show up in a list with other guys names. Is this possible in Flash?
I understand that you probably need an external file to store the info and to pull from in Flash, but I am not exactly sure how to do it or the exact code I need. If anyone has time and would be willing to help please let me know.
Thanks in advance...
FF
Making Xml List With Links
I was able to create a list component in Flash 8 and load the items from an
xml file, but I can't figure out how to make each line clickable in order to
work as a link. The code used to populate the list is:
form = new Object();
form.load=xmlConn.trigger();
The xml file is something like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<articles>
<articles_items>
<title>Link text 2
</title>
<urlstring>article2.htm
</urlstring>
</articles_items>
<articles_items>
<title>Link text 1
</title>
<urlstring>article1.htm
</urlstring>
</articles_items>
</articles>
I intended to use the second field of each "articles_items", the "urlstring"
field, to associate with each "title" listing on the list component, so that
when "Link text 1" gets clicked it takes to "article1.htm". The instances
created are named articlesList, xmlConn, articles_ds.
Making A List Of An Array
Hai,
For my work i'm trying to get an Array properly into a text field. The array is being taken out of XML and then turned into the array and fed into a textfield. But it shows up like this:
Name1, Name2, Na
me4, Name4, Name5
But i want it to show up like
Name1
Name2
Name3
Name4
How could I achieve this?
This is my code:
var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
var score, name, time, position;
score = this.firstChild;
if(score.hasChildNodes()) {
var name = new Array();
var time = new Array();
for(var i = 0; i < score.childNodes.length; i++) {
name[i] = score.childNodes[i].childNodes[0].childNodes[0].nodeValue;
time[i] = score.childNodes[i].childNodes[1].childNodes[0].nodeValue;
position = i+1;
//naam_txt.text = position + ": " + name + " -- " + time + " sec."
naam_txt.text = name;
tijd_txt.text = time;
//trace(score.childNodes[i].childNodes[0].childNodes[0]);
//trace(position + ": " + name + " -- " + time + " sec.");
}
}
}
xml.load("tijden.xml");
//xml.load("http://gigakids.nl/files/save.php");
/*var uitslag_array;
var scoren_xml = new XML();
scoren_xml.ignoreWhite = true;
scoren_xml.onLoad = function(succes){
if(succes){
var score = this.firstChild;
var name, time, position;
uitslag_array = scoren.childNodes;
PopulateLists(uistlag_array);
}else{
trace("Dat gaat zo niet goed he!")
}
}
scoren_xml.load("http://gigakids.nl/files/save.php");
PopulateLists = function(xml_array){
naam_txt.text = tijd_txt.text = "";
for (var i=0; i<xml_array.length; i++){
name = score.childNodes[i].childNodes[0].childNodes[0];
time = score.childNodes[i].childNodes[1].childNodes[0];
var ding = xml_array[i].attributes;
naam_txt.text = ding.name + "
"
tijd_txt.text = ding.time + "
"
trace(name + " -- " + time + " sec.");
}
}*/
var uitslag_array
var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
var score, name, time, position;
score = this.firstChild;
uitslag_array = score.childNodes;
if(score.hasChildNodes()) {
for(var i = 0; i < score.childNodes.length; i++) {
var scoren = uitslag_array[i].attributes;
naam_txt.text = scoren.name + "
";
name = score.childNodes[i].childNodes[0].childNodes[0];
time = score.childNodes[i].childNodes[1].childNodes[0];
position = i+1;
naam_txt.text = name
tijd_txt.text = time + " sec."
//naam_txt.text = position + ": " + name + " -- " + time + " sec."
trace(position + ": " + name + " -- " + time + " sec.");
}
}
}
xml.load("http://gigakids.nl/files/save.php");
Thanks in advance for your help!
And yes, i have searched the forum.
Bye!
Making List Component Collapsible
Hello all,
I have a List Component on the stage with a height of 240px. I want to create a button so that when clicked, the height changes to 480px, and if clicked then, it goes back to 240px.
I can do this by just doing:
myList.height = 480;
Easy, right? Now, is it possible to Tween or Animate this change? If I do a motion tween and do a Copy Motion to ActionScript, it scales the component. I couldn't do a shape tween on just the bottom left and right anchor points. I'd like this effect, and as a bonus, easing would be super cool.
Any pointers?!
Making A List From Files In A Folder
Hello all!... it's been a while since i bothered any of you so here's more botherness! :twisted:
I have the first partof this application that records the streaming webcam/audio from the user and it goes to a folder. For the second i need to make one that plays the streams that have been recorded. I know i need a listComponent, but i'm really not sure how to call the items in the folder into the list, and then make them play... any suggestions or ideas?... thanks!
~pako
Making A List Component ._visible = False;
I am trying to make a list component invisible for now by using the following code
tileList._visible = false; //(And later there will be a button that activates it)
And this is the error that it's giving me
1119: Access of possibly undefined property _visible through a reference with static type fl.controls:TileList.
If anyone could help me out that would be awesome Thanks
Making Events Bubble -down- The Display List?
I've read that by default events only bubble to parent DisplayObjects, not children? I'd like to dispatch an event near the base of my application and have it flow down the tree to children of the DisplayObject that dispatched it. Is such a thing possible?
Making A Dinamic List Of Team Members
Hi.
I have to load from a mysql database a full list of members of a team wich must be placed in a drop down menu. How can i make that dinamically? I mean i take the number of members from a php and all their names and display it in a text field. How can i do that? try to create text fields and place one under each other based on the number of members the php sents to me? Or should i try to place all the names in a sigle text field (but then how do i format the names so that they appers under each other)?
Making A List Component Collapsible With Animation
Hello all,
I have a List Component on the stage with a height of 240px. I want to create a button so that when clicked, the height changes to 480px, and if clicked then, it goes back to 240px.
I can do this by just doing:
myList.height = 480;
Easy, right? Now, is it possible to Tween or Animate this change? If I do a motion tween and do a Copy Motion to ActionScript, it scales the component. I couldn't do a shape tween on just the bottom left and right anchor points. I'd like this effect, and as a bonus, easing would be super cool.
Any pointers?!
Making A Sprite Move In Directions From A List In An Array ?
I found myself confused again while experimenting with flashy was hoping you wonderful people may have the answer once again !.
I wanted a sprite to move round on the screen when a play button was pushed. I have a left and a right button which store strings "left" or "right" into the next positions of an empty array called history.
When i push the play button i want i want the sprite to move either left or right according to what commands are in the array. My code just seems to play one single command and then stops when i hit play again it just repeats the same command.
Is there any way to make it play through all commands in the array one after another?
Here's the loop that i was trying to use.
PHP Code:
if (historyPlay == true) { for (var i = 0; i< history.length; i++) { switch (history[i]) { case "left" : if (sprite.facing == "N") { sprite.facing = "W"; } else if (sprite.facing == "W") { sprite.facing = "S"; } else if (sprite.facing == "S") { sprite.facing = "E"; } else if (sprite.facing == "E") { sprite.facing = "N"; } dir = "left" this.moving = true break; case "right" : if (sprite.facing == "N") { sprite.facing = "E"; } else if (sprite.facing == "E") { sprite.facing = "S"; } else if (sprite.facing == "S") { sprite.facing = "W"; } else if (sprite.facing == "W") { sprite.facing = "N"; } dir = "left" this.moving = true break; } } historyPlay = false; }
Thanks in advanced!
Making Automatically Updating "top 10" List
Hi, all,
Hope this is the right forum for this.
I built this Flash-based MP3 player for a client. It runs off of an xml file. It works fine, but, now that my client's work has expanded, he'd like to have an automatically updating "Top Ten" list appear on the main page of his site.
I know that there is a way to post the most-played songs data into the HTML file; my question is, exactly how do I do that? I am fairly new to Flash, but I know a little... I am using Flash MX 2004. I assume that there will have to be some sort of data in the xml file so that the Flash player knows what song was played... And then the Flash player ought to be able to compile the data and post it automatically to the HTML page.
What code do I need, specifically? Exactly where do I put it.
I can provide files/code snippets/ whatever to anyone who needs it. I would really appreciate the help. If it is a super easy thing to do that wouldn't take someone experienced at Flash and the functions I'm talking about long to do... I might be willing to pay for it.
Thanks tons!
Charity
Load Xml Data(list Of Names), Use List As Buttons In Flash Possible?
Hi, basically I have a quiz game that I made, the quiz is done but I want to keep track of how many times a person has failed the quiz. I have an XML file that has a list of names. I want to take those names, put them in a quiz game (at the beginning) as a "list" of some sort and let the user be able to choose their own name (which is of course already in the XML file). This name will be used to keep track of how many times they have tried the quiz.
I have successfully loaded the XML file (names) into an ARRAY in Flash but how can I output them to the screen AND let the user be able to choose those from the list? as a button? This will add the count after they clicked their name to +1 and then save it to somewhere(where is best?). I will attach the zipped files (there are 4, the fla,swf,2 XML files[quiz/names]). If anyone can help me ASAP it would be awesome.
Chnage The Font Of Selected Item Color In A List Mx:List
Hi,am Trying to change the font (bold and color) of a selcted item in List..But it is changing the complete list's font..
Here it is my code..
<mx:List id="businessFunctions" left="10" right="10" bottom="10" top="208"
dataProvider="{processList}"
itemClick="select();"
horizontalScrollPolicy="auto"
labelField="@name"/>
ActionScript COde:
private function select():void
{
businessFunctions.setStyle("textSelectedColor","#D 3E9F5");
businessFunctions.setStyle("fontWeight","bold");
var page:XML = businessFunctions.selectedItem.page[0];
var pageID:String = page.@id;
var processID:String = businessFunctions.selectedItem.@id;
server.submit(pageID, processID, RequestMessage.BEGIN);
}
Here i need toc hange the selected item color only..
Separate The List Items With The Separator And List Is Dynamic
Hi,
I am getting the list items dynamically ,and hv to draw a separator after the every group of list items.For this I have to embed a script function after every group.How can i do this Actionscrip 3.0 Any help?
Ex:
Group 1:
ABC
DEF
GHI
TODO-----Here we need to draw a line
Group 2:
123
456
789
TODO-----Here we need to draw a line
Group 3:
abc
def
ghi
Here I have da code:
for each(var group:XML in event.responseMessage.rawXML.group)
{
var pageSection:PageSection = new PageSection();
pageSection.text = group.@name;
pageContents.addChild(pageSection);
trace("***********Group Name: "+group.@name);
// once the section has been added, iterate through it's children and render each field.
// for each(var field:XML in server.currentPage..field)
for each(var field:XML in group.field)
{
var formElement:FormElement = AppCode.FieldRenderer.renderField(field, pageSection);
/* check for null, if for some reason we encounter an unknown control type
* the formElement will not be instantiated so we should skip over it.
*/
if(formElement != null)
{
/* formElement.field = field;
pageSection.addChild(formElement); */
formElement.setRuleDetails = this;
formElement.communicator = this.communicator;
if(event.responseMessage.pageType == PageType.UPDATE || event.responseMessage.pageType == PageType.ADD )
formElement.readOnly = false;
fieldList.push(formElement);
}
}
//Add Separator b/n groups
TODO...Here we need to call a function which draws a line.....}
Plz help me if u have any idea?
Debug > List Objects + List Variables ...
I am testing my flash movie within the flash application. I go up to the toolbar while testing and select 'Debug > List Variables' and then 'Debug > List Objects'. This displays all the variables and all the objects in the trace window. Fairly straight forward!
What I want to do is access these variables and objects at runtime while viewing my flash movie within the browser. So I can make a text field in my movie and populate it with these variables and objects BUT how do I access these from the flash movie ? There must be a way to get the output from 'Debug > List Variables' and 'Debug > List Objects' at runtime and dump it all into a text field on screen.
Can anyone assist please,
Thanks,
Stephen.
Converting Bulleted List To Numbered List
I'm trying to put out a list of questions for a test. I'm also using a stylesheet to format the way the text is displayed. This is the way the list should look like:
1. question#1 text.............................................. ......
2. question#2 text.............................................. ......
If more than one line of text per question, it continue on the next line indented. The text for each question needs to be looking like a block of text. The same way a bulleted list displays.
This format can be created by using the <ol>, <li> tags in HTML. But Flash doesn't recognize any style formats for the <li> tag. Only a bulleted list is printed out. How can I format that list into a numbered list? or if not how can I create the same output, keeping in mind that I have to use a stylesheet? Thanks.
Debug > List Objects + List Variables ...
I am testing my flash movie within the flash application. I go up to the toolbar while testing and select 'Debug > List Variables' and then 'Debug > List Objects'. This displays all the variables and all the objects in the trace window. Fairly straight forward!
What I want to do is access these variables and objects at runtime while viewing my flash movie within the browser. So I can make a text field in my movie and populate it with these variables and objects BUT how do I access these from the flash movie ? There must be a way to get the output from 'Debug > List Variables' and 'Debug > List Objects' at runtime and dump it all into a text field on screen.
Can anyone assist please,
Thanks,
Stephen.
(Flash MX Or 8) List/List Component Issues
Hello all.
I recently completed Kirupa's "Creating a Listbox" tutorial, (http://www.kirupa.com/developer/mx/listbox.htm) but have been having a difficult time modifying the event attributes of each list item. Basically, I want to click on an item and have an object on the stage move to a unique xy coordinate. I can get the object to move already (object._x = object._x +10, but unfortunately ALL items on the list execute this script command. I've tried fooling around with the code to get each item to do a unique movement but...well, clearly I haven't succeeded yet.
I'm a Flash nooby and help in the form of specifics would be greatly appreciated. If you can provided modified code from the tutorial to move an object to a unique positions that's even better.
Thanks.
David
List Component. Help. Looked Everywhere. Button And List.
Trying to use a list component and a button. When user selects something from list component and clicks button it takes them to new page, if user doesnt select something from list and hits button, (this is where my question lies) I want it to do nothing and setFocus to list component.
Here is how I am going about it now: New if statement (however it still transfers user if nothing is selected from list component) How can I get it to not transfer? I have tried rewritting this many ways, searched all over the nets, and Nada.
Code:
var arUrl:Array=["/browsecategory.aspx?cat=1","/browsecategory.aspx?cat=2","/browsecategory.aspx?cat=3","/browsecategory.aspx?cat=4"];
var provider:Array=[{label:"Option 1",data:0},{label:"Option 2",data:1},{label:"Option 3",data:2},{label:"Option 4",data:3} ];
mcList.dataProvider=provider;
var obj:Object={};
obj.click=function(eo:Object)
{
var count:Number=mcList.selectedItem.data;
getURL(arUrl[count],"_blank");
trace("count="+arUrl[count]);
}
but.mcSubmit.addEventListener("click",obj);/////here is where I am sending off
if(mcList.selectedIndex == undefined) {
setFocus.mcList;
}
So this thing works perfectly, however if user hasnt selected anything how can I get it to not transfer and setFocus?
I have tried setting if to check it for - 1 (since starts at 0) set to 0? Any ideas please help. Thanks in advance MT
'list' Event Of List Component
oops i mean 'change' event of list component
Hi guys/gals. Ive made an xml/list component driven mp3 player as can be viewed at http://www.flashmatics.co.uk/blog/sa...mp3player.html
When someone selects a new song from the list that songs starts to play. Everything is working fine.
I now want to add an extra bit of functionality i.e When one song finishes i want the next song to start playing. But this means I have to tell the list component that a change has occured as well (even though there has been no user interaction to cause this 'change'). How would I go about this. Here is a snippet of relevant code.
Code:
mySound.onSoundComplete = function():Void{
//from here i need to tell the component a change has occured and to move it
//to the next song in the menu
}
//create a listener for the list component
var compListener:Object = new Object();
list_comp.addEventListener("change", compListener);
compListener.change = function(info:Object):Void{
//how do i get this to move to the next track?
}
Thanks for any help in advance. I dont actually need the whole code or anything but rather a point in the right direction..cheers
HELP Symbols List To Text List?
Is there a way to get a list of all the symbols in the library into a text file quickly and easily?
Thanks in advance!
-Ted
Loading XML List Into RMP List Component
I have several XML lists to load into a RMP List Component List Box.
I was told the code should be like:
myButton.onRelease=function(){
myList.load(String(search.text));
}
So I made a button and named the instance "myButton"
Add the list component called "myList"
The XML files are named test1.xml, test2.xml etc.
I tried variations of:
myButton.onRelease=function(){
myList.load(String(test1.xml));
}
Result....
Nota
I think I may need a Listener or I am not sure...
Can anybody please advise me what I am doing incorrectly?
List's "CellRenderer_upSkin" Displays In List Items (BUG?)
Hi Everyone,
I'm having a huge issue with with the CellRenderer_upSkin displaying on the a list component's items:
http://www.davestewart.co.uk/temp/combobox.gif
It's supposed to display a border round the entire list, but bizarrely, it's also used for each of the list elements... so effective end result is that the up state has a huge border.
I'm sure this shouldn't be happening. Has anyone else seen this behaviour?
This is my first production job using AS3, and I'm falling at the first hurdle which is very annoying.
Cheers for any help,
Dave
List Box To Control A List Box
hi guys and gals...here is my doubt...
// Sets the change handler for the Component named 'dropDown'.
listBox.setChangeHandler("SelectItem");
}
// This is the Change handler it tells the the movie what to do when someone clicks on an item.
function SelectItem(){
DataBox= listBox.getSelectedItem().data;
}
the above code is for the listbox change handler to display the code of an item whose clicked in the listbox.....heres what i want to do ....i want this item which is clicked to again query the msaccess database and return results from another table into a second listbox......
for eg...when blue is clikced in a listbox1..it should return types of blue in a second listbox2....pls help me to achieve this ......
thanx in advance
Making A Grid And Making It Mask Images
Hey guys,
I have this code below and i am trying to make each of these movie clips dynamically mask an image. For some reason it still does not work. I can get the grid to come out correctly but the masking is suspect. Any help would be very much appreciated. Thank you
num=0;
for (i=0; i<12; i++){
for (j=0; j<45; j++){
this.createEmptyMovieClip("a"+num, num)
this.createEmptyMovieClip("b"+num, num+1)
//trace(num);
//trace("IMAGE DEPTH: " + this["b"+num].getDepth());
this["a"+num].attachMovie("thelinked", "thelinked2", num);
this["b"+num].attachMovie("thelinkedimage", "thelinkedimage2", num+1);
mc=this["a"+num]["thelinked2"];
image=this["b"+num]["thelinkedimage2"];
mc._x=i*12;
mc._y=j*12;
image._x=i*12;
image._y=j*12;
image.setMask(mc);
num++;
}
}
Checking The URL
My good friend Benjamin Crebo my programming buddy o' pal would like to ask you good folks at flashkit how you check the URL from a flash movie, probably to check wether its in the right place on the server incase someone downloads it and tries to nick it.
Thanks
Jim
Checking For NaN
Hi,
I would like to check whether a variable contains a number. I thought I could do it like this:
Code:
myString = "123abc";
if(Number(myString) == Number.NaN)
trace("not a number");
however that doesn't work. I've tried various methods. Frustratingly, even if 'trace(Number(mystring))' returns 'NaN', the if statement still doesn't work.
Anyone know how to do this???
thx - n.
Checking Url By PHP
Hi,
I am tryingto check the url of my swf which is embeded in a HTML as following:
Code:
$referer = getenv("HTTP_REFERER");
print "&myVar=".$referer;
In flash, I have a var call myVar but it doesn't appear any change when the PHP have run.
Does anyone know what's wrong is it?
URL(10kb):
http://ddlam2.uhome.net/trying/send.html
Checking In
Went to [Getting Started] and all I could find was Fsh4.
Looking for good beginner tuts for Fsh5
Tnx
Checking
Yeah, as above. At the beginning of your root movie set _level0.loaded=0; In your movie loading in on level1 on the first frames set up a loop with the main script -
_level1.loadedBytes = _level1.getBytesLoaded();
_level1.totalBytes = _level1.getBytesTotal();
if (_level1.loadedBytes<_level1.totalbytes) {
gotoAndPlay ("loop");
} else {
_level0.loaded=1;
stop();
}
where loop is the label for the previous frame. This will return the variable _level0.loaded to 1 when the movie has loaded. Obviously your button script will probably read
on(release){
if (_level0.loaded==0){
loadMovie("movie",1);}
}
This will only load the movie if it has not been entirely loaded already.
I'm not sure exactly what your trying to do, you might have to take the stop(); out if you want your loaded movie to play and replace it with a gotoAndPlay
Anyway...Hopefully, this will point you in the right direction and you can work the rest out for youself .
Let me know if you have any probs.
Al.
Checking A URL
does anyone know of a way to check if a URL exists? Kind of like checking if a movie clip exists by putting:
if (movieClip){
//this code will execute as long is movieClip exists
}
only with a URL instead of an object or variable?
Checking For An Ace
I have an insurance button so that if the dealers first showing card is an ace then they have an insurance option.
The problem is its working so that if the dealers first 2 cards are on the table (ones showing, ones not) then the insurance button will show. Ive tried loads of variations and cant get it to check for just the one card. My actionscript knowledge isnt the best so its proberly just me being thick.
The insurance code is under function 'checkForBlackJack' and the buttons alpha is set to 0 under function 'initHand' both in the first frame of the movie
Can any one help
Checking For The Least Value?
Hello,
I've got few variables I'd like to check the value of, then depending on which one is the least value, do an action.
In other words I've got like
_root.distance1
_root.distance2
_root.distance3
_root.distance4
_root.distance5
and depending on which one is closest (lowest), that object would react. But my question is really just how do I check the value (some sort of array??) and then how do I tell it to do something (just a simple goto will be fine) depending on which one is closest?
Thanks!
Checking When Going Below 10
Hello,
I am making another program for my class to use, helping their subtraction.
I have a spinner which produces a number, then they click a button to multiply it to another. The product is then taken away from 501 (bit like darts). And this all works really well and has no problems.
However, how can I get the program to stop and celebrate when the falling number (501) gets to 10 or below?
Help please!!!
Cheers
Chris
Checking For...
I was wondering how you would check during a hittest to see if what your hitting has a certain variable atatched to it.
Say, occasionally when I hit the mc "bob" he's happy, so bob.happy = true. but some time he's not, so bob.happy = false
How would I check for this during a hittest?
Am I being clear enough?
Keep Checking For A Var?
I’m looking for a way for my Flash movie to look for a var sent from my html page and keep looking until it has been received. Atm I’m using this if statement:
if (var1==undefined) {
prevFrame();
}
Is there a better way of achieving this? Hopefully without using two frames?
Thanks!
Checking If A Key Is Down?
Hi, I'm trying to make a code that checks if the enter key is down, then a function will run every second.
I've tried:
ActionScript Code:
if (key.isDown(key.ENTER) {setInterval(rectDecrease,1000);}
How would I make flash constantly check this instead of just once?
Md5 Self Checking
Hi, my company has developed a flash game for use in a casino. In order to get approved I need to be able to have the swf's run an md5 hash check on themselves every time they are run, in order to proof against hacking.
Does anyone have any idea how to do this? Any help would be greatly appreciated as there are deadlines involved.
Thanks.
|