String Wizard Needed
Is anyone smart enough to make a code that will take a string that is to be put into a dynamic textfield, and if the string is longer than 11 character make the textfield start a new line every time it sees a space in the string, unless the space is followed by ony one character?i believe it will involve a if(string.length > 11){for(i=0; i <string.length; i++){if(string.charAt(i) == " " && string.charAt(i+2) != " "){make the textfield start a new line!also set _y -= 12break; }}}How do i make it start a new line when all these conditions are satisfied? There must be a way!
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 01-26-2006, 07:35 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Actionscript Text Wizard Needed (help)
How do you tell the movie to wait until the actionscript portion of a movievlip has ended. It may be a stupid question but I have no idea how to do it.
P
I found a text effect engine that actually works when you change the font and that was a feat and half, in itself. Now the problem is I have some effects that I could use to do the credits of my movie but I can't make them behave. Some times they take forever to finish and sometimes they execute the effect really quickly. They always over lap each other.
Desired Outcome
I would like to use some cool effects for the credits for my movie, like a hollywood flick. (Any text effects wizards out there want to contribute please please email me.) If I could figure out how to tell the moive to stop wait this this instance on the stage is completed and then continue. I could make it work.
I think
Help Help help
String + Split.Help Needed
Hi
I have string being passed like
desc = "<a><b><c>9198865000241e482764-1fba-4049-848f-365de63e7f2d</
c>".
I have a As which will use split function & retrieve value:
"9198865000241e482764-1fba-4049-848f-365de63e7f2d".
It works fine till the num of tags is same.as soon as i insert one
more tag like <d>.i wont get the result.
My code is as follows:
public function getToken(desc:String):void{
var result:Array = new Array(desc.split(/</));
desc = result[0];
result= desc.split(/>/);
desc = result[3];
result= desc.split(/:/);
desc = result[0];
result= desc.split(/,+/);
desc = result[0];
Alert.show("4:"+desc);
}
What changes should i make so that the function retireves the value
even when many tags are inserted
Thanx in advance
Sheetal
Parsing String To Add Newline As Needed
ok. me not so good with the actionscript. I tend to get my languages confused.
I've got an XML nodevalue that needs to be put in a label component. Its working great until the text is longer than 58 chars. So I'm trying to write a little scipt to parse the string and add "newlines" as needed.
The script should check if the string is longer than 58 chars, if not just put the string in the labelcontrol.text. It does this great.
If the string is longer than 58 chars it should start looking for a space character at the 58th character and look backwards one character until it finds a space. Then it should slice the front half of the string off and put it in a new string variable. If the remaining string is more than 58 chars, it should repeat this process to find a break between lines 2 and 3. Recurssion stops there as there isn't enough room for more than 3 lines. <aside>Would a scroll box have been a better component choice? <end aside>
script so far.
//take care of linefeeds for stepDescription.text field
rawText = newSlideNode.firstChild.nodeValue;
rawTextLength = rawText.length;
breakpoint = 58;
if (rawTextLength > breakpoint)
{
while(charat(breakpoint) != " "){
breakpoint--;
}
substring1 = rawText.slice(0,breakpoint);
substring2 = rawText.slice(breakpoint++);
stepDescription.text = substring1 + newline + substring2;
}
else {
stepDescription.text = rawText;
}
Flash hangs if the string is longer than 58 chars. Does anyone see something obvious or not so obvious?
Thanks
bj
A Tini Bit Of Help Needed Parsing This String In Array
hi there....
im having trouble parsing this data in my array:
mainfoldernames[1] = ,banner,web
each mainfoldernames[X] = have "," in front
how can i remove the first "," i tried this:
mainfoldernames[1] = mainfoldernames[1].substr(1,mainfoldernames[1].length-1);
but it didn't work
any help?
Danny
Help Needed: French Characters In AS Text String..
Can anyone tell me why I cannot get Flash 8 to display the accented characters in the example below - I have tried cutting & pasting the copy from a UTF8 textfile, entering the characters directly using the windows alt commands, replacing characters with escaped unicode, stating usecodepage true etc.. none of which have worked?
Also the code needs to remain inline, so I am not looking to import the copy from an external source?
Code:
onClipEvent(load) {
this.myString = "Vous ętes le seul ŕ le savoir.";
}
Thanks.
HELP NEEDED With Sorting Query String Into Variable Array?
Hi,
I need to sort a query string with a number of variables into an array of variables..
Here is the query string being sent to the swf file:
order.swf&LOCT0=bedroom&LOCT1=dwelling&LOCT2=kitch en&LOCT3=landing
Below is the script im using:
Location = new Array;
for (i=0; i<"LOCT"; i++) {
Location[i] = eval("LOCT"+i);
It doesnt work! what is wrong in my script??? Please help!
thanks,
Shahid
Help Needed: Convert String To Number Not Working In .as File
Hi, Please anyone here to help me out?
I have this code in my loadxml.as file:
==================================================
function readXML(){
var origInvestment:String = "";
var origInvestmentUSD:String = "";
var TempNum:Number= 0;
origInvestment = String(arrCDN[0]);
//origInvestmentUSD = origInvestment;
TempNum = Number(origInvestment);
if (isNaN(TempNum))
{
origInvestmentUSD ="Has to Be a Number";
}else if (TempNum == undefined )
{
origInvestmentUSD ="Not Defined";
}else if (TempNum == 0)
{
origInvestmentUSD = origInvestment;
}
else
{
origInvestmentUSD = String(TempNum*0.86);
}
}
========================================================
After the input entered, say 100000 through the flash, I can get the output for "origInvestment" alright, but not the USD. Instead, I kept getting the NaN .
When I tried to used var TempNum:Number= Number(origInvestment); , I got "Not defined".
What did I do worng?
Your help is greatly appreciated.
Linecraft MXI Wizard
I have just finished working on this utility for extensions developers- Linecraft MXI Wizard.
It's been developed in Flash to assist in preparing .mxi files for the Exchange.
If someone here is into extending Dreamweaver/Flash/UltraDev please check this out and get back to me with your wishes/suggestions, if any.
If you are new to this stuff but still are interested -go ahead anyway, may be it'll help you to get started :-)
Thanks!
Alex Dzhulay.
Is Anyone A LineTo Wizard?
i don't know why but i just can't get the hang of lineTo...
i want a line to start at a given position draw gradualy to another position while turning with a curve at more positions and all this as a function (but mainly its the curve thats got me)
code:
function myLine (MC2_create,startx,starty,finishx,finishy,curve_po ints():array){
}
and then is it possible to reverse that?
any help or tutorials would be good...
Actionscript Wizard
I have done the tutorial called "Merry-go-round of Spinning Images found at http://www.kirupa.com/developer/act...era_panning.htm
it was a good tutorial. However, does anyone know how to use different images instead of just the one movie clip/button/graphic. i would like to use this effect but to have different pictures in each square for example.
If anyone can help I would be grateful.
I know that it is in the scripting, but can anyone tell me where the changes in the script need to be made in order to achieve this? or should i create diff layers for each diff image, attach the script to each layer and offset?
Thanks in advance.
Actionscript Wizard
I have done the tutorial called "Merry-go-round of Spinning Images found at http://www.kirupa.com/developer/act...era_panning.htm
it was a good tutorial. However, does anyone know how to use different images instead of just the one movie clip/button/graphic. i would like to use this effect but to have different pictures in each square for example.
If anyone can help I would be grateful.
I know that it is in the scripting, but can anyone tell me where the changes in the script need to be made in order to achieve this? or should i create diff layers for each diff image, attach the script to each layer and offset?
Thanks in advance.
Want To Make Wizard Flash
Hi guys,
well, I am not that far in flash, but i wana make a flash like a help wizard for example:
at the first frame it shows a question.. based on given options, the answer will give you more questions.. untill give you a statement.
how can I do this? or is there an open file I can use?
Thanks a lot
Actionscript Guider/wizard
I have worked with previous versions of MX before and as I remember it came with a box that popped up that sort of guided me. It game me a list of commands, sort of an index, that I used to have but lost. (It included a list of all the commands in alphabetical order). And say if I added something like gotoAndPlay it would have a box with drop downs and spaces letting me choose between things like frame, or scene, and then the frame/scene number. Whether or not it was a frame label etc. How can I get this back?
Data Connection Wizard
I'm trying to display data in Flash pulled from an Access database. I was using the tutorial on the Data Connection Wizard and just entering my own information. My web service connection works because it pulls up the right functions from my .cfc and the Data Connection Wizard appears to work fine but when I test the movie, no data shows up. I tested the .cfc by creating a dynamic table in a .cfm and it works perfectly. Here's the cffunction I'm trying to use
<!-- Get all the Guide info for guides in the SW Region -->
<!-- Used in directory.fla -->
<cffunction name="getSwGuides" access="remote" returntype="query">
<cfquery name="swGuides" datasource="guide" username="" password="">
SELECT *
FROM Profile
WHERE guideState = 'AZ'
OR guideState = 'NM'
OR guideState = 'OK'
OR guideState = 'TX'
</cfquery>
<cfreturn swGuides>
</cffunction>
Any ideas on what I'm doing wrong?
Data Connection Wizard
I'm trying to display data in Flash pulled from an Access database. I was using the tutorial on the Data Connection Wizard and just entering my own information. My web service connection works because it pulls up the right functions from my .cfc and the Data Connection Wizard appears to work fine but when I test the movie, no data shows up. I tested the .cfc by creating a dynamic table in a .cfm and it works perfectly. Here's the cffunction I'm trying to use
<!-- Get all the Guide info for guides in the SW Region -->
<!-- Used in directory.fla -->
<cffunction name="getSwGuides" access="remote" returntype="query">
<cfquery name="swGuides" datasource="guide" username="" password="">
SELECT *
FROM Profile
WHERE guideState = 'AZ'
OR guideState = 'NM'
OR guideState = 'OK'
OR guideState = 'TX'
</cfquery>
<cfreturn swGuides>
</cffunction>
Any ideas on what I'm doing wrong?
Flash Application Wizard
Hi all,
I like to create a wizard(flash application) where the user can select from the preset options like a template, icons, publishing type etc.,
My questions is to you all flash masters is how is it possible to create a code where the output is based on the user selection (The output maybe a exe, html)...
This is exactly the publishing command in the Flash application (CTRL+SHIFT+F12).
It would be grateful if you guys figure this one out.
Thanks and Regards,
Kishore
Why Isnt There A Wizard For This? (mp3 Player)
In frontpage (addin media player you can simply putt in the urls and it plays mp3's looks like shoot compared to my page but works.( in the mediaplayer in flash 8 you can only input one url. This sucks
Flash News Scroller Wizard
Hello,
I found this scroller at http://www.scriptocean.com
Does anyone knows how to import the final result into our flash movie (or site).
Thank´s a lot.
Guerreiro
[CS3] Help - Swf From Import Video Wizard Will Not Play
Hi,
I'm relatively new to flash and I'm currently using CS3. Here's the problem.
Any swf file I make "normally" on the timeline plays fine when uploaded.
But if I make a swf file from the import video wizard, it will only play locally but will not play at all when uploaded. This is true even if I directly naviagate to the swf file (i.e., www.mysite.com/somevideo.swf)
What the heck is going wrong here? I've tried smaller videos, I've matched the frame rates between the source movie and flash, and I don't know what else to do.
Any help is greatly appreciated!
Scott
Video/Audio Tuning Wizard
I have a video chat application written in Flash, running on FMS2.
What I would like is a Video/Audio Tuning Wizard, like the one in MSN Messenger, which people can go to to tune heir camera and mic before logging in to save them having to sort it once they are connected.
I could of course do this with an AV presence component but this needs to have a connection to the FMS server to run, which of course uses bandwidth and when I am paying for bandwidth it is undesirable when all that is needed is effectively a mirror!
Can anyone suggest how I may go about this without the need for a connection to the FMS server?
Data Connection Wizard, Edit The Array ?
Hi
I just started a project where XML is key..
I then thought I would use the data connection wizard..wow I found my xml file, made an array from it and stuffed the array in a datagrid..
Ok so far so good...
Now Im feeling a bit *stupid* cause there is no actionscript what so ever...
Much of my data is in the "true | false" form and I just send 0 and 1's from my database... but when I need to represent the data for the user it would be better (for the not so binary people) that the datagrid said "avalible or occupied" instead for 0 or 1 ..
Now the question:
How do I acces the array the data connection wizard sets up using the xml Connector and dataSet component so I can do stuff like:
for(i=0: i < Array.length : i++)
{
if(Array[i] = "1")
Array[i] = "avalible"
else Array[i] = "occupied"
}
what Im asking is what is the name of the array generated by the components.
Thanks guys!
Theory7 - Need Someone Who Is Wizard With Audio In Flash For Project
I need someone who is a wizard with audio in flash for a project starting immediatly, the project requires loading an mp3 file in flash, then cropping the audio file to specific start/end points and saving the new cropped file as a new mp3 file to the server, there is more to it than that, but these features are what will determine whether its even possible, as i'm not sure flash could even do this, if anyone knows different then I have paid work for you.
Can't Find Data Connection Wizard Original
I've run into this problem http://www.adobe.com/cfusion/knowle...cfm?id=60b46608
but I can't find step number 2 (Reinstall the Data Connection Wizard from the original MXP file)
You would think that they would provide you with a download link for it but they don't
Sandman9
Losing Sound When Importing Mpeg2 Into Fla Using Wizard
Hi
I have a mpeg2 file from a DV camera. When I import this video into Flash 8 professional using the wizard I lose the sound, but if you could lip read, the video is really clear.
Do I need to convert the mpeg2 into another format before importing to flash? Is there somthing I am missing here?
I have read the help video files and have used video playback component before without problems.
Any help appreciated
Can't Find Data Connection Wizard Original
I've run into this problem http://www.adobe.com/cfusion/knowled...fm?id=60b46608
but I can't find step number 2 (Reinstall the Data Connection Wizard from the original MXP file)
You would think that they would provide you with a download link for it but they don't
Sandman9
How To Build A Flexible And Scalable Wizard In Flash
I've built a flash application that contains a wizard. I don't describe the details of the flow of the wizard here now as the wizard is just like the normal wizard that we see in other applications. To generalize, let me describe the elements in the simplest form:
Step1 contains the following:
Label 1
Graphic 1
Next Button
Step 2 contains the following
Label 2
Graphic 2
Next Button
Back Button
Step 3 contains the following
Label 3
Graphic 3
Back Button
Well, it's straight forward to write sth like that to build the wizard by starting like this:
var setpCount = 0;
label2._visible=false;
label3._visible=false;
backBtn._visible=false;
graphic2._visible=false;
graphic3._visible=false;
Then, when the next/back button is clicked, increase/decrease the stepCount respectively and control the visibility of the elements.
This approach is the most straight-forward and surely it works. But I wanna make the wizard to become CLEAN, and more maintainable and scalable. That is to say, is there any way to make the wizard more generic, so that I don't need to code xxx._visible=true, xxx._visible=false whenever any elements are changed? I'd be appreciated if any design pattern or methodology could be suggested!
Flash Popup Wizard: Opening New Browser Windows From Flash?
Hello,
I once found a plug in for flash that allowed me to specify the size/position of the popup. The interface was orange. I have a different computer now, and can't find that plugin.......Any chance anyone know the name of the plugin so I can search for it?......Thank you....
Component Wizard = Trace("help");
i am a bit stumped as to how i can update the items of a dropdown list.
in theory this should be working but will only assign [board_styles] once
Something like an upDateAfterEvent for set components?
THIS IS THE METHOD
Code:
function comboDisplay5(component) {
Stylez_Var = component.getSelectedItem().label ;
}
Stylez.setChangeHandler ("comboDisplay5") ;
AND THIS IS THE EVENT TO CHANGE THE LIST ITEMS
Code:
mal.onPress = function(){
trace(radio);
board_styles= new Array ("mal1", "mal2", "mal4");
for (i=0;i<board_styles.length;i++) {
Stylez.addItem (board_styles[i]) ;
}
}
mar.onPress = function(){
trace(radio);
board_styles= new Array ("mar1", "mar2", "mar4");
for (i=0;i<board_styles.length;i++) {
Stylez.addItem (board_styles[i]) ;
}
}
I have re-gigged lots but still do not get the prefered result. I would love a hand if anyone knows offfhand...
these mar and mal can be in a radio group...
Hope this makes some sense..
cheers
Error 2101: The String Passed To UrlVariables.decode() Must Be Url-encoded Query String
I am trying to make a flash contact form which will submit the firstname, lastname, email and comments to an asp.net page.
I am have having the following error:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
I am using the following action script code as pasted below. This action script is communicating with an asp.net file to send the email out. In the end it responds back with response=passed or failed.
I have already spent around 3 hours figuring it out.. and looking through the internet for resolution but no luck. Any help will be appreciated.
stop();
submit_btn.addEventListener(MouseEvent.CLICK, submit);
function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.firstname = firstname_txt.text;
variables.lastname = lastname_txt.text;
variables.email = email_txt.text;
variables.comments2 = comments_txt.text;
var req:URLRequest = new URLRequest(”emailacount.aspx”);
req.method = URLRequestMethod.POST;
req.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);
status_txt.text = “Sending…”;
}
function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
firstname_txt.text = “”;
lastname_txt.text = “”;
email_txt.text = “”;
comments_txt.text = “”;
}
function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}
and the following asp.net code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Try
Dim fromEmailAddress = "paul@lancierinc.com"
Dim toEmailAddress = "rizwandar@gmail.com"
Dim firstName = Request.QueryString("firstname_txt")
Dim lastName = Request.QueryString("lastname_txt")
Dim comments = Request.QueryString("comments_txt")
Dim userEmail = Request.QueryString("email_txt")
'create the mail message
Dim mail As New MailMessage()
'set the addresses
mail.From = New MailAddress(fromEmailAddress)
mail.To.Add(toEmailAddress)
'set the content
mail.Subject = "Email from" & firstName & " " & lastName
mail.IsBodyHtml = True
Dim strBody As String = "<b>Email from</b>" & " " & firstName & " " & lastName & "<br><b>Email Address:</b> " & userEmail & "<br><b>Comments:</b> " & comments
mail.Body = strBody
'send the message
Dim smtp As New SmtpClient("mail.lancierinc.com")
smtp.Send(mail)
Dim urltoencodestring2 = "response=passed&err=0"
'Response.Write(urltoencodestring2)
Catch smtpEx As SmtpException
'A problem occurred when sending the email message
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "'")), True)
Response.Write(smtpEx.Message)
Dim urltoencodestring = "response=failed&err=1"
'Response.Write(urltoencodestring)
Catch generalEx As Exception
'Some other problem occurred
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "'")), True)
Dim urltoencodestring3 = "response=failed&err=1"
'Response.Write(urltoencodestring3)
End Try
End Sub
</script>
String Passed To URLVariables.decode() Must Be A URL-encoded Query String...
I really don't understand why this won't work? I've made a test which sends some POST data to a script on my page which works fine. But why does not this work?
Code:
var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
var names = "Zomis_AI6";
var description = "descr";
var result = "gameresult";
var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
trace(upldata);
var variables:URLVariables = new URLVariables(upldata);
var request2:URLRequest = new URLRequest();
request2.url = "http://www.zomis.net/record.php";
request2.method = URLRequestMethod.POST;
request2.data = variables;
var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, uploadcomplete);
try {
loader2.load(request2);
trace("Loaded");
}
catch (error:Error) {
trace("Unable to load URL");
}
Tracing gets:
Code:
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Randomize String And Create Textfields With String Txts
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
Convert Multiline String To A One Line String With RegExp
better get my own thread for that
How can I convert a multiline String to a one line String?
EX:
PHP Code:
Testing is always full of man made bugs.
<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank">
<font color="#22229C">Believe</font>
</a>
me when times comes that you have to
<a href="http://www.vreate.com" target="_blank">create</a>
useless stuff to test some other useless stuff to have
<a href="http://www.vreate.com">some</a>
real results.. its a pain.
<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/>
<em>Got to try that stuff to eventually love it one day.</em>
and should result in
Code:
Testing is always full of man made bugs.<a href="http://www.betterthannothing.com" title="betterthannothing" target="_blank"> <font color="#22229C">Believe</font></a>me when times comes that you have to<a href="http://www.vreate.com" target="_blank">create</a>useless stuff to test some other useless stuff to have<a href="http://www.vreate.com">some</a>real results.. its a pain.<img src="http://www.markval.com/deerPack.jpg" height="484" width="352"/><em>Got to try that stuff to eventually love it one day.</em>
I think it have to play with the ^ (caret) and m (multiline) ... just need to put the puzzle together.
String.as (Fishing Line Or Kite String)
Hello everyone. After reading the article on Glen Rhodes (Proud Canadian) I was wondering exactly how to insert the string.as file. I have been having huuuuuuge speed issues with my code. My file sizes are quite small (40 - 60 k)but they are very sluggish.
Thank you......
Please help
http://www.moodvibe.com
Trouble With String.indexOf And String.lastIndexOf
Hi,
I have an input text field used for time. I'm trying to set it up so the user has to enter a valid time into the box.
I set the box to be only 5 characters in length and to only use numbers and the ":" character.
I thought this code would insure there wouldn't be two ":" characters and the ":" would be at lease one character from the begining and at least two from the end.
But the if you enter 2:321 it comes back as a valid time.
Thanks in advance,
thurston
Code:
if(string.indexOf(":", 1) == string.lastIndexOf(":", string.length-3) ){
trace("Valid Time");
}else{
trace("Invalid Time!!!");
}
Changing A String Name In A Loop / Concatonating String Name?
Hey all,
Does anybody know of a way to change a string name as a loop proceeds?
This is the main piece of code that I wish to loop with i incrementing, so that whilst i=0 then:
_root.barARed._visible=barRed[i];
_root.barARed._width=barLength[i];
_root.barAYellow._visible=barYellow[i];
_root.barAYellow._width=barLength[i];
_root.barAGreen._visible=barGreen[i];
_root.barAGreen._width=barLength[i];
infoA.text=info[i];
and i=2 then:
_root.barBRed._visible=barRed[i];
_root.barBRed._width=barLength[i];
_root.barBYellow._visible=barYellow[i];
_root.barBYellow._width=barLength[i];
_root.barBGreen._visible=barGreen[i];
_root.barBGreen._width=barLength[i];
infoB.text=info[i];
and so on...I would use _root.barRedInstanceName[i]._visible=barRed[i]; but I can't give the movie clip (the bar) an instance name such as redBar[1], redBar[2] etc. (system reserved I'm told)
I guess what I am trying to ask in a roundabout way: is how do you concatonate the name, rather than the contents of a string?
Hope you'll forgive me if this is something really simple that I am overlooking, but I only have a very short experience of flash.
Thanks
Al
Ball Bouncing On String: Getting The String To Be Bigger?
I have a black line which is simply a movie clip and a yellow circle which is also a movie script. The ball works great, it bounces on the bottom of the movie, and you can pick it up and throw it around. So now I want to attach the ball to the black line. So:
1. How can I make it so that the top part of the line will stay in one position, and so that a bottom part of it will move around? Is there any way I can link the two at a certain point so that wherever the ball goes the line will stay attached to it at that point?
2. In an attempt to try and reach this point I came up with this script in the ball for when it is not being dragged anywhere. The most important bit is really the bottom:
ActionScript Code:
} else {
old.x = pos.x;
old.y = pos.y;
pos.x = _x;
pos.y = _y;
vel.x = (pos.x-old.x)*2;
vel.y = (pos.y-old.y)*2;
//Finds the change in position and adds that as an extention to the line:
_root.ballstring.height += (old.y - pos.y);
Anyone reckon they could help me out? Thanks!
Keeping A String A String With Dynamic Text
I've got some dynamic text (from MYSQL & ColdFusion) that needs to be kept as a string and is (i think) being converted into a number.
The recordset is returning 8'6" (eight feet, six inches)
and my dyn text box displays 86.
Anyway around this from within Flash? I know you can strict data type in AS 2.0 but no chance of migrating this project to 2.0!
What's The Best Way To Parse Out A Url String Using The String Object In Flash
I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.
In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.
For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com
If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.
Does flash have an object that deals with Regular Expressions?
I've looked at the String object in flash but not sure how to achieve this task
I'm currently working on this so any ideas?
Convert Html String To Xhtml String
Anyone know of a great way to convert an html string format from flash into a resembalnce of xhtml for outputing to a server or a direction i could go in to do this.
Thanks
Randomize String And Create Textfields With String
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
Pass A String, Return Object With Name String
I feel like this should be pretty easy, but I 'm not quite sure how to do this...
I've got a string that is the name of a movieclip which is on the stage. I'd like to write a function which I can pass that string and have it return the object which has the instance name of that string.
Any hints?
Thanks.
John
What's The Best Way To Parse Out A Url String Using The String Object In Flash
I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.
In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.
For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com
If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.
Does flash have an object that deals with Regular Expressions?
I've looked at the String object in flash but not sure how to achieve this task
I'm currently working on this so any ideas?
Convert Html String To Xhtml String
Anyone know of a great way to convert an html string format from flash into a resembalnce of xhtml for outputing to a server or a direction i could go in to do this.
Thanks
Randomize String And Create Textfields With String
Hi,
is there some easy method to randomize elements of an array (to randomize index numbers) and create textfields with name of these elements ?
I had no problem making a photo gallery with strings but now I have to do a menu , with spacing (there should be same space between all the words of an array generated textfields)...How can this be accomplished ?Thanx in advance, Meerah
Complex String.split And String.substring
Hey, Im an actionscript newbie and am having a little tourble with a string.
I have a string variable containing the value:
myString = "Johnny Lewis, Danny Lopez, Alex Prince, Sandro Lee, Nick Salvage"
What I want to do is trim their last name so it only shows their first initial, so it would be converted to:
myStringTrimmed = "Johnny L, Danny L, Alex P, Sandro L, Nick S"
So im guessing I need to split it by the commas, then split those again by the blank space.
The only problem is that this variable will be dynamic and the number of people in the variable will always be different. Sometimes there will only be one name, sometimes as many as five.
Any help would be much appreciated.
String = String + If(string.length) ... + String
A few languages have an IIf() statement, which works like the if statement, but is good for use inside of strings.
Flash 8 apparently doesn't have it, but I tried something similar to this..
Code:
_global.mStruct.mString = "My first name is " +
mf.text + if(mi.text.length > 0) { ". My middle initial is " + mi.text} +
". My last name is " + ml.text + "."
And I get
"Operator '+' must be followed by an operand", referring to the red + above.
Is there a way to do this, or do I need to just break into seperate if statements and appending the value to the value of the textbox?
Thanks for any help.
String Manipulation : Pad A String.length
hi,
i have an array of track/artist titles
_level0.trkList = [object #218, class 'Array'] [
0:[object #219, class 'Object'] {
label:"Jeff Beck - Space for the Papa",
data:"spacepapa.mp3",
__ID__:0
},
1:[object #220, class 'Object'] {
label:"Jeff Beck - Another Place",
data:"anotherplace.mp3",
__ID__:1
},
i wish to add the array to a track info listbox component,
in such a way that the individual items in the array are
padded with spaces -" ", so as the length of the shortest
string equals the length of the longest string,
my listbox output is now -
Jeff Beck - Space for the Papa| * from time array
Jeff Beck - Another Place| * from time array
by adding spaces i would like it to be-
Jeff Beck - Space for the Papa| * from time array
Jeff Beck - Another Place"""""""| * from time array
does anyone know how to do this ?
many thanks for any help,
LoadMovie - Target String Or Not String?
I'm trying to figure out what the major differences and/or uses for using a target as a string with double quotes or without quotes...
For example whats the difference between the following 2 lines?
1. loadMovie("products.swf",_root.dropZone);
2. loadMovie("products.swf","_root.dropZone");
I know the target in the second line is a string and the target in the first line is a MC object(?). Any other major uses for these 2 variations?
|