How To Remove First And Last Character?
Hi there,
How can i remove first and last character of a string so
Code: var url = ">products>product_a>"; becomes
Code: var url = "products>product_a"; Any tips
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 10-07-2008, 07:06 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
JavaScript Remove. Remove Flash Applet When Done Playing?
Is there anyway to remove a section of HTML with a javascript? Ive seen ones that replace text segments, and remove certain tags like <br>. I want it to remove the flash applet once its done playing.
I know that its possible, I just need someone that knows javascript better than me. Someone please help it would be MUCH appriciated! Thanks!
The & Character In Flash...how To Use URLs That Contain The & Character...
I am loading in an array or urls from my database via php into my flash movie.
the output of my script looks like this:
quote:
--------------------------------------------------------------------------------
&id=1,&imagelist=1.jpg,&urls=http://www.homemade.ch/shop/100/conliste.asp?langext=&katno=8|&titles=Silence|&com ments=Silence, a painting by Bea Fehr|
--------------------------------------------------------------------------------
problem is that the url contains the '&' character, which Flash uses to seperate the variables....
ex:
http://www.homemade.ch/shop/100/con...angext=&katno=8
but problem is that it is being read into flash as this:
http://www.homemade.ch/shop/100/con_liste.asp?langext=
becuase Flash cuts it off when he see the '&' sign.
How can I workaround this problem, has to be a common issue I would guess since lots of URLs have this format....?
Do I need to write some parsing code?
Remove Movie Clip Help, Remove Child {AS2}
So, I'm new here, and do to the lack of good help on Kongregate, I have come here =D Hopefully somebody here will be able to help me
if(_root.row2.block1._x == _root.row1.block1._x)
{
_root.row2.block1.removeMovieClip();
trace("working");
}
now, the trace fires, and, if I remove ".block1" the entire movie clip is removed, but with it in there, to remove the MC from within my MC, it WONT be removed, am I doing this wrong or am I making some other error?
Keeping Character On Stage Plus Keeping Moving Background With Character On Stage
Im in the process of creating a superman game.. and i right now have him in walking mode .. i created him which is superman_mc . which has his waking animations etc.. inside and i have created a background mc which is level1_mc which basicly moves along with superman as he walks. .the problem i am getting is keeping the back ground from moving off the stage and superman from going off the stage i can keep superman on the stage and in one place on the stage with the code i have now but the background still moves off.. here is the code i have :
stop();
//Superman walk & flying movements
fly = "off";
_root.onEnterframe = function() {
if (Key.isDown(70)) {
_root.superman_mc.gotoAndPlay(4);
_root.superman_mc._y -= 17;
fly = "on";
}
if (_root.superman_mc, hitTest(_root.right_mc)) {
_root.superman_mc._x = 700;
}
//moves superman right
if (Key.isDown(39) & fly == "off") {
_root.superman_mc.gotoAndPlay(3);
_root.superman_mc._x += 17;
_root.level1_mc._x -= 17;
direction = "center";
//makes superman face foward
} else if (direction == "center") {
_root.superman_mc.gotoAndStop(1);
}
//moves superman left
if (Key.isDown(37) & fly == "off") {
_root.superman_mc.gotoAndPlay(2);
_root.superman_mc._x -= 17;
_root.level1_mc._x += 17;
direction = "left";
} else if (direction == "left") {
_root.superman_mc.gotoAndStop(1);
}
};
whats happening is that the background keeps going but since i have it setup to move along with superman .. if anyone can help thank you alot..
-rob-
Keeping Character On Stage Plus Keeping Moving Background With Character On Stage
Im in the process of creating a superman game.. and i right now have him in walking mode .. i created him which is superman_mc . which has his waking animations etc.. inside and i have created a background mc which is level1_mc which basicly moves along with superman as he walks. .the problem i am getting is keeping the back ground from moving off the stage and superman from going off the stage i can keep superman on the stage and in one place on the stage with the code i have now but the background still moves off.. here is the code i have :
stop();
//Superman walk & flying movements
fly = "off";
_root.onEnterframe = function() {
if (Key.isDown(70)) {
_root.superman_mc.gotoAndPlay(4);
_root.superman_mc._y -= 17;
fly = "on";
}
if (_root.superman_mc, hitTest(_root.right_mc)) {
_root.superman_mc._x = 700;
}
//moves superman right
if (Key.isDown(39) & fly == "off") {
_root.superman_mc.gotoAndPlay(3);
_root.superman_mc._x += 17;
_root.level1_mc._x -= 17;
direction = "center";
//makes superman face foward
} else if (direction == "center") {
_root.superman_mc.gotoAndStop(1);
}
//moves superman left
if (Key.isDown(37) & fly == "off") {
_root.superman_mc.gotoAndPlay(2);
_root.superman_mc._x -= 17;
_root.level1_mc._x += 17;
direction = "left";
} else if (direction == "left") {
_root.superman_mc.gotoAndStop(1);
}
};
whats happening is that the background keeps going but since i have it setup to move along with superman .. if anyone can help thank you alot..
-rob-
The < Character
Does anyone have a solution for how to put the "<" character into an HTML formatted text box? I cannot use the URL encoding:
text= var1 + %3C + var2;
Flash throws me an error on that. If I just put it in quotes, Flash ignores everything else after it, because its waiting for HTML commands and the close bracket.
Thanks,
Christopher May
ps. I guess I could just say "less than" but this is starting to bug me...
Character Box And Url. Help Please
in the character box when you have a certain block of text higlighted and want to make it a hyper link to a page.
how do you make that link open a new window or stay in the same window?????
Not the action script box (know how to do it) but the character options box in url.
i have tried blank and parent and son on but i must be syntxing it wrong somewhere.
http://www.helpme.com _blank ????? if thats right it aint workin
thank you
Character Map
if you are on a Windows box, start/programs/accessories/system tools/character map. This contains all the ASCII characters.
Url Character
I would like to create a url link with a popup from a text line using the character properties.
It's possible??
Thank you too much
Danielsun
3d Character
Hello,
I've would like to create a talking head character similar to site-pal and talking-head.
I've read several posts regarding lip-syncing etc but, I need a 3d character that animates; does anyone have an idea on how to create those site-pal 3d looking characters?
Thank You
iaustin
Character Help
I have designed a character in a different program (photoshop), but when I try to import it via drag and drop or copy and paste, a white square appears around it that will not go away. Do any of you know how to fix this?
Character Set
Hi,
I'm having a problem related to the character set. I'm loading a XML file to flash, but since my language (portuguese) has some something like "é", i can't see the proper characters.
Anyone knows how to solve this problem?
Character Help
Okay I was making this funny little Mario type game and I got stuck. Here's my problem.. When I push the right arrow I've got the guy moving to the right but it looks as though he's sliding across ice and not moving his feet, so I was wondering how i could get him to perform his little running move..."foot up foot down", while I was holding the right key in. Can anyone explain to me.. or maybe there's a tutorial that I haven't looked at?
Thanks - Charlotte
Get Character
i have set a ="abcd...xyz" and i want to display randomly any character from this variable a.
is it possible?
How Do You Type This Character?
I am looking at a set of actionscript code and there is a character that looks like a beefed up/bold-faced return arrow. Sort of like this:
|
|--->
Just imagine that as being much more solid and dark.
Anyway, does anyone know how to make that character or is it just to be ignored? I see it used in these example things in the book quite often so I think it is legit.
Ideas?
Thanks.
Help With Character Movement
what I am looking for is some help with making my Character
face in the right Direction. I not to sure were to start
so if you could take a look at this fla it would probible help
http://www.mac-10.net/man1.fla
hope you can help
mac
How To Escape @ Character In Url
i'm sending a variable which contains an email address to a server. However it doesn't seem to work if the variable contains the @ character. Oddly enough most email addresses contain this character. Any suggestions?
Character Codes
Is there anyway you can use flash to detect keys that are down besides the standard home, right, left, end, etc... by using ASCII codes or something? Ty.
Character Movement...
Ok, ive got 4 diff. animations of my character, each going in the respective direction. How can I change the animation for the correct direction he is heading in.. IE, If left key pressed: Left_run animation is played. This is the code I have so far for general movement:
onClipEvent (load) {
inc = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += inc;
}
if (Key.isDown(Key.LEFT)) {
this._x -= inc;
}
if (Key.isDown(Key.UP)) {
this._y -= inc;
}
if (Key.isDown(Key.DOWN)) {
this._y += inc;
}
}
onClipEvent (load) {
}
thanks guys,
Tman
Special Character
When dealing with variables is the any way of doing any of the following.
A)Insert a Tab
B)Make certain letters bold italic and or any other formating.
Dave
Rpg Walking Character Help
I tried posting something up about my little problem but no help, so could i simplify my question to;
does anyone know where i can read up, learn, look at, download, try some actionscript to make a character walk, up, down, left, right and stop efficiantly when objects are in the way, using top down views a bit like pokemon?
If anyone has any ideas, had the same problem before or even have some suggestions themselves that would be great!
Thanks alot for your time
James
If you want to read my earlier post go here about this;
http://board.flashkit.com/board/show...hreadid=311929
Passing The Last Character
Hi, Im trying to pass the last character of the seconds;
my code so far;
Code:
f = tijd.getSeconds();
f.toString();
length = length(f) -1;
_root.fr = f.substr(length,1);
This actions is placed in a mc, when I trace _root.fr it says 'undefined'.
What am I doing wrong?
To understand me correct; I only want the last digit of the getSeconds, so if its 13 seconds, then _root.fr should be 3, when its 2 seconds, the root.fr should be 2. Get me?
Im sure someone here can help me out.
Displaying The & Character
Hi,
I have flashform, where the data is loaded into the movie like
&target1=New York|Washington &target2=NY|WA&TargetCount=2&eof=1
If the database has a value containg '&' e.g. 'Deloitte & Touche' Flash would recognize it as a new string.
How can the '&' sign be displayed?
cheers
Patrick
Replace Character
hi,
i need to replace a character in a text field.
so if a text field reads berty # bassett i would like to replace the # with a ~ to read berty ~ bassett
any ideas?
tnx
Character Movement
I am currently making a game where you controll a character with you arrow keys you know the usual thing.
Well I was wondering if there is a better way to stop the movement if you encounter a wall or a object.
//this is my charachter controll(it's a semi 3d perspective so thats why the x is larger then the y//
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.slide._x = _root.slide._x+5.5;
}
if (Key.isDown(Key.LEFT)) {
_root.slide._x = _root.slide._x-5.5;
}
if (Key.isDown(Key.UP)) {
_root.slide._y = _root.slide._y-4;
}
if (Key.isDown(Key.DOWN)) {
_root.slide._y = _root.slide._y+4;
}
}
//this is the code in each object that stops the movement(slide is the character)//
onClipEvent (enterFrame) {
/:status = hitTest(_root.slide._x, _root.slide._y, true);
}
onClipEvent (enterFrame) {
if (/:status==true&&Key.isDown(Key.RIGHT)) {
_root.slide._x = _root.slide._x-5.5;
}
if (/:status==true&&Key.isDown(Key.LEFT)) {
_root.slide._x = _root.slide._x+5.5;
}
if (/:status==true&&Key.isDown(Key.UP)) {
_root.slide._y = _root.slide._y+4;
}
if (/:status==true&&Key.isDown(Key.DOWN)) {
_root.slide._y = _root.slide._y-4;
}
}
Well that works fine but it's not that smooth with that code in each object.
Character Movement
Is there any way to detect if both the up key and left key are down? I am making an animation where a character walks and I want to have a frame for each direction up, down and right and left is no problem but to detect if both the up and left keys are down doesn't work! Any suggestions?
Character Movement? Ne1 Pls
Hi,
I am really strugglin to find a solution.. ne help is much appreciated. I am using MX, I am trying to make a man walk around the screen using the arrow keys from a birdseye view. That all works but when no keys are pressed i would like the script to jump to a frame where there is a movie clip where the character looks up as if to say (i'm waiting) i can get this to work by telling the script to jump to frame label stop. The problem with this is that the stop label animation only faces one way so (say the stop animation movieclip is facing up) if you are walking down and then release the down key, the clip flicks to the up position and looks messy. How can i get the stop movie clip to face the way of the last key press?
I hope i have made myself clear?
here is the script i am using which is attached to the 'man' movieclip
onClipEvent (load) {
moveSpeed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.man.gotoAndStop("right");
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
_root.man.gotoAndStop("left");
this._x -= moveSpeed;
} else if (Key.isDown(Key.DOWN)) {
_root.man.gotoAndStop("down");
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
_root.man.gotoAndStop("up");
this._y -= moveSpeed;
} else {
_root.man.gotoAndStop ("stop");
}
}
Getting A Character From A String
Hello, peeps! Would someone please tell me how to get a character from a string, given its position? For example:
Code:
String = "abcdef";
getCharacter(String, 1);
//Returns "a"
Of course there's no such function as getCharacter();, I'm just trying to give an example.
Any help will begreatly appreciated!
Sincerely,
Furry
.txt Wont Allow Me To Use & Character
When I load a .txt file into flash everything is great, until that text uses the & character, and probably some others that I havent used yrt. Is there a reason and solution for this?
Pete
Flash MX + Character
Generic Question:
I'm pulling a string from a SQL database that may look like this:
"This is a + test string - ."
Now when I try to redisplay it in a dynamic text box my text comes out as:
"This is a test string - ."
My assumption is that since I'm doing : text_box.text = reponse.passed_variable.toString();
I've tried it without the .toString(); as well, no luck.
Getting The '&' Character To Appear In Load Txt.
Hi y'all,
I have a & character in the .txt file that I want to load from a flash movie, but somehow it doesn't appear. I've tried using %26, "&" but still it doesn't appear! Is that a restricted character in Flash or something? Any help would be most appreciated. Thanx!
Replace Character
the data comes from the database but i want to change all the B's to the figure 8 because of the crappy fint im using.
i know theres bound to be sometihng like: (link is the field)
onClipEvent (enterFrame) {
_parent.link = _parent.link.toUpperCase();
}
to convert everything to uppercase?
anyone
Incrementing A Character
code: var ch = 'A';
trace(ch++);
this outputs NaN, and not 'B', it's got me stumped, and it's late, any ideas?
dave
Choose Character
Hello everybody,
I'm working on a fla where you can choose your character (boy or girl) to navigate the site.
My initial idea was:
the user clicks on the boy or the girl
depending on what the user chose, the timeline lands on a certain frame and the movie clip on this frame calls in the image of either the boy or girl.
Howver is this the best way to do it?, or has someone out there got some amazing script that can make this happen better.
Please get back to me
K
Xx Stands For Xx? Xx Has To Be Any-character
Code:
if (VarEmail.indexOf(".", 0) == -1 || VarEmail.indexOf("@", 0) == -1 || VarEmail.indexOf(".xx", 0) == -1)
this piece of code saiz:
on inputfield VarEmail:
if you dont's have a dot, and don't have an @ and don't have xx behind the dot. it is 0
but xx has to be:
two characters that can go from a to z (twice, so aa, ab, ac, ad etc.)
somebody knows it?
-sam-
Character Code
is there anyone who can tell me where to find a list code of all characters in flash?
thankx
Catarina
Character Animation
I'm makin my first animation ever; I have drawn a character, each body part on a different layer; I was wondering what is the best way to animate her; should I keep every body part on a layer and then animat them all together or separate each body part in differents clips and switch clips whenever neccessary? Please help I wouldn't want to begin animating before I'm sure what is the best way. Thanks in advance
Character Animation
Hey gang howdy,
Ive created a cartoon characten withing illustrator and exported to swf.
Now im not sure what to do once ive got it in flash.
Do i need to convert my characted into a symbol to animate his hands and feet. How would i animate his body? Im so cofused
Any input is appreciated.
Character Gets Deleted
Hi
When sending variables from an email form in flash to my php script, the last character of the first variable always gets deleted eg:
var = foo
I get email with:
var: fo
any ideas?
Character Encoding
Have anyone experience in getting special characters like É
from a SQL database to display in a flash dynamic text field?
The characters have to go through pretty many stages before
reaching the endpoint. If anyone succeeded in this I would be
happy to recieve any suggestions at all.
The structure of my system is like this:
MySQL -> (SQL) -> Java Servlet -> (XML) -> Flash
I suppose if anyone got it to work in ASP or PHP it would
help to hear how you did it.
Thanks
XML And Character Encoding
I'm having trouble transfering characters like É and é from
a mysql database to java to flash through XML. Those characters
dissapear. What encoding should i use in the xml document for flash
to understand them?
Character Movement
I have a character that has a walking animation and I want that animation to play when the person presses left or right, along with ther character moving left or right this is what i have so far
__________________________________________
onClipEvent (enterFrame) {
speed = 5;
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
}
on (keyPress "<Left>") {
_root.character.gotoAndPlay(6);
}
on (keyPress "<Right>") {
_root.character.gotoAndPlay(2);
}
___________________________________
this works, the character moves from left to right and the walking animation goes, but after a while the walking animation seems to repeat the first frame or two, also how would i make it stop when he button isnt being pressed
Little Help With A Walking Character, Please :)
Hi,
I've got a character MC with this keyframes
2 to 25 = idle
27 to 43 = walk
and this code
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT))
{ _root.kuzgo = "goleft" }
else
if (Key.isDown(Key.RIGHT))
{ _root.kuzgo = "goright" }
else
if (Key.isDown(Key.UP))
{ _root.kuzgo = "jump" }
else
if (Key.isDown(Key.DOWN))
{ _root.kuzgo = "pick" }
else
_root.kuzgo = "idle" ;
}
Question - how do I have it walk when _root.kuzgo = "goleft" and idle, when _root.kuzgo = "idle".
If it write gotoAndPlay(27), it would hold on the 27th frame all time the key is pressed.
Thanx!
Arrow/character Next To...
How do i make a character like this megaman thing to move down or up when i hit the down arrow key? And when i hit enter make him fire the blast type thing?
http://uploads.ungrounded.net/conten...=0&w=470&h=400
Character Animation Gig Available
Looking for a character illustrator/animator for a 15-20 second animated fruit Flash animation. Job will occur in the next 30 days. If interested, please PM me with your portfolio examples and costs. Thanks!
Character Movement
Hey ive started on a little flash game, its just a 2D top down thing.
What im trying to do is being able to rotate and then walk in that direction.
I had up, down, left, right turning before but its not really what im after.
I have the rotation stuff working but it never moves in the exact direction your facing its normaly like 20 degrees off.
I know why this is but not how to fix it, and to fix it I need a different method of calculating the next x,y position.
Ok and the other thing to do with this is the hit detection to go with it, it needs to then calculate 3 points for left center and right positions of the character.
Character Movement
hie.. i'm still very new in flash...especially actionscript. I would like to ask about the actionscript. Currently, I'm developing an adventure game. I have design several characters already. How can I make them react to the key I press? (up - move up). I had created several layers of different movement so that it will look like a real walking. I really need your help, guys. Thanks~
|