ActionScript 2.0 :: Variable - Remove The Last Sentence?
Mar 23, 2008if i had a string variable that contained this: "Hello. This is a variable"... Is it possible to remove the last sentence?
View 6 Repliesif i had a string variable that contained this: "Hello. This is a variable"... Is it possible to remove the last sentence?
View 6 RepliesI need to find away to take a sentence and remove all its words besides the first.
If the sentence is "Hi my name is dingo" I need to get only the word "Hi"
I have one input text field. I need to be able to split the sentence that is entered and have the first half of the sentence in dynamic text Field_A and the second half in Field_B.
I have been looking at textField.wordWrap and .split but can't get it to work. Anyone got any simple sloutions? I'm still learning AS 3.0.
example: I am looking for a simple solution for splitting a sentence.
[Code]...
How to display a section of a sentence? (the final 3)E.g.THE MOUSE CAUGHT THE RAT AT POST 324S58. - I want to display "S58" in a text box.THE MOUSE CAUGHT THE RAT AT POST 345P87. - I want to display "P87" in a text box.THE MOUSE CAUGHT THE RAT AT POST 311V02. - I want to display "V02" in a text box.
View 5 RepliesCurrently we are extending the website for a coffee retailer. The whole page is in Flash and content is supplied by external XML-Files. However, the company expanded to Israel and therefore we are working on a hebrew version of the page (different charset and right-to-left). This works to 80% fine but sometimes we have sentences which contain latin nouns.
[Code]...
Make a program that can generate a random sentence based on:
[Code]...
I want to be able to do the following:
Type out a sentence and then highlight one of the words in the sentence and create a link to go to another frame.
The only other way which is time consuming (Especially with possibly hundreds of sentences) is to create each word as a button and then fit each word as a sentence together.
surely there is an easier way?
It will be the basis of an Elearning course for kids to click on a word in a sentence and based on their choice they go to a Correct or Wrong frame.
Captivate cannot do this unfortunately.
Ive been having trouble with this and I want to put this in a game. Like here's what I plan.you put your name in on input and on the next frame theres a sentence like "Hello (NAME), How are you doing?"
View 2 RepliesI have box mc and a textbox called "test" and I have a sentence in there saying trace("word")
how would I make the sentence become the function when box clicked? Like when box clicked it traces since the sentence has the code... like for example ...
box.addEventListener(MouseEvent.CLICK, try)
function try(event:Event)
{
var newString:String=test.text
}
is it the function that has to be changed (text:String)?? Id like the textbox to contain/execute the code not "hardcoded".
how to make a hyperlink for a word in a sentense?
View 4 RepliesI have a code that randomly generates a random sentence:[code]...Now on every word, I have a sound clip that I want to play, but how would I code it? I dont know I would I would assign a sound to a word or how to incorporate it into the coding above
PHP Code:
if(name "example"){mysound = new Sound();mysound.attachSound("example");mysound.start();}
[code].....
how to make a pre-made sentence appear when a button is clicked? Can this be done with AS2? I need a button that when clicked will display a sentence at random.
The way I have it in mind is to make a movie clip with say 10 different sentences on 10 different frames marked with labels (Sentence1, Sentence2, etc.) and each time the button is clicked, it will pick a random frame label thereby displaying the sentence on that frame. I just need to know the actionscript to link to the button.
is there a way to split up a sentence say 30 characters each into there own variables. I've seen this done before. --sum up take in a variable and give out a few other variables, each 30 character cut ups of the first var. (note: i have a sweet rpg with like every code possibly imagined and a engine thats almost done this is my only draw back i have a metheod right now but i dont like the system i have made to insert data into boxs and you hit space to get info. like a "a" button for a GB game. This will allow me to write an entire sentence.)
View 2 RepliesHow do I do this? : Output: Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts.
My code where it says "I am thinking of a number between 1 and 100" shows patchyly. So you can't read it as only a few letters are there:
[Code]...
How would I remove this attachMovie? [code] I have tried these codes with no success [code]I am using flash 10.2, in flash professional 5.5.
View 1 RepliesI'm slowly converting my older Director-made tutorials to Flash. The user inputs text, and then I evaluate it. Before this evaluation, I want to remove spaces to avoid the user's input being counted incorrect because of an extra space. How do I do this for Flash CS5?
Here's what I did for Director.
[Code].....
I have different textarea in a application and these have different Ids, once user move cursor inside in the specific textarea, delete button activate and it execute a function to remove this item, the Id of the textarea assigned as string variable, In this case how could i delete the component from Canvas
View 1 RepliesI'm trying to use a variable to remove a child from the stage and I get this error:
Scene 1, Layer 'action', Frame 108, Line 471067:
Implicit coercion of a value of type String to an unrelated type
flash.display:DisplayObject.
What I'm trying to do is to link some keys to add movie clips to the stage. But I need to have only one movie clip at the time on the stage, so, if I press a key to add a movie clip on the stage, the one that is already there needs to be remove. So I set a variable called "actualConf" to hold witch movie clip is on the stage. I simplified the code a bit to add it here (If I press "Q", the movie clip "lise" is added to the stage, then if I press "W", I want the movie clip "lise" to be removed than "nancy" to appear), I added a comment where I get the error :
Code:
Select allstop();
var actualConf:String = "null";
var lise:mcLise;
var liseX:Number = 50
var liseY:Number = 50
[Code] .....
Because I will have about 15 keys linked to 15 possible movie clips, I don't want to use the "if" condition 15 times.
im trying to grab the instance name of something on stage, set it to a variable then remove it.
iv tried:
Actionscript Code:
var something = object1something.removeMovieClip();
that works. problem is im setting variables at runtime depending on a user click.tried this too..
Actionscript Code:
var myvar;object1.onRelease = function() {myvar = this._name;}
tracing this out reveals that it is actually _level0.object1.also tried adding the string "_level0." + object1. still dosen' work.what im trying to do is click on objects. store there instance names into an array then remove them all when i do something else. such as press space.
I've been working on a feedback form in Flash that passes the variables to an ASP document that then processes the variables and sends an e-mail. After a lot of problems, I finally got the basic mechanics up and running.
However, whenever the variables go to the ASP file, it sends more than the text that was input into the input text field...it also sends all of the formatting data! Font size, family, color, leading, and so on.
Is there a way to configure the inputs or send the variables so that only the input data is sent?[code]...
I need to remove some movieclips that are attached dynamically so they do not show up underneath the new movieclips that will be attached when a user clicks the next button. I've tried removeMovieClip with little success. I am able to remove one or two of them, but not all. I need all of the previously attached movies gone.
Here is the as2 for it.
PHP Code:
//Set functions
function show_movie() {
menu_mc._visible = true;
buttons_mc._visible = false;
teacherinfo_mc._visible = false;
} function displayInfo() {
[Code] .....
Is this a valid way to completely clean up a variable/object event listener (code abbreviated for sake of example):
Code:
private var _timing:Timing;
...
[code]......
I'm new to AS3, as well as this forum,and had a question. I created a simple ad-lib type game for practice and would like to be able to remove any leading and trailing whitespace that a user inputs from the final outputted ad-lib, as well as if the user tries to submit their input with missing fields of text, it would throw an error and ask them to try again.[code]...
View 4 Replies"what if i want to find all the what's in this sentence full of what's?" i cant do this with indexOf, and it wont work either with lastIndexOf, since there are 3... i'm trying to do a simple htmlText editor and got stuck in the part where i cant check the selected word's position only with indexOf...
View 5 Repliesis being returned once the onrelease event happens. the loadmovie works fine but I want to remove
[Code]...
I'm making a game for children where they have to pay money by dragging it on a square. It al works wel only when i pick the first coin of one euro without going over the coin of 2 euro and then pick up a 2 euro coin the one euro disappears. after then it all works fine.i cant remove my duplicate euro's from the stage when i clic on pay here is my code for the euro's the euro's are in a emty movieclip
[code]...
In flash AS3 Do I need remove childs, if I remove the parent itseft? If I remove childs first, then remove the parent object afterall OR If I just remove parent object Will flash take same memory?
View 1 Repliesdo to the lack of good on Kongregate, I have come here =D
if(_root.row2.block1._x == _root.row1.block1._x)
{
_root.row2.block1.removeMovieClip();
[code]....
Just wondered if I remove a parent movieclip and then set it to null, will it remove all the child movieclips within it from the Display list and also from memory, or do I need to iterate through the parent movieclip removing all its children before removing the parent?
View 8 RepliesIn my experiment memory usage keeps growing a little (more, and more RAM usage after GC) when I use repeatedly:
Code:
removeChild(picContainer);
addChild(picContainer);
[code].....