Creating Text File - Or - "Beating A Dead Horse"
Hey Folks,
Please forgive me for revisiting this often-asked question, but...
I just installed Flash MX 2004, and was wondering if there was any new functionality that allows the developer to create and write to an external text file.
From what I've read, this is possible using PHP, ASP, etc... Though, that requires access ta a PHP or ASP web server - something I don't want to set up at this time. So, I guess I'm asking if there is any way to create/write a text file without the help of PHP, ASP, or a web server?
I'm inserting the movie in VB and using FSCommand to communicate between the two - Flash input, VB create the file. This works, but is not very elegant, not efficient, can't run it in IE, etc...
Can you do it using XML? Any other suggestions?
Thanks A Lot,
FlashKit > Flash Help > Flash MX
Posted on: 12-19-2003, 11:00 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
I Know Im Beating A Dead Horse.....
But someone has to have an idea
Here we go
Ok, I have a flash movie, this flash movie is a map with 52 movie clips, they all have an instance name of "section" with a number after it IE: section0 section1 and so on. Ok, In the main coding of my movie I have XML that passes thru ASP that changes the color of the movie clips depending on the variable that is in my database. I use SQL. Here is the coding in my movie
"
/* function sectorArray(){
var msectors, varColor, sid, ftxt
for(i=0;i<=rcrXML.childNodes.length;i++){
if(this.childNodes[i].nodeValue == null && this.childNodes[i].nodeName =="sectors"){
msectors=this.childNodes[i];
}
}
var msector
for (q=0;q<=msectors.childNodes.length;q++){
if(msectors.childNodes[q].nodeName=="sector"){
msector=msectors.childNodes[q];
sid=msector.attributes["id"];
for(j=0;j<=msector.childNodes.length;j++){
if(msector.childNodes[j].nodeName=="color"){
varColor=msector.childNodes[j].firstChild.nodeValue;}
}
changecolors(varColor,sid)
}
}
}
function changecolors(varColor,sid){
ftxt=new Color("section"+sid)
ftxt.setRGB("0x"+varColor)
}
rcrXML = new XML();
rcrXML.ignoreWhite = true;
rcrXML.onLoad = sectorArray;
rcrXML.load("zRcrXml.asp?mdsid=2")
stop ();
||||||
That is the code INSIDE the movie. My actual xml/asp file has this
"
<%option explicit
dim cn, rs, sql
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Response.Buffer = true
sql="SELECT * FROM vw_RCR_Mapdata WHERE mdsid = " & request.QueryString("mdsid") & "; "
'Response.Write sql
'Response.End
cn.Open "provider = SQLOLEDB.1;Initial Catalog = OGToolsDb; Data source = Webapps; user id=fsfxsb07; password = "
rs.Open sql,cn
%><?xml version="1.0" encoding="iso-8859-1"?>
<sectors>
<%
do until rs.EOF%>
<sector id="<%=rs("secid")%>">
<rcr>"<%=rs("Rcr_Value")%>"</rcr>
<secname>"<%=rs("Name")%>"</secname>
<%'Check for runway surface conditions for this secid
'Response.Write rs("secid") & ", "
'Response.Write rs("Rcr_Value") & ", "
'Response.Write rs("Takeoff_Landing") & ", "
'Response.Write rs("WaiverThreshold") & ", "
'Response.Write rs("TaxiThreshold") & ", "
if rs("secid") = 0 or rs("secid") = 5 then
'Comparison between takeoff threshold for the runway and rcr
if rs("Rcr_Value") < rs("Takeoff_Landingcaution") then
if rs("Rcr_Value") >= rs("Takeoff_LandingRed") then
'Assign yellow as the color
%><color>ffff00</color><%
else
'Assign red as the color
%><color>ff0000</color><%
end if
else
'Assign green as the color
%><color>00ff00</color><%
end if
else
'Comparison between taxi threshold for the rest of the airfield
if rs("Rcr_Value") < rs("Taxicaution") then
if rs("Rcr_Value") >= rs("TaxiRed") then
'Assign yellow as the color
%><color>ffff00</color><%
else
'Assign red as the color
%><color>ff0000</color><%
end if
else
'Assign green as the color
%><color>00ff00</color><%
end if
end if
rs.Movenext
%></sector><%
loop
%></sectors><%
rs.Close
cn.Close
set cn = nothing
set rs = nothing
*/
||||||||
My question being, there has to be some way possible, to make a code that allows me to mouseover any of the movie clips, and they display the variable in the database that corresponds to their individual section number
Or am I just not going to get it cuz its not possible????
XML Resize Thumbs (hope I'm Not Beating A Dead Horse)
Hello everyone! I've been all through these 60 some pages on this subject and didn't find what totally what I was looking for... of course eye strain might be a problem so if there is a thread to something I ask please tell me. I apologize in advance if I do. This is my first ever thread also.
Here is a zip of all my files so far. http://marazita.com/funstuff/gallery.zip First here is the link to Scotty's thumb resize that I've put into my .fla. V3_with_thumbs zip Mine doesn't work because what I'm trying to do is make the thumbs replace the mc's that I've added (each with an instance name thumb1, thumb2, etc.). As an artist I like to group images that belong in a group. Sometimes a group can have 3 sometimes 4, etc.. This is what's been wrong with what I've found in the threads so far. They've just been lumped into a certain amount to columns and rows. If you look at my files you'll understand better. I was also hoping that the thumbs would load like this zipped file http://marazita.com/funstuff/gallery_preloadthumbs.zip (which is another nice dynamic loaded one that you don't have control over either). Any help will be greatly appreciated and at the end I'll post my finished file to share with everyone since I've gained so much from this site I would like to also give back. This will help a lot of artists out there I'm sure. Thanks to all that help in advance. I have other questions... but lets do baby steps at first.
-Justin-
www.marazita.com
Help With Loading External Movie Clip(beating A Dead Horse)
Hello folks, I seem to have run into some problem with a project of mine. I have a Main movie which loads multiple external movies. I am using an empty movie clip called contents to load them into.
one of my external movies has a button in it that launches a centered pop up window(kirupa tutorial). This external movie named site works perfectly by itself, but when loaded into the main movie, the button does not work. I'm using:
on (release) {
_root.contents.loadMovie("site.swf");
}
any input would be greatly appreciated.
Help With Loading External Movie Clip(beating A Dead Horse)
Hello folks, I seem to have run into some problem with a project of mine. I have a Main movie which loads multiple external movies. I am using an empty movie clip called contents to load them into.
one of my external movies has a button in it that launches a centered pop up window(kirupa tutorial). This external movie named site works perfectly by itself, but when loaded into the main movie, the button does not work. I'm using:
on (release) {
_root.contents.loadMovie("site.swf");
}
any input would be greatly appreciated.
[Dead Horse Ver 2.0] I Need Your Help Once More Scotty [Or Anyone]
This is for Scotty or anyone who can help. I've had this photogallery done for quite some time now. You can see it live here: www.marazita.com/art.html
I'm just starting to feel bad for people that have dial-up because they have to wait for every image to load to see the last ones.
I would just like to add another preloader for the main image in the center. The thumbs can still keep the semi-transparent loader to show the thumbs loaded but I would like a dynamic loader for the main image. I have all the files attached in the zip for one gallery including the xml file, thumbs, images, and pre-loader I would like to use. I just don't know how to change the actionscript in .fla... I've been pretty rusty lately since I've been doing mostly print work instead of web work.
One last thing is there a way that if the image has already been loaded before that the loader won't show up again?
Thanks a million,
-Justin-
*EDIT since the file size is larger then you can attach here you can upload it from my server here:
http://www.marazita.com/web/all_gallery.zip
The Ghost Of A Sound File? Keeps Coming Back From The Dead
Okay, so I download this totally amazing set of sound files. They're miscellaneous machine gun and rifle sounds, if it makes a difference. So, I take them into QTPro, and edit out everything but one second of the clips. Don't need more than that. So, I have three clips, all different, all 1 second long. I exported them as MP3's, since that's the original format they were in. In QuickTime, they play for 1 second. In iTunes, they play for one second. In Flash, however, they play the full 6.8 seconds, 12.1 seconds, and 40-some odd seconds! What gives? I mean, I trimmed them, and exported them as different files and filenames! Anyone know what happened?
-Thanks in advance,
[edit: spelling]
Creating My OWN Text Scroller For Text Loaded From A .txt File?
im loading my text from an external .txt file... and i know how to make a regular flash component scroller scroll this... but how would i make MY OWN text scroller... just like an up and down arrow...
i tried the one in the kirupa tutorials but it was for flash 5 and it didnt work for me...
Scrolling Text Stops Dead
I am trying to build a tickertape in Flash MX 2004 that would crawl along the bottom of a page. (I'm doing it in Flash, not DHTML, because I want it to be in a certain font, not generic HTML text.)
I have a rather long list of words that need to crawl along the screen, and then it needs to loop seamlessly back to the beginning, infinitely. The code at the bottom of this message, which is based on something I found at Flashkit, is supposed to do just that.
The text does loop, but I find that the scroller always stops dead as soon as the first word reaches the far left edge of the text box. In my example, it happens when the word “Advertising” appears for the *second* time in the loop.
You can see how it performs at:
http://www.sullivancreative.com/webs.../home-new.html
Can anybody recommend what I might do to this code to get it to work? Or recommend an alternate means of getting this technique in Flash?
Thanks.
code:
FRAME 1:
on(rollOver){
stop();
}
on(rollOut){
play();
}
on(press){
// 0=true/false toggle
// 1=work/work.html
// 2=parent
var arr=cat.split("~");
if(arr[0]=="true"){
getURL(arr[1],arr[2]);
}
}
FRAME 2:
if(delayFlag==false){
if(scroller.length>=view){
scroller.text=scroller.text.substr(1,view-1);
}
scroller.text+=theText.charAt(last);
delayFlag=true;
}
FRAME 3:
if(delayFlag==true){
if(getTimer()>=sDelay){
var sDelay=int(getTimer()) + int(sParam);
delayFlag=false;
if(last<theText.length){
last++;
}else{
last=0;
}
gotoAndPlay(2);
}
}
gotoAndPlay(2);
Creating A Text File With PHP
I want a user to type in an input book and when they pree send it posts it onto the site, so that everything they worte can be viewed by anyone. I know PHP is required to do this but i seem to have a problem which won't let it work.
This is what i have in my PHP:
<?
$fp = fopen ("$user_name", "w+");
fwrite($fp,"$text");
fclose($fp);
if ($fp) {
echo ("&erro=NONE&msg=A Success!");
} else {
echo ("&erro=OK&msg=Error!");
}
?>
This is what I have in the botton on flash:
on (release) {
loadVariablesNum("http://www.kotrclan.com/main/text.php", "", "POST");
url = "http://www.kotrclan.com/main/"+user_name;
nextFrame();
}
I have no clue where i went wrong. I think it might be the CHMOD on the files, I know that PHP has too be rwxr-xr-x and the folder has to be rwxrwxrwx is there a problem anywhere here, can u help me guys. Thanks for even reading this
Creating A Text File With PHP
I want a user to type in an input book and when they pree send it posts it onto the site, so that everything they worte can be viewed by anyone. I know PHP is required to do this but i seem to have a problem which won't let it work.
This is what i have in my PHP:
<?
$fp = fopen ("$user_name", "w+");
fwrite($fp,"$text");
fclose($fp);
if ($fp) {
echo ("&erro=NONE&msg=A Success!");
} else {
echo ("&erro=OK&msg=Error!");
}
?>
This is what I have in the botton on flash:
on (release) {
loadVariablesNum("http://www.kotrclan.com/main/text.php", "", "POST");
url = "http://www.kotrclan.com/main/"+user_name;
nextFrame();
}
I have no clue where i went wrong. I think it might be the CHMOD on the files, I know that PHP has too be rwxr-xr-x and the folder has to be rwxrwxrwx is there a problem anywhere here, can u help me guys. Thanks for even reading this
Creating Text File
i need to make the game i am working on create a .txt file into a directory called "files" when it reaches a certain page.
in the .txt file also needs to be written "highsores disabled"
can this be done??
Creating A Text File
How could I create a text file from Flash???
All I've been able to do is to open an existing textfile and read the variables and its values. But what I really need to do is as follows:
1. Create a text file. (from Flash - without ASP or PHP programming because the animation will be executed from a local folder, not in Web).
2. Save the variables' names and values obtained from the Flash execution.
Does anybody know how could I do that? confused;
Please, let me know if that's not possible using only Flash.
Thanks,
WILMER
Creating A Text File
i remember reading somewhere that it is possible to create a text file from flash based on input from a text field. Im sure it was here but i cant find it. Can anyone point me towards a tutorial or similiar? Unless of course i just made the whole thing up. Cheers.
Creating A Text File
i remember reading somewhere that it is possible to create a text file from flash based on input from a text field. Im sure it was here but i cant find it. Can anyone point me towards a tutorial or similiar? Unless of course i just made the whole thing up. Cheers.
Dynamic Text Wont Play Dead
hello,
i've got a dynamic text box inside a movie clip, but when i fade this clip out in the main movie the text remains?? but the graphics go as you would expect...a bit like the cheshire cat with its insane grin
jolly
Dead Space On Text Fields (how To Remove)
Greetings all,
I'm having an issue whereby I need to stack lines of text on top of each other. Each line is a separate text field and can be scaled at different font sizes by a slider component. When text enlarges in size in the text field, it pushes lines below it down. That much I have working.
However, all the text fields I create seem to have dead vertical space. By that I mean there is a significant gap between the edge of the top and bottom of the text pixels and the border of the text field - and this space seems to scale depending on the font size of the text.
I would like to completely eliminate this dead space and have the borders of the text field come down to exactly the height of the text itself. Or at least figure out how to define how much dead space there will be when the text is at a certain size so I can shift the text boxes vertically by the right amount (effectively counteracting it in the actionscript) and make only a pixel or two of gap between each line.
Anyone know of a method or strategy I could try? (I'm using as3)
Cheers!
Mj
(ps. textHeight when I tested it seems to be reading neither the height of the text pixels nor the space between the borders. It was somewhere in between, which confuses me no end.)
Creating A Link From Text File?
hey all....I need to create a link inside a text file that a button inside the swf can read and use because I will need to have the user change the link often. I figured that this would be the easiest way to have the client do this. Specifically here what it is...
- a text file containing the changeable link
more importantly:
- a button IN flash that reads this text file and associates the text(link)with the button...(dynamically)
- I'm thinking that it will be the getURL function calling a text file???
Any body have an idea? I tried the loadVariable/text method to no avail! HELP!
Thanks!!!!!!!
- Sigma
[Edited by Sigma on 10-11-2001 at 02:19 AM]
Creating Text File From Flash
I am interested in outputting the variables in my timeline to a text file. I had heard some time ago that there is an easy, "undocumented" way to do that in Flash. Supposedly, what you get is a text file with all your name value pairs, one after the other. It's not pretty - but it works.
Any ideas on how to do this? Does MX provide a better way to do it?
Creating A Text File With Flash 5
Hey there,
Is it possible to create a text file to write variables to using Flash 5 ? I know you can with MX, but the device I'm developing for only has Flash 5 player.
A longer shot... Can it be done with Flash 4 ?
Big lub,
sca xxx
Form Creating Text File
i am creating a standalone kiosk that will sit on a pc at a conference. the file will be published as an executable application. in this file there is a form that visitors can input information. my client wants this information to be written to text files and saved on the machine so they can get the information later. question is, is there anyway to create a text file from a form and save it to the harddrive without using php, etc? if not, is there anyway to trick php (or something else) into doing this?
any help is appreciated.
Creating A Text File From Projector
From the research I've done it looks like I need a third party program to do this. Shared objects won't work because I need it to be easy to transport this project from one computer to another and sof files are pretty hidden.
Is there a program that any of you would recommend? *********** seems pretty cool, and does a bunch of other stuff too.
Any advice would be appreciated. Thanks
Also, if anyone knows of a way to do this on a mac projector that would be awesome.
Creating Text File Using VB Script
I use the following html code to create a txt file when user submit the swf file. All works well on machines running Flash 7 Player. However the fscommand do not run the VB script when running on machines with Flash 8 Player, even if I change the allowScriptAccess="sameDomain" to allowScriptAccess="always"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Customer Delight Pre_Assessment</title>
<SCRIPT LANGUAGE="VBScript">
dim filesys, newfolder, newfolderpath
newfolderpath = "c: extfile"
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
Response.Write("A new folder has been created at: " & newfolderpath)
End If
Sub assessment_FSCommand(test,username)
Dim oFilesys, oFiletxt, sFilename, sPath
Set oFilesys = CreateObject("Scripting.FileSystemObject")
Set oFiletxt = oFilesys.CreateTextFile("c: extfile"&username&". txt", true)
sPath = oFilesys.GetAbsolutePathName("c: extfile"&userna me&".txt")
sFilename = oFilesys.GetFileName(sPath)
oFiletxt.WriteLine(test)
oFiletxt.Close'
end sub
</script>
</head>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="800" height="600" id="assessment" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="main.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="main.swf" quality="high" bgcolor="#ffffff" width="800" height="600" name="assessment" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
Utility For Creating An XML Doc From A Text File?
Hello all,
I have an XML document for a slideshow. Contains a image and a caption node. I have taken the directory of the images and created a text file. Is there an app (OS X preferred) that can convert these to nodes? I have tried getting Jhead to work (it works with photo EXIF info) but with no luck. Thanks!
-Patrick
Creating Buttons From A Text File
This code doesn't seem to be working...
Any takers?
Code:
function loadPageLinks(loadIt){
loadVarsText = new LoadVars();
loadVarsText.onLoad = function(success){
if(success){
_global.linkArray = this.links.split(".");
trace(_global.linkArray.length);
len = _global.linkArray.length;
for(var i=0; i<len; i++){
nameIt = _global.linkArray[i];
createEmptyMovieClip(nameIt, getNextHighestDepth());
nameIt.createEmptyMovieClip("holder", getNextHighestDepth());
nameIt.holder.createTextField("link_text", getNextHighestDepth(),2, 2, 90, 30);
nameIt.holder.linky_text.text = _global.linkArray[i];
nameIt.holder.linky_text.setTextFormat(bottom_link);
nameIt.hitArea = _global.linkArray[i];
}
}
loadVarsText.load(loadIt);
}
}
Creating An Array From A Text File....
Please can someone tell me where I'm going wrong here?
I'm close I'm sure of it but it's telling me that it cannot convert the file to an Array....
//MAKE AN ARRAY FROM TEXT FILE.......
//var trackNames:Array = ["", "They.mp3", "Lullabye.mp3", "Out of the Dark.mp3", "Sunshine Master.mp3", "Defender.mp3"];
var trackNames:Array
var mp3Array:TextField = new TextField();
var mp3ArrayRequest:URLRequest = new URLRequest("mp3Array.txt");
var mp3ArrayLoader:URLLoader = new URLLoader();
mp3ArrayLoader.load(mp3ArrayRequest);
mp3ArrayLoader.addEventListener(Event.COMPLETE, mp3ArrayReady);
function mp3ArrayReady(event:Event):void
{
trackNames = event.target.data;
}
Thanks for your help,
DGL
Utility For Creating An XML Doc From A Text File?
Hello all,
I have an XML document for a slideshow. Contains a image and a caption node. I have taken the directory of the images and created a text file. Is there an app (OS X preferred) that can convert these to nodes? I have tried getting Jhead to work (it works with photo EXIF info) but with no luck. Thanks!
-Patrick
Creating Text File From Flash
I heard some time that there was an easy, "undocumented" way to create a text file in Flash. Supposedly, you can output all your variables into the text file with one step.
Is this actually the case?
CREATING A TEXT FILE WITH HTML STATMENTS
Hello,
this is a complex one (for me anyway). on a particular host there is no Database support. So I decided to use text files that flash reads (no problem so far).
Now I would like to do something a little bit further. I would like to have a flash page where you can literally edit text, and it creates a text file or ammends an existing text file. Also, what would be an extra bonus, would be that when creating the text file (to be read in an HTML textbox) you could have an interface to select which portions of the text you want bold and size and font.... I know i know this is a lot to ask, but the first part would be fine. If there is a tutorial on this, or some example somewhere on the web that would be great.
Thanks in advance.
Creating Buttons Dynamically From XML File Text
I've created an XML calendar (with code from an example I found online) and now I want to add some additional functionality to it. Here's what it currently looks like: http://www.evbc.org/frog/Main/evbccalendar.html
When the user clicks on a day with events, they are listed to the right of the calendar. I want the user to be able to click on an event in the list and have that load the details, including an image and colored category bar into the Details pane on the right. The reference to the image and category w/ corresponding color bar will be defined in the XML file along witht the details.
Here is the current code for displaying the events:
Code:
// show the event information when a date with events is clicked
calendar_ec.onDisplayEvent = function (eventsData, dateObj) {
var event_str = "<font color='#777574' size='+2'><b>" + dateObj.dateTimeFormat("dddd, d mmmm yyyy") + "</b></font><br><br>";
for (var i=0; i<eventsData.length; i++) {
// create a pointer to the eventdata to save typing!
var d = eventsData[i];
// output the title of the event
event_str += "<font color='#283569'><b>" + d.title + "</b></font><br>";
// if the start and end date are different dates display the range
if (d.startDate.getDate() <> d.endDate.getDate()) {
event_str += "<font color='#283569'>" + d.startDate.dateTimeFormat("d/m/yyyy") + " - " + d.endDate.dateTimeFormat("d/m/yyyy") + "</font><br>";
}
// output the start and end time of the events (contained within startDate and endDate)
if (!d.allDay) event_str += "<font color='#283569'>" + d.startDate.dateTimeFormat("h:nntt") + " - " + d.endDate.dateTimeFormat("h:nntt") + "</font><br>";
// for weekly events
if (d.eventType == "weekly") {
// the following outputs the pattern information for the recurring event
var output_str = "Every " + ((d.pattern.attributes.recur > 1) ? d.pattern.attributes.recur + " " : "") + "week" + ((d.pattern.attributes.recur > 1) ? "s" : "") + " on ";
var days_array = new Array();
for (var q=0; q<daysOfWeek_array.length; q++) {
if (d.pattern.attributes[daysOfWeek_array[q].substr(0,3)]) days_array.push(daysOfWeek_array[q]);
}
if (days_array.length == 7) {
output_str += "every day";
} else if (days_array[0] == "Monday" && days_array[1] == "Tuesday" && days_array[2] == "Wednesday" && days_array[3] == "Thursday" && days_array[4] == "Friday") {
output_str += "weekdays";
} else if (days_array[0] == "Sunday" && days_array[1] == "Saturday") {
output_str += "weekends";
} else {
for (var q=0; q<days_array.length; q++) {
if (days_array.length > 1 && q == days_array.length - 1) {
output_str += " and ";
} else if (q > 0) {
output_str += ", ";
}
output_str += days_array[q];
}
}
event_str += "<font color='#283569'>" + output_str + "</font><br>";
// the event type is monthly
} else if (d.eventType == "monthly") {
// the following outputs the pattern information for the recurring event
var numString_array = ["First","Second","Third","Fourth","Last"];
if (d.pattern.attributes.date) {
output_str = "Day " + d.pattern.attributes.date + " of every " + ((d.pattern.attributes.recur > 1) ? d.pattern.attributes.recur + " " : "") + "month" + ((d.pattern.attributes.recur > 1) ? "s" : "");
} else {
if ("sun,mon,tue,wed,thu,fri,sat".indexOf(d.pattern.attributes.day) > 0) {
var days_obj = {sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"};
var patternDay = days_obj[d.pattern.attributes.day];
} else if (d.pattern.attributes.day == "day") {
var patternDay = "day";
} else if (d.pattern.attributes.day == "weekday") {
var patternDay = "weekday";
} else if (d.pattern.attributes.day == "weekendday") {
var patternDay = "weekend day";
}
output_str = numString_array[d.pattern.attributes.week - 1] + " " + patternDay + " " + ((d.pattern.attributes.recur > 1) ? "every " + d.pattern.attributes.recur + " " : "of every ") + "month" + ((d.pattern.attributes.recur > 1) ? "s" : "")
}
event_str += "<font color='#777574'>" + output_str + "</font><br>"; //font was #283569
}
// output the description
if (d.description.length) event_str += d.description + "<br>";
// if there are more events output a line break
if (i < eventData_array.length - 1) event_str += "<br>";
}
// output the generated string to the text box
events_txt.htmlText = event_str;
}
Thanks for any help you can provide,
-fjhughes
Creating Horizontal Scrolling Text With External *.txt. File
Hi,
I would like to create a one line horizontal scrolling text that could be edited by someone who has 0 knowledge of HTML and Flash.
I think that would be possible if the text is in a *.txt file in the same folder as the *.swf file.
Can someone help me by since I am fairly new to actionscript and FLASH and willing to learn more and more about it.
I have looked for a tutorial but couldn't find one...
Thanks!
KiKette
Creating Dynamic Movie Clips From Text File
Hi,
I need to create movie clips from values in a text file.
I have variables 'destination_list' and 'ship_list' and its values in a text file. I create individual movie clips for each value in the 'destination_listand 'ship_list'.
Now the problem is that, 'destination_list' had 9 values and first 7 is not displayed and 'ship_list' displays correctly. What would be the problem ?
Code is given below:
//******** Destination Code Starts Here ************
destination_mc._visible =true;
destination_array = destination_list.split(",");
destination_length = destination_array.length;
// set the initial y position of the clip
yposition = 40;
// begin looping
for (i=0; i<destination_length; i++) {
duplicateMovieClip (_root.destination_mc, "destination_mc" + i, i);
setProperty ("destination_mc" + i, _y, yposition);
//destination_Clip.destinationName = destination_array[0];
set ("destination_mc" + i + ".destinationName", destination_array[i]);
yposition = yposition+30;
// destination_mc._visible =true;
}
//******** Destination Code Ends Here ************
//ship_Clip._visible=0;
ship_array=ship_list.split(",");
ship_length=ship_array.length;
yposition = 45;
for (i=0; i<ship_length; i++) {
duplicateMovieClip (_root.ship_mc, "ship_mc" + i, i);
setProperty ("ship_mc" + i, _y, yposition);
//ship_Clip.shipName = ship_array[0];
set ("ship_mc" + i + ".shipName", ship_array[i]);
yposition = yposition+30;
}
Creating HTTP Links In A .txt File To Be Uploaded For A Scrollable Text Box
I am trying to create some http links in my .txt file which is for updating my scrolling text box on a website in flash mx.....
I added the <a href="http://www.blabla.com"></a>
but this still doesn't seem to work...as a matter of fact that entire line just disappears....is their anything I need to do to correct this?
Seems very odd......
I have seen it done and working on other sites..
Any suggestions?
Beating The Login
I have a flash movie that starts out with a login. It's purpose is just to give the user a username. I want them to be able to use spaces, but I don't want them to just hit the spacebar a bunch of times. How do I make sure they use some combination of letters and numbers and not just a bunch of spaces and making it look like there is no name?
I restricted what they can input by using:
myText_txt.restrict = "A-Z a-z 0-9";
And, I can use the code below, but it won't help if they hit the spacebar.
if (myText_txt != "") {
//login;
}
Any suggestions?
A Horse Of A Different Color...
Okay, say I have three different movie clips, each one a different color (Red, Green Blue..) Now, when I click the corresponding button, I want to have a quick transition from the current color to the new ...
However, I suppose this is my first time delving into programmatic color, and I'm wondering how to go about changing my background's Hex each time I loop thru the frame, to make that color change nicely...
Any sugegstions/examples?
Ok, I've Been Beating Around The Bush But I Can't Figure It Out
I've been trying to get ideas to help me with what I'm trying to do, and everyone HAS helped me a lot... but I still can't figure it out! What I'm trying to do is have a ball always moving right; when it reaches a certain point... say frame 15 or getTimer()+whatever, then it will start over (moving right) but the rotation will be random and it will resume from the position that the last frame was at. So it's constantly moving, after a while it will turn a random direction and go that way, after a while it will turn... you get it. I've tried everything! OY!! If you want me to say what I've tried so that you have a starting point or so that you can see what I was doing wrong, please say so. Thanks
Delay Action Is Beating Me
I have a movie clip that comes to meet the mouse when the mouse hovers over the botom portion of the stage. The clip is scripted to move only along the x axis. When the mouse leaves that bottom area, The movie clip flies off the stage to the left or right, depending on which is closer.
What I want the movie clip to do is wait a few seconds before it flies off the stage when the mouse leaves the bottom area. That way if the mouse wanders from that area for a second or two, the movement of the movie clip won't be annoying. Here is my code:
onClipEvent (enterFrame) {
if (_root._xmouse<795 && _root._xmouse>05 && _root._ymouse>405 && _root._ymouse<445) {
var distance = _root._xmouse-this._x;
if (this._x != _root._xmouse) {
this._x += .15*distance;
}
} else if (this._x<401) {
var homing_distance = -120;
if (this._x != homing_distance) {
this._x += .15*homing_distance;
}
} else if (this._x>400) {
var homing_distance= 820;
if (this._x != homing_distance) {
this._x += .02*homing_distance;
}
}
}
I have been messing with gettimer, but I can only get the delay to work once. I think set interval might be the key. Please help, this is driving me nuts!
Thanks
Beating The Popup Blocker
I have an aspx form that I need to load from a button as a popup but the blocker catches it. We tried to load it with getURL(javascript:window.open()), but the popup blocker(IE and a google popup blocker) caught it. Is there a way to make something popup on a user driven event like this? The thing is is that we could do it with "_blank" just fine but we also need to limit the size of the window scallability menubar and all that other stuff you can do with window.open. What do you guys suggest?
Heart Beating Tween
How can I implement a tween simulting the heart beating.
var myTweenX:Tween=new Tween(myShiningLogo,"scaleX",Bounce.easeOut,1,0.6, 1,true);
var myTweenY:Tween=new Tween(myShiningLogo,"scaleY",Bounce.easeOut,1,0.6, 1,true);
this is almost what I want. But I would like the object to come back to initial dimensions. Should I use other 2 tweens ?
My Darn Horse Problem
I am making a little horserace game. This is first thing I have really done on my own, scripting-wise, even if it really isn't that much. The game is you click a button, horses start going across the screen randomly, when one gets there, it goes to his respective frame with winner on it. Here is my script.
if (_root.horse1_x>500){
gotoAndplay(4);
}
if (_root.horse2_x>500){
gotoandplay(5);
}
_x1=_root.horse1._x
_x2=_root.horse1._x
vel1=Math.random()*20
vel2=Math.random()*20
_root.horse1._x+=(vel1^2)
_root.horse2._x+=(vel2^2)
The horses just keep going, ignoring the "if" statement. Before I was getting an error saying I had a script that was causet the player to run slowly, but I guess I got rid of that somehow. But, all I want is the movie to go to a page when one of the horses goes past that certain point. But those damn horses just keep going. What's my problem??? Please help me, I have been thinking for what seems like forever.
Horse Speed FPS/Code
I have an animated horse galloooping along a roadway with a moving background.
The art and horse are travelling at 15fps. How does the code go to slow it down to a stop (both horse and background) ...over 60 frames.?
Im running CS3 Flash 9.
any help, direction,appreciated
Turock2
Horse Derby Game
Hello all,
Pardon my juvenile flash lingo.
I am developing a Horse Race game like something out of a fair/carnival. It is for our sales department at work to show their progress throughout the year. The problem is that I would like a non developer person to update the horses progress and stats. My background is mostly in flash 8, and I am thinking I might need to use xml or mysql.
So my question is, "Is there a way to update data and it be stored within your flash site/page through flash or do you have to use other avenue's?"
thanks
Beating The 16,000 Frame Barrier Without LoadMovie()
Heya folks.
I've been working ona personal Flash project for quite some time now. I was oblivious to the 16,000 frame limit until now. My movie is running at 30 fps and is between 10-12 minutes long, so as it turns out I'll be exceeding this limit by a fair amount. Cutting stuff out of my film or reducing the fps is not an option at this point in development, and this all need to be contained in one SWF. I really want to beat the barrier, and I have an idea, but I wanted to throw it out there to make sure it will work before I go through the trouble of doing it.
I'm assuming 16,000 frames is the limit for the main timeline, but the timelines of movie clips exist outside of this barrier. Could you realistically compile half the movie into an 8000 frame movie clip, put the other half of the movie into another 8000 frame movie clip, and then put these two movie clips on a 2-frame movie? The first movie clip would have actionscript that moved the main timeline to the second frame (and the second half of the movie) when it completed its 8000 frame run.
I've never tried this before. Would this work without defying any of the frame limits? If this idea is even theoretically sound but I'm missing something important, any advice is greatly appreciated. Thanks for your time.
NEED A KNIGHT PREFABLY ON A WHITE HORSE
ok, here goes..... I have been asked to make a sail boat follow the mouse in a subtle and slow manner (probably needs deceleration code type stuff?) If the mouse is to the right it moves right if you then move the mouse left it turns and follows left and so on.The movement would happen only along the x axis. My problem is where do you start? I have no idea how to make this happen and would appreciate some help. If someone can help could you explain the code in simple terms so that I understand whats going on?? Your help really would be appreciated as I am getting desperate........
Horse Racing - Drinking - Flash
Hey everyone,
I just finished one of my first flash games:
I started it the other day and put just a few hours in it thus far. I just want to get some people opinions of what they think about it, and how it could be better. I made it for my friends and I to play - just something we'll use from time to time when we get bored
Thanks,
Mike
Horse Race Game - Small Problem
winnerbox = "";
_root.startit.onEnterFrame = function () {
winner = new Array();
winner[1] = "ball1_mc";
winner[2] = "ball2_mc";
winner[3] = "ball3_mc";
winner[4] = "ball4_mc";
winner[5] = "ball5_mc";
winner[6] = "ball6_mc";
winner[7] = "ball7_mc";
winner[8] = "ball8_mc";
winner[9] = "ball9_mc";
winner[10] = "ball10_mc";
for(i = 1; i < 11; i++)
{
_root["ball"+i+"_mc"]._x += Math.round(Math.random()*25);
if(_root["ball"+i+"_mc"]._x > 499)
{
_root["ball"+i+"_mc"]._x = 499;
winnerbox = "Ball "+i+" wins!";
stop();
}
}
}
That is the code I am using. Winner box is a dynamic text box. The problem is that say ball 8 wins, it will say that in the text box, but it wont stop, the second place ball will go past 499 and then it will say that ball is the winner? Why is my stop(); not working ?
|