Help Refreshing Library MovieClip Array Based On Input Text
Hi!I've built this fancy airport board application where you can write your sentance in the input field and by that change the board.You can see here an example of what I have at the moment.here's the code I have: Code: //putting some starting text in the text fieldinput_txt.text = "Oceanic Flight 815";//initializing variablesvar holder_mc:Holder = new Holder();var letter_mc:Letter = new Letter();var sentance:String = new String(input_txt.text);var arrayLetters:Array = sentance.split("");//button CLICK listener and relative actionok_btn.addEventListener(MouseEvent.CLICK, ok_btn_CLICK);function ok_btn_CLICK(e:MouseEvent):void{ BuildSentance();}//The action that builds the sentances based on the input textfunction BuildSentance():void{ for (var i:uint=0; i<arrayLetters.length; i++) { //removeChild(holder_mc); ???? --> Need to remove holder_mc when already exists in order to reload the new sentance. //Or somehow reload/refresh the sentance //Need to somehow apply a timer that sets an interval of 1 second between the lettering fallout. //Calls Holder from Library and adds it to the Stage (this will be the container for the sentance) var holder_mc:Holder = new Holder(); this.addChild(holder_mc); holder_mc.x = 10; //breaking input text into letters sentance = input_txt.text; arrayLetters = sentance.split(""); //Calls Letter from Library and adds it to holder_mc var letter_mc:Letter = new Letter(); holder_mc.addChild(letter_mc); letter_mc.x = 17*i; letter_mc.y = (10); //Adds letters to letter_mc's letter_mc.numbers1.letra_txt.text = arrayLetters[i]; letter_mc.numbers2.letra_txt.text = arrayLetters[i]; letter_mc.numbers3.letra_txt.text = arrayLetters[i]; }}BuildSentance(); I'm having 2 problems:1) on applying some sort of timer that throws the sentance letters one of a time to the board;2) on updating the board, by removing the older sentance and throwing in the new one.Can anybody help me on this?Thanks in advance.
KirupaForum > Flash > ActionScript 3.0
Posted on: 04-05-2008, 11:22 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help Refreshing Library MovieClip Array Based On Input Text
Hi!
I've built this fancy airport board application where you can write your sentance in the input field and by that change the board.
You can see here an example of what I have at the moment.
here's the code I have:
ActionScript Code:
//putting some starting text in the text field
input_txt.text = "Oceanic Flight 815";
//initializing variables
var holder_mc:Holder = new Holder();
var letter_mc:Letter = new Letter();
var sentance:String = new String(input_txt.text);
var arrayLetters:Array = sentance.split("");
//button CLICK listener and relative action
ok_btn.addEventListener(MouseEvent.CLICK, ok_btn_CLICK);
function ok_btn_CLICK(e:MouseEvent):void{
BuildSentance();
}
//The action that builds the sentances based on the input text
function BuildSentance():void{
for (var i:uint=0; i<arrayLetters.length; i++) {
//removeChild(holder_mc); ???? --> Need to remove holder_mc when already exists in order to reload the new sentance.
//Or somehow reload/refresh the sentance
//Need to somehow apply a timer that sets an interval of 1 second between the lettering fallout.
//Calls Holder from Library and adds it to the Stage (this will be the container for the sentance)
var holder_mc:Holder = new Holder();
this.addChild(holder_mc);
holder_mc.x = 10;
//breaking input text into letters
sentance = input_txt.text;
arrayLetters = sentance.split("");
//Calls Letter from Library and adds it to holder_mc
var letter_mc:Letter = new Letter();
holder_mc.addChild(letter_mc);
letter_mc.x = 17*i;
letter_mc.y = (10);
//Adds letters to letter_mc's
letter_mc.numbers1.letra_txt.text = arrayLetters[i];
letter_mc.numbers2.letra_txt.text = arrayLetters[i];
letter_mc.numbers3.letra_txt.text = arrayLetters[i];
}
}
BuildSentance();
I'm having 2 problems:
1) on applying some sort of timer that throws the sentance letters one of a time to the board;
2) on updating the board, by removing the older sentance and throwing in the new one.
Can anybody help me on this?
Thanks in advance.
Help Refreshing Library MovieClip Array Based On Input Text
Hi!
I've built this fancy airport board application where you can write your sentance in the input field and by that change the board.
You can see here(http://www.adhesive-studio.com/dev/AirportBoard_Sentances.html) an example of what I have at the moment.
here's the code I have:
Code:
//putting some starting text in the text field
input_txt.text = "Oceanic Flight 815";
//initializing variables
var holder_mc:Holder = new Holder();
var letter_mc:Letter = new Letter();
var sentance:String = new String(input_txt.text);
var arrayLetters:Array = sentance.split("");
//button CLICK listener and relative action
ok_btn.addEventListener(MouseEvent.CLICK, ok_btn_CLICK);
function ok_btn_CLICK(e:MouseEvent):void{
BuildSentance();
}
//The action that builds the sentances based on the input text
function BuildSentance():void{
for (var i:uint=0; i<arrayLetters.length; i++) {
//removeChild(holder_mc); ???? --> Need to remove holder_mc when already exists in order to reload the new sentance.
//Or somehow reload/refresh the sentance
//Need to somehow apply a timer that sets an interval of 1 second between the lettering fallout.
//Calls Holder from Library and adds it to the Stage (this will be the container for the sentance)
var holder_mc:Holder = new Holder();
this.addChild(holder_mc);
holder_mc.x = 10;
//breaking input text into letters
sentance = input_txt.text;
arrayLetters = sentance.split("");
//Calls Letter from Library and adds it to holder_mc
var letter_mc:Letter = new Letter();
holder_mc.addChild(letter_mc);
letter_mc.x = 17*i;
letter_mc.y = (10);
//Adds letters to letter_mc's
letter_mc.numbers1.letra_txt.text = arrayLetters[i];
letter_mc.numbers2.letra_txt.text = arrayLetters[i];
letter_mc.numbers3.letra_txt.text = arrayLetters[i];
}
}
BuildSentance();
I'm having 2 problems:
1) on applying some sort of timer that throws the sentance letters one of a time to the board;
2) on updating the board, by removing the older sentance and throwing in the new one.
Can anybody help me on this?
Thanks in advance.
Duplicating A Movieclip Based On An Array
Hi guys, I am using mdm zinc to create an application that gets the folder and file names of a certain directory then duplicates a movie clip for each file. The problem does not seem to be from mdm, because I am able to trace out each of the file names in my loop, but when I go to duplicate the movieclip it seems to only do a a couple of each. Im sure my problem is something stupid and obvious, but I havent been able to find it. Here is my code, thanks guys.
Code:
var linksArray = new Array();
linksArray = mdm.FileSystem.getFolderList("files");
var numberOfLinks = linksArray.length;
var totalLinks = numberOfLinks - 1;
for (i = 0; i <= totalLinks; i++)
{
_root["listArray" + i] = mdm.FileSystem.getFileList("files/" + linksArray[i], "*.swf");
var numOfSubLinks = _root["listArray" + i].length;
var totalSubLinks = numOfSubLinks - 1;
currentArray = _root["listArray" + i];
for (j = 0; j <= totalSubLinks; j++)
{
duplicateMovieClip("checkbox_mc", "checkbox" + j, j);
_root["checkbox" + j]._x = 5;
_root["checkbox" + j]._y = 5 + j * _root["checkbox" + j]._height;
_root["checkbox" + j].thisLabel = currentArray[j];
_root["checkbox" + j].category = linksArray[i];
mdm.Dialogs.prompt(currentArray[j]);
}
}
Extending MovieClip, AttachMovie, Array, Add To Library
I have a class, Node, which extends MovieClip.
I store several Nodes in an Array, and would like to attach them to the stage.
The Nodes are rendered using the drawing API so nothing is in the .fla library.
How can I do this? Can I use attachMovie()?
Run Function Based On Text Input AS3
I have a input text field that receives its contents from a bar code scan. I want flash to automatically read the input and run function with no user interaction.
Any ideas on how to do this via AS3?
Boolean Value Based On Input Text
I'm trying set a Boolean value based on whether anything has been entered in an Input Textfield. On the stage is a button and an Input text field. With the following code...
var isFilled:Boolean = false;
btn.addEventListener(MouseEvent.MOUSE_DOWN, tryit);
function tryit(event:MouseEvent){
if(testing.text == ""){
isFilled = false;
trace("The field is blank");
}else{
isFilled = true;
}
trace(isFilled);
trace(testing.text);
}
... when the button is pressed, isFilled is traced as true regardless of whether there's anything in the text field. It seems like the first part of the conditional is being skipped.
What simple mistake am I making?? Many thanks.
[F8] Refreshing XML List Based On Keyword?
Hope someone can point me in the right direction for this. I've got an FLV playlist with a large number of flv's. I've got the list loading no problem and everything works great. My question is what kind of coding i need to be able to make it so if you click on a button it will refresh the list so it only shows items with a specific node value?
this is an example of the XML i'm working with:
Code:
<playlist>
<video url="streams/Video1.flv">
<Title>Video 1</Title>
<img_src>images/Video1.jpg</img_src>
<desc>This is Video 1</desc>
<category>Drama</category>
</video>
<video url="streams/Video2.flv">
<Title>Video 2</Title>
<img_src>images/Video2.jpg</img_src>
<desc>This is Video 2</desc>
<category>Comedy</category>
</video>
<video url="streams/Video3.flv">
<Title>Video 3</Title>
<img_src>images/Video3.jpg</img_src>
<desc>This is Video 3</desc>
<category>Drama</category>
</video>
So now I want to have a button called "Drama" which when clicked will refresh the list to only show the video's which list "Drama" under the category node. Other buttons would than be used to choose to refresh the list based on other category values.
My AS code for the playlist is below:
Code:
var vlist:XML = new XML();
vlist.ignoreWhite = true;
var images:Array = new Array();
var titles:Array = new Array();
var desc:Array = new Array();
vlist.onLoad = function() {
var playlist:Array = this.firstChild.childNodes;
for(i=0;i<playlist.length;i++) {
_root.videoList.addItem(playlist[i].firstChild.firstChild.nodeValue, playlist[i].attributes.url);
titles.push(playlist[i].firstChild.firstChild.nodeValue);
images.push(playlist[i].firstChild.nextSibling.firstChild.nodeValue);
desc.push(playlist[i].firstChild.nextSibling.nextSibling.firstChild.nodeValue);
}
startImage.holder.loadMovie(images[0]);
ns.play(_root.videoList.getItemAt(0).data);
ns.pause(true);
startImage.title_txt.text = titles[0];
startImage.desc_txt.text = desc[0];
_root.videoList.selectedIndex = 0;
}
var vidList:Object = new Object();
vidList.change = function() {
Screen.clear();
ns.clear();
startImage.holder.loadMovie(images[_root.videoList.selectedIndex]);
startImage._visible = true;
ns.play(_root.videoList.getItemAt(_root.videoList.selectedIndex).data);
ns.pause(true);
startImage.title_txt.text = titles[_root.videoList.selectedIndex];
startImage.desc_txt.text = desc[_root.videoList.selectedIndex]
pauseButton._visible = false;
playButton._visible = true;
}
_root.videoList.addEventListener("change",vidList);
vlist.load("videos.xml");
I'm somewhat new to working with AS and XML so any help on how I would go about this would be appreciated.
Thanks
How To Restrict Input Text Based On Position?
Input text fields have a maxlength.
Input text fields have a restrict option so it's possible to block certain characters.
I would like to restrict input based on the caret's position in the textfield. Is this possible?
I'm able to retrieve the caret's position in the onChanged handler.
Can I clear the buffer in the onKeyDown?
Btw, the object I'm trying to put together is a textarea with one or more input fields inside. So, it's static text, followed by input text, followed by static text, etc.
My first try came down to putting textfields on top of each other, set autosize to true, and expand the static part along with the input part with an onchanged handler. Too bad this only works for one line of text. With more lines, wrapping becomes an issue.
Suggestions are most welcome.
---
Just thought of something. Is the textfield listening to the Key object? If so, can I detach it, and create my own handler especially for my textfield?
Actions Based On Word In Input Text?
Is there a way i can have an action take place if a word shows up in an input text field?
example:
could i make the word 'monkey' perform an action if it shows up in my input text as in 'would you like to touch my monkey"?
..if i can figure this out i'll have one sweet chat to share with flashkit.. Cheers
Loading Images Based On Input Text
hey guys am trying to edit the following code so that what ever is in the input box (this is the name of the file on my server changed address for privacy reasons);
Code:
container.loadMovie("http://www.example.com/Images/");
what would i need to add if i want to take the value from input box (Image.text) and add it to the end of the code to get it to load that specific image
cheers in advance
Boolean Value Based On Input Text Field
I'm trying set a Boolean value based on whether anything has been entered in an Input Textfield. On the stage is a button and an Input text field. With the following code...
Code:
var isFilled:Boolean = false;
btn.addEventListener(MouseEvent.MOUSE_DOWN, tryit);
function tryit(event:MouseEvent){
if(testing.text == ""){
isFilled = false;
trace("The field is blank");
}else{
isFilled = true;
}
trace(isFilled);
trace(testing.text);
}
... when the button is pressed, isFilled is traced as true regardless of whether there's anything in the text field. It seems like the first part of the conditional is being skipped.
What simple mistake am I making?? Many thanks.
Converting Text-based Items In An Array To MovieClips
I've been trying to find an alternative to my problem, but all seems to no avail. The situation is the following:
I have an array which I fill at the very beginning of my code:
ActionScript Code:
var objArray:Array = new Array("apple","juice","banana","chicken","cookie","dish","milk","oranges","strawberry");
Further down, I have a function that removes an item randomly (can be anywhere in my array) and immediately adds it back at the end of the array:
ActionScript Code:
var removedObj = objArray.splice(rPosition,1); //rPosition being a random number (max = array.length)
objArray.push(removedObj);
It all works fine and I normally have quite random arrays, but now comes the part where I add them onto my stage; the part that does not work, because the items in my array are no class/displayobjects/movieclips (I guess it's the first one):
ActionScript Code:
for(var i:int=0; i<objArray.length; i++){
var libObject:MovieClip = new objArray[i]();
addChild(libObject);
}
All I know is that it does not work.
For your information, making a DisplayObject/class-filled-array from the very beginning and adding them onto stage works, but it's then impossible to remove an item out of the array (splice) and adding it back at the end. The result here (again) is that I can't add it to my stage due to the fact that the item I just re-added is not a class, but mere text. Therefore my title =D
Thanks in advance! Really hope someone can figure this out, all I need is a hint.
Text From An Input Box To An Array
How can you put all the characters in a text box into an array?
textbox contents:
dad kokrddaddad
array
Code:
var myArray:Array = Array("d", "a", "d", " ", "k", "o", "k", "r", "d", "d", "a", "d", "d", "a", "d");
Code:
b.onRelease = function() {
i = 0;
words.text.toLowerCase().charAt(i)
++i;
??????????
};
Glen Charles Rowell
Input Text To Array
Is there a way to make Array from Input Text?
for example :
I'm fill input text with [[1,1],[1,2]] and I want it to be array in Array variable.
This my code :
PHP Code:
inputtoarray.onRelease = function () {
tempArray = inputpanel; //input text var
tempArray = tempArray.split('"'); //<- to object var
tempArray = tempArray.valueOf();
trace(tempArray); //var trace
trace(tempArray.length); //var len trace
trace(typeof(tempArray)); //var type trace
};
Thanks b4
Input Text To Array?
I have a multiline input text box, on button release I want it to read line by line of what the user type in and put it in array. how am I goin to do that?
Thank you for your help.
How To Get Data From Input Text To Array ?
Hi all
I need to know how to get data from input text and send it to Array
and also how to display them out with DText ?
is it Clear
if the Array has its elements it's so easy with me
like this for example (*&*)
var mylist = ["a", "b", "c"];
// this is a cool function that will display mylist elements
// into DText by invoke it and passing arguement to it wwwwowowoow
function loop (nam) {
for (i=0; i<=nam[i]; i++) {
dis += nam[i];
dis += newline;
}
}
loop(mylist);
but as I need that how to get it from input text plz help out with little code post here ... thanks
Input Text Fields From Array
This is the code i've got:
theFields = new Array("NAME", "EMAIL", "PHONE", "ADRESS", "COUNTRY");
xpos = 20
ypos = 20
movieclip.prototype.generateTextfields = function(theFields, xpos, ypos)
{
for( i = 0; i < theFields.length; i++)
{
this.createTextField(theFields[i], (xpos * i), 1, (ypos * i), 100, 18);
var tmp = this[theFields[i]];
tmp.text = theFields[i];
defaultFormat = new TextFormat();
defaultFormat.font = "verdana"
defaultFormat.size = 9;
tmp.border = true;
tmp.multiline = true;
tmp.selectable = false;
tmp.background = true;
tmp.type = "input";
tmp.borderColor = 0x000000;
tmp.backgroundColor = 0xcccccc;
tmp.setTextFormat(defaultFormat);
tmp.type = "input";
tmp.selectable = true
}
}
// usage //
_root.createEmptyMovieClip("tfGenerator", 1);
tfGenerator.generateTextfields(theFields, xpos, ypos);
What i want is to create a button that collects the inouted data and send it to a specific e-mail.
Is it possible??
Input Text To Array Variable Not Working..
Hello all, I am working on a line rider/ free rider style game in flash 8 (which is coming along quite nicely ). For the whole night I've been trying to create a way to save and load data simply off text and have finally come up with a basic solution for it! I have my information all stored into an array neatly to be later used with the function lineTo upon load. My problem here is that when I actually input the data into the textbox to be picked up by the load button it does not draw the lines like its supposed to.
My load button has the following code:
onClipEvent (enterFrame) {
onRelease = function() {
var points = new Array(_root.xInput);
_root.lineStyle(5, 0xFF0000);
_root.moveTo(points[3].x, points[3].y);
for(i = 0; i < points.length;i++)
_root.lineTo(points[ i ].x, points[ i ].y);
}
}
Where _root.xInput refers to the location of the input textbox. Now I have tested actually filling in the x and y coordinates manually and it does work when the load button is pressed. In addition I checked if my paths were correct and if the load button was actually interacting with the input text already so thats not the problem. Anyone know why it wont accept my input directly from the textbox in the movie? Any help is appreciated, this problem just makes no sense to me =.
The code I am copy and pasting into the input text is this:
{x:321, y:97}, {x:319, y:95}, {x:316, y:95}, {x:310, y:95}, {x:302, y:95}, {x:291, y:95}, {x:279, y:96}, {x:265, y:98}, {x:254, y:102}, {x:246, y:106}, {x:240, y:112}, {x:236, y:114}, {x:234, y:118}, {x:231, y:122}, {x:230, y:125}, {x:229, y:130}, {x:229, y:134}, {x:229, y:138}, {x:232, y:144}, {x:236, y:150}, {x:240, y:156}, {x:245, y:160}, {x:251, y:165}, {x:259, y:170}, {x:266, y:175}, {x:272, y:181}, {x:279, y:186}, {x:287, y:191}, {x:292, y:197}, {x:294, y:201}, {x:294, y:205}, {x:294, y:208}, {x:293, y:213}, {x:290, y:218}, {x:285, y:224}, {x:279, y:229}, {x:270, y:234}, {x:259, y:239}, {x:247, y:243}, {x:237, y:246}, {x:229, y:250}, {x:224, y:251}, {x:222, y:252}, {x:220, y:253}, {x:219, y:253}, {x:218, y:253}, {x:217, y:253}, {x:216, y:253}, {x:214, y:253}, {x:213, y:253}
Input Text To Array Variable Not Working..
Hello all, I am working on a line rider/ free rider style game in flash (which is coming along quite nicely ). For the whole night I've been trying to create a way to save and load data simply off text and have finally come up with a basic solution for it! I have my information all stored into an array neatly to be later used with the function lineTo upon load. My problem here is that when I actually input the data into the textbox to be picked up by the load button it does not draw the lines like its supposed to.
My load button has the following code:
onClipEvent (enterFrame) {
onRelease = function() {
var points = new Array(_root.xInput);
_root.lineStyle(5, 0xFF0000);
_root.moveTo(points[3].x, points[3].y);
for(i = 0; i < points.length;i++)
_root.lineTo(points[ i ].x, points[ i ].y);
}
}
Where _root.xInput refers to the location of the input textbox. Now I have tested actually filling in the x and y coordinates manually and it does work when the load button is pressed. In addition I checked if my paths were correct and the load button was actually interacting with the input text already so thats not the problem. Anyone know why it wont accept my input directly from the textbox in the movie? Any help is appreciated, this problem just makes no sense to me =.
The code I am copy and pasting into the input text is this:
{x:321, y:97}, {x:319, y:95}, {x:316, y:95}, {x:310, y:95}, {x:302, y:95}, {x:291, y:95}, {x:279, y:96}, {x:265, y:98}, {x:254, y:102}, {x:246, y:106}, {x:240, y:112}, {x:236, y:114}, {x:234, y:118}, {x:231, y:122}, {x:230, y:125}, {x:229, y:130}, {x:229, y:134}, {x:229, y:138}, {x:232, y:144}, {x:236, y:150}, {x:240, y:156}, {x:245, y:160}, {x:251, y:165}, {x:259, y:170}, {x:266, y:175}, {x:272, y:181}, {x:279, y:186}, {x:287, y:191}, {x:292, y:197}, {x:294, y:201}, {x:294, y:205}, {x:294, y:208}, {x:293, y:213}, {x:290, y:218}, {x:285, y:224}, {x:279, y:229}, {x:270, y:234}, {x:259, y:239}, {x:247, y:243}, {x:237, y:246}, {x:229, y:250}, {x:224, y:251}, {x:222, y:252}, {x:220, y:253}, {x:219, y:253}, {x:218, y:253}, {x:217, y:253}, {x:216, y:253}, {x:214, y:253}, {x:213, y:253}
How To Input Text In Movieclip
hi there,
i am new to flash i need to know the methods for inputing a text from movieclip to directly txt file or a database . means as you insert the text in text box and as you press the enter key in the name or the text should directly be saved in the txt file or in the database.
i hav edrag the inputbox from component.
plz help me. its very urgent.
thanx
Refreshing An A Non-Instanced MovieClip
Hello,
I have a number of identical movieclips that appear in individual keyframes, one after the other, along the same layer of a timeline. They are not instance named or anything. Everytime this timeline goes to a new frame I want these movieclips (and certain elements within them) to refresh themselves. Problem is they don't! Whenever the main nav moves the timeline to another frame an element (usually a little tick icon) within a movie remains in its ON state when it should have been reset.
It's important that I don't separate these clips by putting them on separate layers/give them separate instances etc. I've tried refreshing them by having blank frames at start etc, or a little movie that orders each part of this shared instance to return to its start frame but it just doesn't seem to work.
Text Input Inside MovieClip
ok for some reason none of my text input fields will show up when I view the .swf in a browser, but they show up when I preview it from flash. Could this be because my text input fields are not on the main timeline but inside a movieclip? I have to do this because the page is animated. How do I get them to work?
MovieClip Goto The Input Text
I have a input textbox,an enter button and a movieclip. When I click enter I want the movieclip to go to the frame of the number that is input in the textbox.
Input textbox Instace name = page_txt
Movieclip Instance name = text_mc
Button actions:
ActionScript Code:
on(release){ _root.text_mc.gotoAndStop(_root.page_txt == _root.page_txt);}
Any ideas?
Input Text Identifies Movieclip
I haven't been able to find what I am looking for in the forums or tutorials online. Hopefully someone can lead me to a resource or offer insight.
I am making a training application that requires a user to identify a characteristic or property of a movieclip (color, shape, etc), type the answer into an input text box, and click a submit button. For instance, a user is randomly presented with a random colored square movieclip from the library through an array. The user is instructed to identify the color of the movieclip (blue, green, red, orange, yellow). The user would type "blue" (or whatever color identifies the movieclip) in the input text box and click the submit button to get a correct/incorrect response.
I am having trouble with effectlvely getting the the input text box and submit button to recognize the movieclip once it is presented. What is the most effective way to code the input text box to relay the user input to match the movieclip? This seems elementary but I any assistance to get me started would be appreciated.
Thanks for any help!
How ToRefrence Text Input Inside Movieclip
How do i refrence a text input inside a movie clip.
I have a TI and converted it to a MC so i can tween it.
I can refrence it when it is not inside a MC but once inside it it seems that my AS doesnt seem to refrence it.
specf. this is what im trying to do
if (textInput eq "" || textInput2 eq ""){
gotoAndStop(2);
}Else{
loadVariablesNum("mail.cfm",0,"POST")
}
I've trided mcname.textInput and that doesnt work
basicly the if statement always returns false, unless the text boxes are in _root and not in a MC
Input Text In A Movieclip, Doesn't Work :(
hi
I am having a trouble with Input Text.
I put a text box in the first scene,first frame.I set it as InputText and Var. name is "Name".
I have a mc in frame 88 and inside this mc there is another mc.In that last mc I put another text box,InputText and set Var. name as "Showname"
I add this code into the first frame to a button;
on (release, keyPress "<Enter>") {
Showname = Name;
gotoAndPlay(2);
}
I want the move go on from frame(2) to (88) and show the text in the mc.
But it doesn't
What do I do wrong?
Thanks for your time
Input Text Boxes Won't Animate In MovieClip?
I have a form built in Flash 8 that I would like to have fade in. I have created a movieClip and inside which, it has 11 input text boxes and 11 static text boxes which serve as the labels. On the main stage I have a motion tween that should fade the whole movie clip into place. But instead, the input text boxes will pop onto the stage and the static text boxes will fade into place. Even though they are both within the same movieClip. Any idea why this is happening? Is there any other way to get this to work?
Input Text Boxes And Scroll Bar In A Movieclip
Hi,
I am a beginner in actionscript. I was trying to create a simple interface. The interface contains a single button. When clicked on the button, a input text box is created in a defined space. Many input textboxes can be created. All the created textboxes are stacked up in sequential order as they are created (input textbox 1, input textbox 2....n). The space containing stacked up textboxes has a scroll bar so that text boxes can be browsed.
I am attaching a sketchy explanation (image) to my problem. I am looking for some advice/suggestions/examples, so that I can complete what I intended to do.
Here is the code I am using but the new MC (var b) is always attached at -158 and -100 and not updated with the new yPos for the MC.
Quote:
var i = 1;
btn_main_st.onPress = function() {
//Starting x & y values
var xPos = -158; // mc_s._x;
var yPos = -100; // mc_s._y;
var b:MovieClip = _root.mc_s.attachMovie("mc_s_statement", "mc_s_statementnew"+i, i, {_x:xPos, _y:yPos});
//increase the y postion each time
yPos += b._height+5;
trace ("mc_s_statementnew"+i);
trace (b._x);
trace(b._y);
i++;
};
Appreciate help on this one and thanks in advance.
--nish
Buttons And Input Text In Movieclip Do Not Respond
this should be really easy but i can't figure it out and it's annoying the crap out of me.
i have a movieclip that acts as a sliding menu, with only the right edge showing on the left side of the swf. whenever the user rolls over the edge, the whole thing slides out.
the movieclip acts as a button using:
MC.onRollOver = function(){ }
to slide the menu out when needed. however, this causes the mc to think it's a button, and the mouse changes to the the hover state (the hand with the finger pointing up), and also will not let the buttons and text inputs be used.
how can i set it up where:
1. it slides out when rolled over
2. it does not change the state of the mouse pointer
3. the user can use buttons, etc contained in the movieclip
thanks for the help, omnislant
Input Text Inside Movieclip Does Not Show (flash 8)
i got a problem.
i want to use input text inside a movieclip within my main scene, but somehow if i test this, it does not work. if i put "normal" text everything is fine. but if i put input text, it wont work...
i would really appreciate any solution to this problem.
thanks guys
Help Needed With Loading INPUT TEXT FIELDS Into A MovieClip
What I'm trying to do is to setup "INPUT TEXT" within a SWF file that will load into my main movie.. For some reason, the INPUT TEXT will not appear in my movie at run time??
The problem occurs when I attempt to load the movieClip within my main Flash file ..
I've uploaded the guestbook SWF I'm trying to add to my site as seperate link and it seems to be working just fine: http://www.trusoundcrew.com/GuestBook.swf
And here is that very same SWF loading into my website but for some reason the text fields don't work ?? HELP!! : http://www.trusoundcrew.com/TRU3.swf
Any ideas as to why this is not working?
Reference External Library Movieclip In Library With AS3
Hello, i am able to load at runtime a library asset in flash cs3. i do this by setting up its linkage property and setting its base class. for eg
Class: MyButton
Base: flash.display.MovieClip
then in my document class, say i had com.kofi.InitializeTemplate, my class looks like this
package com.kofi
{
import flash.display.MovieClip;
import MyButton;
public class InitializeTemplate extends MovieClip
{
var testButton:MyButton;
public function InitializeTemplate():void
{
trace("the button class has been called");
testButton = new MyButton();
addChild(testButton);
}
}
}
however, once i bring in an external library asset(which i have already exported and set it base class etc), i am unable to call this shared library asset with as3. anyone know what i am talking about?
MX 2004: Input Text And Dragggable Areas Nested In A Movieclip
I have some input text fields and draggable areas setup nested withn movie clips and when I rollover the areas with the mouse the mouse changes to either an insertion point or hand, but I cant click into the text fileds or drag the areas around. Is there a way to address these fields or do thy need ot be out of movieclips? Should the acitonscript for these area go on the root timeline?
Library For Tile-based Games
ActionScript Code:
function drawMap(map) { mapH = map.length; mapW = map[0].length; num = 0; attachMovie("tile", "tile", mapH * mapW); tileW = tile._width; tileH = tile._height; for (i = 0; i < mapW; i++) { for (j = 0; j < mapH; j++) { tile.duplicateMovieClip("tile" + num, num); t = this["tile" + num]; t.gotoAndStop(map[j][i]); //trace(map[i][j]); t._width = tileW; t._height = tileH; t._x = tileW * i; t._y = tileH * j; num++; //trace(num); } } tile.removeMovieClip();}function checkTile(x, y) { count = mapH*mapW; for (k=0; k<count; k++) { name = _root["tile"+k]; if (name.hitTest(x,y)) { return k; } }}MovieClip.prototype.nextTile = function() { if (this._currentframe == this._totalframes) this.gotoAndStop(1); else this.nextFrame();};
It requires a movieclip in the library with a linkage name of tile. Inside this movieclip starting a frame 1, on each frame, is a tile (say grass on frame 1, water on frame 2, etc.).
Drawmap, obviously, draw's the map. It's paramater (map) is a 2d array that contains all the tiles needed. It also uses the only movieclip needed (at the moment!) which contains all our tiles.
Checktile, takes in two coordinates (x, y) and runs through all the tiles to see which one (if any) the coords are on. It returns the number of the tile. Drawmap labels each tile tile0, tile1, tile2, tile3, etc. and checktile returns the number in that name.
nextTile, is a prototype that is called on the tile movieclip, it's basically an extended nextFrame() as it checks to see if it's on the last frame and if so start again. This function has a use in a map editor.
An example using this and checkTile is, again, in a map editor, to change the selected tile to it's next state.
ActionScript Code:
_root["tile"+checkTile(_xmouse, _ymouse)].nextTile();
2d Array, is arrays inside arrays, used for building tile-worlds. Here is an example for a 10x10 world:
ActionScript Code:
var map:Array = [ [3, 2, 2, 2, 2, 2, 2, 3, 1, 1], [3, 3, 3, 2, 2, 2, 3, 3, 1, 1], [1, 1, 3, 3, 3, 3, 3, 1, 1, 1], [1, 1, 1, 1, 1, 1, 4, 4, 4, 4], [1, 4, 4, 4, 4, 4, 4, 4, 4, 4], [4, 4, 4, 4, 2, 2, 4, 4, 4, 4], [4, 4, 4, 4, 2, 2, 4, 4, 4, 4], [4, 4, 4, 4, 4, 2, 4, 4, 4, 4], [1, 1, 1, 4, 4, 2, 4, 4, 1, 1], [1, 1, 1, 1, 3, 2, 3, 1, 1, 1] ];
***
Very small at the moment, but it'll grow as I continue with my latest project. It's the first time I've played with tiles.
Simple: Dynamic And Input Text Boxes Wont Show When They're In An Attached MovieClip
Hey.
I am re-attaching the same movie clip (containing dyanmic text boxes) over and over again, filling a menu... and i have therefore used a mask so that a scroller must be used to view the elements of the menu far down on the list. Unfortunately, using a mask means that the dynamic text boxes within each movie clip become invisible for some strange reason (though they still exist, and i can select the text that they contain). Taking the movie clips outside of the mask allows the text to show, however, the long menu 'spills' onto the rest of the presentation.
How can i get dynamic text boxes to show within my mask?!
Thank you very much
Adding A Mc From The Library Based On The Users Choice
Is there any way to do this? I only want one MC added with the same instance name based on the users choice.
if(event.target.name == "faceType1_mc") {
var myFace_mc:faceType1 = new faceType1();
}
else if(event.target.name == "faceType2_mc") {
var myFace_mc:faceType2 = new faceType2();
}
Play Sound Based On Instance Or Library Name Without First Filling Brackets?
On my main stage I have rows of regular buttons I made from static text - titles of mp3 files in my root folder, - and each of them has an instance name identical to the mp3 file, but without the .mp3 extension -
I have a fantastic code that enables me to both play an mp3 and simultaneously push it into an array by clicking any of those buttons on the main stage - it uses the instance name to play and then add the mp3 into the array. Here's the code:
var PlayArray = new Sound();
stop();
//keeps me from having to duplicate button code
var a = [this.Sound01, this.Sound02, this.Sound03];
for (i in a) {
mc2 = a[i];
mc2.onPress = function() {
myLoadedSound = new Sound();
myLoadedSound.loadSound(this._name+".mp3", true);
//pushes mp3 into array
MyArray.push(this._name+".mp3");
};
}
This code works perfectly - but the problem is that I've got thousands of mp3 files - and using this method I have to have every mp3 listed between the brackets [] in line 4 - and if I'm on say frame 3, I have to have this same code on frame 3, but with whatever mp3 buttons are on that frame's main stage listed in the brackets in that frame's actionscript - so even though I no longer duplicate code on individual buttons to play mp3s, I'm now running into duplicate code on frames - I'd like to have a master code that will work independent of what frame I'm on -
BUT that's not all that important - the real reason for my post - I'd like to adapt the code so it will play an mp3 based on the name of the instance or library name as it already does, BUT not have to list them all in the brackets - just ANY button anywhere in the swf if its pushed flash tries to play an mp3 using either its instance name or library name - without having to look in the brackets to see if its a legit mp3 button.
I know this probably sounds crazy and/or impossible... Maybe just have one thing in the brackets like loading a line from a text file that has all the mp3s in it ready to be accessed??
3d Box Based On User Input
Hi there
A client has asked us to develop a 3d box based on a users input
3 input values would be height, depth and width
these would dynamically change the box, we've manage to draw the square in 2d but struggle with 3d
We think that their must be a something simple which can take the coordinated of the square and project a persepctive for creating the 3d
any ideas??
Calculations Based On User Input
I have a user input box and 5 dynamic text boxes. Is there a way I can update the dynamic calculations as the user types in numbers rather than having a "calculate" button?
Need Some Help, Create Mc Based On User Input
I have been given a task by my company to create for them an application that will allow a user to "build their own sign". The variables that can be entered are: the width and height of sign
the color of the text (only amber, red, or blue)
a simple text message in an embedded font
choose 1 of 6 mounting options (a pole the sign will sit on)
a bonus item (though not needed) would be to choose from 10 or so bg graphics that could be seen behind the text or by themselves.
I also need to output the "created sign" to a printable page.
I am using mx2004 and have basic actionscript knowledge. I would appreciate if someone could point me in the right direction of how to start this project. Thanks!
Need Some Help, Create Mc Based On User Input
I have been given a task by my company to create for them an application that will allow a user to "build their own sign". The variables that can be entered are:the width and height of sign
the color of the text (only amber, red, or blue)
a simple text message in an embedded font
choose 1 of 6 mounting options (a pole the sign will sit on)
a bonus item (though not needed) would be to choose from 10 or so bg graphics that could be seen behind the text or by themselves.
I also need to output the "created sign" to a printable page.
I am using mx2004 and have basic actionscript knowledge. I would appreciate if someone could point me in the right direction of how to start this project. Thanks!
Load Movieclip From Library Into A Movieclip On The Stage?
Alright I am losing my mind trying to figure out something so simple, I can load external swfs no problem, but How do you access a movieclip from the library?
I have a main swf, and a movieclip in the library named feb93_mov. Basically I want to on MOUSE_DOWN load the library item "feb93_mov" into swfloader_mc on the stage. But I cant write an instance name for "feb93_mov" cause it's not supported, so how do I access it then?
Here is my code what is wrong with it?:
ActionScript Code:
feb93_btn.addEventListener(MouseEvent.MOUSE_DOWN, feb93down);
function feb93down(event:MouseEvent):void
{
loadMe4();
}
var loadMe4 = function():void
{
var feb93_mov:MovieClip = new MovieClip();
swfloader_mc.addChild(feb93_mov);
}
INPUT TEXT - How To Restrict Number Of Lines Of Text A User Can Input Into Textbox
In a flash form I've created I have a input textbox. I don't want the user to be able to input more than 7 lines of text. Is this possible to do? I know that I can set a value for 'max char', but this is not useful for me -- it's essential that the user cannot input more than 7 lines of text.
How can I limit the number of lines a user can input into a textbox?
Thanks!
Glenn
Go To Frame Label Based On User Input
Hi...
I was hoping somone could help me.. I want the user to hit the navigate button and when he does so.. I want a box to come up saying please enter a slide number.. based on the number he enters it takes him to the appropriate frame label..
Thanks
uday
Loadmovie Variable Based On Html Input
What I want to be able to do is because I am doing a html/flash hybrid site, the header is in flash , content in html. I want the flash to know what content page its on so it can display the name of the section. For example, Say i went to my portfolio section, it would goto a new page ( portfolio page ) and I would want the flash header to know its on that page and display the title of it ( play a certain frame of a movieclip)
Ok well, I am not a good coder at all, anyways
im stuck on a problem
In my master swf which is embeded on a html page, I want to load a movie clip from a different swf file, but have the movie clip name be a variable that is determined by the html page that it is on. So the html page that the master swf is on would have the variable ( the name of the movieclip to load).
or That the master swf would read a number variable from the page that it is currently embeded on and tell a movieclip ( in the master swf to goto a certain frame.
or maybe have javascript tell the master flash the variable
<OBJECT ID='FlashTest'
classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=550
HEIGHT=400>
<PARAM NAME=movie VALUE="master.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED NAME='mastertest'
src="master.swf"
quality=high
bgcolor=#FFFFFF
WIDTH=55
HEIGHT=40
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
swLiveconnect=true>
</EMBED>
</OBJECT>
have the javascript on the same page
<SCRIPT LANGUAGE='JavaScript'>
<!--
{
window.document.masterTest.SetVariable("loadtext", text);
}
-->
</SCRIPT>
in the flash file , have a dynamic text called "loadtext"
loadMovie(loadVariables(loadtext);, "/");
Help would be awesome
thx
ComboBox Values Based On User Input
I am working on a form that requires combobox values to change based upon user input from a previous combobox.
Example:
First combobox has T-Shirts styles
with values of:
long sleeve
short sleeve
sleeveless
Depending on which choice the user makes from the previous combobox the second combobox values will change.
long sleeve ---> Red, Yellow
short sleeve ----> Blue, Black
sleeveless-----> White
Could someone point me in the right direction?
I am using Flash MX 2004 Pro.
TIA
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?
|