Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Retriveing Date Variables From Text File/ Converting Strings To Dates



Hi, I'm trying to read date variables from an external text file. I'm using the LoadVars method and it is working fine for regular string variables. I'm running into trouble trying to convert some of those strings into date variables so I can compare the current date to the targetDateX variable from the text file. I'm working on a countdown timer for a list of different times/dates. It will display the time left until the first event, then after that event the time left until the second event. I'm running the code in a for loop and everything is working except being able to convert the string with format (yyyy,mm,dd,hh,mm) into a date variable- I've attached a sample of where I'm having trouble. Thanks in advance for any help! :)Attach Codevar targetDateX:String = "targetDate" + i;//sets a variable targetDateX equal to the variable targetDate(i) so that you can read it from the text filevar targetDateA:Date = new Date (this[targetDateX]); //attempting to set it into a date formattrace (this[targetDateX]); //returns the variable stored with the name targetDate(i) in the text file trace (targetDateA); // returns 'Invalid Date'Edited: 11/09/2008 at 12:45:04 PM by wyattr1



Adobe > ActionScript 3
Posted on: 11/09/2008 12:44:44 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Importing Strings Into A Text File And Converting Them In The Movie For Use.
I have a text file, in that text file there are several strings that look like this.

&&S1=[room,250,1]&&
&&S2=[room,252,1]&&
&&totalRooms =2&&

Any they go on like that. Now what I am wanting to do is to load this text file and convert the strings into items that can be used in the movie.

The code I have tried using for this is

code:
function buildInfo() {
for (i=1; i<=totalrooms; ++i) {
foo = "T"+i;
foo2 = "S" + i;
foo = foo2.split(",");
trace("foo:"+foo[0]);
}
}


Now I was expecting this to make the S1 into T1 with the information from text file. This is not working, when I run the movie the trace("foo:"+foo[0]); returns the actual name of the S1 file and that is it. I am just not sure what I am doing wrong. Thank you for any help. I f I have not made myself clear enough, please let me know.

Converting Strings To Variables . . .
I have a bunch of data stored in a text file and I no problem getting it into flash . . . the problem is when I check one of the variables for numerical values:


Code:
if (mrate1 = 5){
star5._visible = true;
}else{
trace("this isn't rated 5");
}
mrate1 DOES equal 5:

(in the text file)

Code:
&mrate1=5
However, regardless of what number I enter in the "if" equation, it always just assumes the expression is true.

Can someone tell me how to make it see the 5 as a numerical 5 and not as the number 5 (text)? At least I think that's what's going on lol.

[F8] Converting Text Strings To Characters
I want to create a movie clip that selects a random text string from an array and then animates that string as it follows a motion guide. The path of the string is going to have multiple 90 degree bends, however, and I want the text strings to smoothly follow the bend and be oriented to the path. I think the strings will have to be broken down into individual letters (characters) to follow the bend.

I think I can write the code to have the movie clip select the string, fade it onto the stage and begin moving it along the guide (although if anyone has suggestions for this I'd be happy to hear them).

My main question is how to break the text string into individual characters to follow the curve?

I need to do this for a few hundred words so it needs to be an actionscript 2 file that will work for any text string called from the arrays

Thanks for the help.

[Date] How To Count Dates?
Hi, I've been searching the web for answers but have been lost.
I'm making an application where I need to display a week of dates, based on giving a starting date. Let's say I have this:


PHP Code:



// data_sStartDate is an arrayvar sStartDate:String = "2006-09-25";data_aStartDate = sStartDate.split("-"); var dDate:Date    = new Date(data_aStartDate[0], (Number(data_aStartDate[1]) - 1), data_aStartDate[2]);trace(dDate); 




I get the date of today. But how do I get the further dates counting from today?

Converting A Date Serial Number To A Real Date
I'm reading dates from Excel and I get this type of serial number : 37477. It's actually the number of days since 1-1-1900. Is there a function to convert that directly into a date in Flash ?
Thanks,

Disabled Dates/date Chooser.
hi,

been playing around with the datechooser component. have a little app that talks (at last!!) to a database, it gets dates and the idea is that those dates disable days on the datechooser component. it works fine but only with one date.

i need a way of adding more than one date to the disabled date code dynamically.

any ideas?

steven.

How To Add Selected Dates To Date Chooser
Hi,
I want to select a start date in one datefield and select an end date in a 2nd datefield. Then I want the dates I have selected to show on a datechooser.
How can I do this ?

Thanks,
Paul

Calculating Dates Based On A Starting Date.
hi.

i'm building a scheduler app for people who need infusions over a 1 year period. a user selects the following info to begin:

1. a starting date for first infusion - day, month, and year
2. number of infusions - 1-4
3. frequency of infusions - every 1, 2, 3, or 4 weeks.

i have to come up with a schedule of infusion dates over the next 13 months.

the breakdown of infusion frequency goes like this:

CASE 1: user selects infusions per 1 week period.
a. 1 infusion every week -> increment every 7 days
b. 2 infusions "" -> increment every 4 days
c. 3 infusions "" -> increment every 2 days
d. 4 infusions "" -> alert ("max 3 infusions/week" );

CASE 2: user selects infusions per 2 week period.
a. 1 infusion every 2 weeks -> increment every 14 days
b. 2 infusions "" -> increment every 7 days
c. 3 infusions "" -> increment every 4 days
d. 4 infusions "" -> increment every 4 days

CASE 3: user selects infusions per 3 week period.
a. 1 infusion every 3 weeks -> increment every 21 days
b. 2 infusions "" -> increment every 10 days
c. 3 infusions "" -> increment every 7 days
d. 4 infusions "" -> increment every 5 days

CASE 4: user selects infusions per 4 week period.
a. 1 infusion every 4 weeks -> increment every 28 days
b. 2 infusions "" -> increment every 14 days
c. 3 infusions "" -> increment every 9 days
d. 4 infusions "" -> increment every 7 days

the way i figured to do it would be to capture the starting day and month and then calculate ( based on number of infusions and frequency ) every other day and month over a 13 month period. i'd throw all of these values into an 'infusionDates' array and then i can loop over them and change the properties of the DateChooser that i need.

i just need help figuring out how to populate the infusionDates array. can anyone help me get started, please?

thanks for any tips. -- fumeng.

Date How Can I Calculation Two Different Dates Using DateField Component ?
Hi,
I have 2 dateFields and I want to be able to select dates from them and get an answer, of how many days difference there are ?
I can do this without using the dateField.
The code I have for first dateField is :


var dcListener:Object = new Object();
dcListener.change = function(evt_obj:Object) {
var SelectDateate = evt_obj.target.selectedDate;

//BELOW Selects date from DateField Component
var date_str = (SelectDate.getDate()+(SelectDate.getMonth()+1)+Se lectDate.getFullYear());

var minutes = 1000 * 60;
var hours = minutes * 60;
var days = hours * 24;
var today_dateate = new Date();
//Calculate today_date into No. of days
var dnewer = (today_date/days);
//Calculate selected DateField into No. of days
var datefield = date_str/days;
//Calculate difference in days
var caldatefield = (dnewer-datefield);
//Place selected Date, from Datefield into Text box SelectDF_txt
SelectDF_txt.htmlText = true;
SelectDF_txt.htmlText = date_str ;

//Place Calculated Date, into Text box DiffDatefield_txt
DiffDatefield_txt.htmlText = true;
DiffDatefield_txt.htmlText = caldatefield ;
}
dateBoxH_ca.addEventListener("change", dcListener);

The second dateField is similar to above.

Thanks,
Paul

Date Count-up/Diff. Btwn Dates
I'm trying to do a "counter/count-up" of a date. Basically comparing a start date with today's date. I'm not quite sure on some things...

Basically I'd like to get months to display, but don't have an idea how. Would also love to figure out if it's a year and 5 days between the two dates, have year = 1 and Days = 5 and not Years = 1 and Days = 370.

Here's the code I have so far. Help would be greatly appreciated:


Code:


myDate = new Date();
myYear = myDate.getFullYear();
myMonth = myDate.getMonth();
myDay = myDate.getDate();
date1 = new Date(2003,8,13);
date2 = new Date(myYear,myMonth,myDay);
between = date2-date1;
yearsLeft = between/(1000*60*60*24*365);
//monthsLeft = between/[(1000*60*60*24)/12];
monthsLeft = between/eval[(1000*60*60*24)/30];
daysLeft = between/(1000*60*60*24);
hoursLeft = between/(1000*60*60);
minutesLeft = between/(1000*60);
secondsLeft = between/1000
trace("Yrs:"+ Math.floor(yearsLeft)+" Months:"+ monthsLeft+" Days:"+ daysLeft);
yrs = Math.floor(yearsLeft);
dys = daysLeft;
mnths = monthsLeft;

Date Object - Getting Dates Of Next, Previous Days
can the date object be used to determine the calendar dates of the days preceding and following today?

i.e.- if i use the date object to return that today is Wednesday, October 10, can i use it to determine that yesterday was October 11 and Tomorrow is October 12?

I need to be able to do this for a custom application that displays info per MTWTF...

i need to be able to have it automatically display real calendar dates (so it knows if it's the 31st or 28th or whatever and the next day is the 1st).

anybuddy?

Comparing Strings Of XML File And Text File In Flash
Here is my code:

var words:Array = new Array();
var wordsLoader:XML = new XML();
wordsLoader.ignoreWhite = true;
wordsLoader.onLoad = function(success) {

if (success) {
parseWords();
} else {
trace('Sorry dude');
}
};
wordsLoader.load("words.xml");

function parseWords() {
if (wordsLoader.firstChild.nodeName == "gamedata") {
var rootNode:XMLNode = wordsLoader.firstChild;
for (i=0; i<rootNode.childNodes.length; i++) {
words[i] = rootNode.childNodes[i].firstChild.nodeValue;

}
}
return(words);
}

var myText:String;
loadText = new LoadVars();
loadText.load("codetext.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);

for(i=0; i<words.length; i++){
trace(words[i]);"<br>"
var mytext:String;
mytext = words[i];
var code:String;
code = this.code;
trace(code);
if( mytext == code){
trace('SUCCESS');

}

}
}
}

two strings 'code' and 'mytext' are not gettin compared...
need help..

Converting Strings
How would I convert a text string into a useable equation?
So if I have a user input into variable equation
be x+5, how could I make it so
Code:
y = equation
is the equivalent of
Code:
y = x+5
and not
Code:
y = "x+5"

**Converting Strings To Numbers?
Hiya,

Im using the loadvars object to hold all the txt variables loaded from a txt file. One of the variables is a number, but being in a txt file flash see's it as a string. So naturally I access the varaible <LoadVarsObject.txtvariable>, and at the same time pass it as an expression param to the Number() function to change it, as
below.


Code:
var flashvaraible = new Number(LoadVarsObj.txtVaraible);
But when I run the movie I get output saying 'Nan' for flashvariable.

Anyone know what Im doing wrong?

**Converting Strings To Numbers
Hiya,

Im using the loadvars object to hold all the txt variables loaded from a txt file. One of the variables is a number, but being in a txt file flash see's it as a string. So naturally I access the varaible <LoadVarsObject.txtvariable>, and at the same time pass it as an expression param to the Number() function to change it, as
below.




Code:
var flashvaraible = new Number(LoadVarsObj.txtVaraible);


But when I run the movie I get output saying 'Nan' for flashvariable.

Anyone know what Im doing wrong?

Converting Strings To Numbers
Hi. Something's weird whenever I'm trying to convert a number with a 0 in front. For instance

y = "0435";
trace(Number(y));

gives me 285!!! What's wrong? Is it interpreting it as a hex number or something? How do I fix this? I guess I have to strip off all leading 0's? Or is there a simple solution to this? Thanks.

~j

Converting Strings And Numbers
hey,

If anyone can help i would appreciate:

I am trying to convert a number from inches to feet so

distanceInInches = 140;
distanceConvertedToFeet = distanceInInches/12;

then i want to get the decimal point and separate out the two values

when i trace for the split

trace(distanceConvertedToFeet.split('.'));

it comes back undefined... does it have something to do with numbers and strings?

Help would be greatful!
thanks

Converting Strings To Functions
I'm creating an advanced calculator in AS3 and I need to know how to do this. If the user types reimann_zeta(3) into the input text box it sets "input" to "reimann_zeta(3)" (string). How do I get flash to treat the string as the pre-defined function reimann_zeta and execute it?

Converting Integers To Strings
Hi all,

I'm trying to convert an integer value into a string so that I can then manipulate the individual characters and am having problems! My current code is something like the below:

---------------------------------------------------
_global.hundreds = 0;
_global.tens = 0;
_global.units = 0;
_global.tenps = 0;
_global.unitps = 0;
_global.credits = "";

var money = 542.19;
var credStr:String = "";

credStr = money;

_global.credits = credStr;
---------------------------------------------------

I don't know if it's necessary or not, but I used local variables to pass the information into the _global variable as I wasn't sure if I could specify the data type in a _global variable?!

Suffice to say, this isn't working. It doesn't seem to want to convert the number into a string whatever I do!

FYI the following code is what is supposed to happen to the string once it is converted:

---------------------------------------------------
if (_global.credits.length < 6) {
if (_global.credits.length == 5) {
_global.credits = "0"+_global.credits;
}
else if (_global.credits.length == 4) {
_global.credits = "00"+_global.credits;
}
}

var fc:String = _global.credits.charAt(0);
var sc:String = _global.credits.charAt(1);
var tc:String = _global.credits.charAt(2);
var fc2:String = _global.credits.charAt(4);
var sc2:String = _global.credits.charAt(5);

fc++;
sc++;
tc++;
fc2++;
sc2++;

_global.hundreds = (fc);
_global.tens = (sc);
_global.units = (tc);
_global.tenps = (fc2);
_global.unitps = (sc2);
---------------------------------------------------

I have tested this by passing the value in as a string in the first place and it works perfectly - so it's just the conversion where I am not getting this right :(

Any help with this would be greatly appreciated!

Thanks, Richard





























Edited: 06/13/2007 at 06:36:10 AM by tricky_ricardo

Converting Strings To MovieClips..
I am creating a map that highlights certain states relative to the person selected. The movieclip that needs to be highlighted is in the XML with other information.
My Problem:I am trying to pull out a variable in my XML that is actually a movieclip directory to put into my TweenLite. I can trace the directory, i.e. enfFrame_mc.missouri_mc, but when I try to pull it out it is a string and will not convert. Any one have any tips on how to do this a snippet of code is below:


Code:
var colorState:String;

colorState = String(xmlData.pic.hmstate[targetThumbs]);

trace(colorState);

TweenFilterLite.to(colorState, 1, {type:"Color", colorize:0x3366ff, amount:1});

Converting Strings To Numbers Without Concatenating
Hello,

I want to separate a string and convert it to a number. I thought Flash could switch vars by reestablishing them using strict data typing. I want to add two vars. Instead it is concatenating them.


Code:
var myNum:Number =10;
var string:String="d1";
var charactersArray:Array = string.split("");
var m:Number= charactersArray[1];
trace("M= "+m);//M= 1
myNum+=m;
trace(myNum);//returns 101 should be 11;

Converting Random Numbers To Strings
how do I go about converting a number into a string.

I have tried String(num);
that doesnt seem to be working. I need to use this string as such: duplicateMovieClip(name, "I need the converted num to string here", dep);
Can someone help me out - show how to convert it and how I use that converted text as an argument above.

Numbers, Strings, And The Date
Sorry for the really simple question, but I forgot something. Let's say I'm trying to display the date. For the minutes thing, I have:

minutes = my_date.getMinutes()

First, I think I need to convert that second thing into a string.
Second, do I need to introduce my date variable earlier? That's kind of weird.
Thanks.

By the way, I believe that this AS shows up as undefined. (not NaN, whatever that is).

Numbers, Strings, And The Date
Sorry for the really simple question, but I forgot something. Let's say I'm trying to display the date. For the minutes thing, I have:

minutes = my_date.getMinutes()

First, I think I need to convert that second thing into a string.
Second, do I need to introduce my date variable earlier? That's kind of weird.
Thanks.

By the way, I believe that this AS shows up as undefined. (not NaN, whatever that is).

Date Comparison Script (using Strings From Db)
Hey all,

I have this great date comparison script that works with the date object:


ActionScript Code:
target_date = new Date();
target_date.setYear(2005, 8, 16);
target_date.setHours(9, 0, 0, 0);
 
// loop to display clock
this.onEnterFrame = function() {
    var now_date = new Date();
    var diff = targetDate-now_date.getTime();
   
    // 86400000ms in a day
    var days = Math.floor(diff / 86400000);
    diff -= days * 86400000;
   
    // 3600000ms in a hour
    var hours = Math.floor(diff / 3600000);
    diff -= hours * 3600000;
   
    // 60000ms in a minute
    var minutes = Math.floor(diff / 60000);
    diff -= minutes * 60000;
   
    // 1000ms in a second
    var seconds = Math.floor(diff / 1000);
    var miliseconds = Math.floor(diff / 100);
   
    // update the text fields
    days_txt.text = days;
    hours_txt.text = hours;
    minutes_txt.text = minutes;
    seconds_txt.text = seconds;
    miliseconds_txt.text = miliseconds;
};


however, i need to get the current date from a string passed in by PHP and the target date from a string passed in by PHP.

i notice that if i trace out target_date i get: Fri Sep 16 09:00:00 GMT-0400 2005

however, if i set a string like newTargetDate = "Fri Sep 16 09:00:00 GMT-0400 2005"; i cannot use this for comparison because i cant invoke the .getTime() function on it.

anyone know how i would go about doing this?

thanks much

I Need To Validate Date Strings Input With Keyboard
I'm working on a project where a user inputs date via a touchscreen keyboard into a database. We have to work with the clients database as is, and there is a strict datatype requirement for the date. The date has to exist on the calender ie. 2-29-04 works but 2-29-05 does not (leap year).

Now, I know how to make a calendar/event schedule with the date object, and do have the option of just ploping a calendar in front of them to navigate through and select a valid date, and this seems like the best idea right now. However, I would like to know if anyone has just validated user input dates via keyboard into a field, so I could just keep the keyboard up there for them, instead of switching the interface around so much.

Thanks for any help.

Are Strings Arrays? 4 Digit Date To 4 Element Array?
Getting my feet wet in actionscript and see that it sure resembles javascript, which, if I remember correctly lets you access each individual characters in a string as an element in an array. Can this be done in actionscript?

what I'm trying to do is turn the .getFullYear (2001) into some sort of form where I can access each individual number, be the 2 the zeros or the 1.

Login Date From Text File To Flash File
i have a question:

i want to put login data from text file to flash file
need help!

Dynamic Text Box Jumping To A Section Of Text File Based On Date Stamp
I am VERY new to Flash MX (version 6) and need some help.

I want to build a text file with different messages that are listed/identified by a date stamp, and then have a flash program to display these messages based on whatever the current date is.

Is this possible? How do I build the text file? Do I need separate text files for each message? What ActionScript code do I use to identify the current date, and then display the appropriate message with the current date.

Any help, tutorial or guidance is appreciated. Thanks!

Dates And Variables
hey again!

I was wondering if anyone might know how to script this.

I have a text field in which the user enters the date. They click a button which then checks to see if the date is formatted as such: MM/DD/YEAR.

It doesn't matter what the date is that's entered (though if I could get the date and then judged the entered date against the current date that would be cool ). The only thing that does matter right now is that the user has formatted the date like I noted above. How would I set that up?

Converting A String To A Date
Hi,

I am attempting to create a countdown to a certain date and time, using the servertime as a base so that the time is the same for every person looking at the movie. I am using PHP, i have echoed the server time to the flash movie using



Code:
$currenttime = date("F d, Y H:i:s", time());


this if then taken into flash and displays the time in the format "February 15, 2006 19:30:44". all this is fine, however i then want to increment this time every second and display it, so i believe a setInterval would be required. However the problem is that this servertime taken from php is a string so i dont know where to begin to start updating it every second. Is there some sort of function to convert this variable back into a date object? Any help would be very much appreciated.
Thanks
Aaron

Converting String Into Date
Does anyone have any idea how to take a string that has a date in it and convert it into time with ActionScript. Here is an example of the string for today: "January 23, 2006 5:11:00 AM PST". This will change everyday and is being passed into my flash movie as a parameter but I don’t know how to get Flash to recognize it.

Thanks in advance if anyone can help.

Converting String To Date
I am getting a date as a text string from a feed (Fri, 29 Dec 2006 1:52 pm CST)

I would like to load that in as a real date but I don't think it is formatted correctly.

Can anyone suggest a simple way to convert the string to a date?

Thanks
Mathias

Converting Date To String
Hi:

I don't have an access to Flash at this moment, but I quickly need to show how to convert date value from this format:
  Wednesday 27 July 2005 - 10.10:50
 
to this format:
  20050727

Thanks.
Sammybobo

Variables, Dates, And E-mails
Here's what I am trying to do. I have an input box that when data is entered will change a variable. When the variable changes it is checked and another movie loads into layer 2 then unloads itself and then sets the variable back to "null". What I don't know how to do is to display this variable and add the date and time to it. Then I'd like to automatically send an e-mail with this information to myself. Does anyone know enough actionscripting to help me out?

Kind regards,

Marcus

Converting An Number In A Text File To A Variable
I'm tried this a hundred ways, and can't seem to get it to work. I'm trying to get my flash file to read a number from an external text file (in form: &var0100=4&) and have the flash file go to a specific frame number based on this variable. This code works if I import it into a text file, but I can't get it to take what's in the text file and convert it to a variable. Here's my following code:


totalprojects = new LoadVars();
totalprojects.load("rmptext.txt");
totalprojects.onLoad = function(right) {
if (right) {
trace("done loading");
total.Number = this.var0100
if (Number(total) < 5) {
projectmovie.gotoAndStop(2);
}
else {
projectmovie.gotoAndStop(3);
}
}
else {
trace("not loaded");
}
};
stop();

Converting Date From Flash To SQL Using Remoting
Does any one know how to keep the Date in the correct format when bringing it from SQL to FLash through remoting. In the SQL table the field is of type date. Then when i send it to flash mx through remoting and try to put it into the Date object it tells me invalid date. I can send it directly to a dynamic text box for display of the record. The problem comes when you edit the record and send it back to SQL through Flash Remoting. The Date field is not in the correct data type for SQL??? Anyone know a way around this?? I am using CF for the remoting.

Converting A Date To A Numerical Formart For Comparison
Hello Guys,

Having problems converting a date (i.e. 12/12/2004) to a numerical format (i.e. 10030430003). Using flash MX 2K4. Flash keeps on returning NaN? Code posted below:


ActionScript:
var my_str = eval(currentColumnVal2);
var my_array:Array = my_str.split("/");
var new_array:Array = new Array();
new_array[0] = my_array[2];
new_array[1] = my_array[1];
new_array[2] = my_array[0];
var tmp_currentColumnDate = new_array.join(",");
var my_date:Date = new Date(tmp_currentColumnDate);
var mynum:Number = my_date.getTime();
trace(mynum); //Will return 'NaN'
trace(tmp_currentColumnDate); //Will return '2004,10,12'
trace(eval(currentColumnVal2));//Will return '12/10/2004'

Any ideas would be greatly appretiated,

Oli

Can Flash Read Text File And System Date?
Flash newbie, way newbie here. I am working on a project where I need a swf file to read a parsed text file, and based on the system date, place text into the swf to be viewed. Is this possible, how do I go about it.

The end result is to have a flash movie that will run content for a year (365 entries in file). Other wise I am going to have to create 365 different ones.

Hopefully this made sense and is doable.

Thanks in advance

Example file with two entries

07042002~The Brave and the Bold~
07052002~The Stupid and the Clueless~

Dispolaying Text File Last Modified Date And Time
Is it possible to have a text field on within flash that displays a text file's modified date and time.

Reason:
I've added a couple of text boxes that obtain their content from text files. I want to display somewhere on the mc the last modified date and time so that people can see when the text file was last updated. I've put together a kind of bullitinboard. This would save me asking people to enter the date and time within the text file.

It's Flash MX, I'm using.

Cheers in advance,

Jase

Getting Time & Date Info From External Text File
I have 2 flv movies that I want to play at certain times of the day. 1st video is a welcome movie, the the 2nd video is a corporate infomercial. These videos play on a plasma screen our lobby area. There will be times I want the welcome video to play from 9am-10am or from 3pm-4pm …ect, then the rest of the day it will play corporate infomercial. My problem is that these times need to load from an external text file. Its setup this way so the receptionist can enter times into the text files so I don't have to change the fla every time.

Converting A PDF To A Flash FLA File Without Converting To An Image First?
Basically, I'm building a digital catalogue that runs off a CD and uses a Flash 'page turning component' to display the pages. Certain pages will have links that use Flash's Fscommand call to open Word and Excel documents.

Has anyone got any bright ideas of how to Convert a PDF to a Flash FLA file without converting to an image first?

I know I can open a PDF in Photoshop, save as a PNG or JPG and then import this into Flash, however the quality isn't brilliant. If you use a hi-res image, then you get a hi-res file size...

Currently, the best way I have found, is to open the PDF in Illustrator, then export it as a SWF. Illustrator converts all text to shapes and you end up with a small SWF, yet great quality when displayed in larger sizes. As I'm currently using a page turning flash component that loads SWF files, I need the quality to be good for the 'Zoom' function.

I've found an Illustrator script that will do the hard work via a 'batch' process, so I can take a 100 page PDF and convert the whole lot to 100 SWF files while I drink tea and 'look busy' and read a magazine, but the problem I have is that I need to add a layer of buttons to several of the SWF files to add a little functionality....

I do have a SWF to FLA decompiler which does a good job, however because Illustrator turns everything into shapes, the decompiler does the same and you end up with thousands of files in the library.... Plus there are a lot of error messages when the file is first loaded...

Many layers are masked, (for some reason without a fill), so if you publish the decompiled file straight away, you just get a blank file. Once you go through and fill the masks needed, it shows when you publish, but this really is a lot of work and I've had a few pages that show when you open the SWF file, but don't show when the SWF is called into the page turning file.... Hmmm....

So in short, I'd like to take a PDF and convert it to a FLA file, add a layer of buttons and publish as a SWF file....

Anyone got any 'Pearls of Wisdom'?

Clere
Clere Print

Load Variables From Text Then Loading Image File With The Filename Given In Text File
The problem is, that i need flash to load variable from text file, eg: info.txt, with image=gt.jpg in it.
Then I want flash movie to load a gt.jpg into a blank movie.
The point is that after i change filename in txt file, i want movie to load that img.

I wrote AS:
loadVariablesNum("info.txt", 0);
loadMovieNum(image, 0);

but it's not working
After i traced variable image, debugger showed that this variable undefined, but if i put textbox with image as variable, it shows "gt.jpg".

Please help

Comparing Two Dates And Return An Array With All The Dates Between
here is the problem

the user select the begin date with a DateField component and the end date with another one.

here is the code associated to the 'begin date' component

///////////////////////////////////////////////////////////
function change(eventObj_begin){
date_temp_begin = eventObj_begin.target.selectedDate;


date_begin=date_temp_begin.toString();

//take the day & month from the string
day_begin=date_begin.substring(8,10);
month_begin=date_begin.substring(4,7);

//take the year from the string
if (date_begin.length==33){
//for the days between 10 and 31
year_begin=date_begin.substring(29,33);
}else{
//for the days between 1 and 9
year_begin=date_begin.substring(28,32);
}
}
date_begin_comp.addEventListener("change", this);
///////////////////////////////////////////////////////////

the same code is used for the 'end date' component

///////////////////////////////////////////////////////////
function change(eventObj_end){
date_temp_end = eventObj_end.target.selectedDate;


date_end=date_temp_end.toString();

//take the day & month from the string
day_end=date_end.substring(8,10);
month_end=date_end.substring(4,7);

//take the year from the string
if (date_end.length==33){
//for the days between 10 and 31
year_end=date_end.substring(29,33);
}else{
//for the days between 1 and 9
year_end=date_end.substring(28,32);
}
begin=day_begin add month_begin add year_begin;

}
date_end_comp.addEventListener("change", this);
///////////////////////////////////////////////////////////

-> so I have 3 vars for the begin date :
day_begin (4) month_begin (Jan) year_begin (2005)
and 3 vars for the end date :
day_end (7) month_end (Jan) year_end (2005)

I concantenate this to have a begin var and an ending var:
//in order to have 4Jan2005
begin=day_begin+month_begin+year_begin;
//in order to have 7Jan2005
begin=day_end+month_end+year_end;


-> from this point, is it possible to have an array with all the dates between 'begin' and 'ending' ? Like
date_array=["4Jan2005","5Jan2005","6Jan2005","7Jan2005"];

External TXT File ONLY On Specific Dates
Hello everyone!

Have a few questions, i'm not much cop with the programming side of flash so youll have to treat me like the stupid monkey i am!

So, for my latest task at work, oh what joy, i have to create a small banner thing which reads data from a text file... BUT... it only reads from the text file IF there is a text file present which i labeled TODAYS date!

So i was hoping someone could help me do the following...

Get todays date
IF there is a file present in a certain directory which is called todays date.txt (ie. 02042006) then it reads the info in that text file and prints it into a certain area in the flash file.
If there is nothing present it just displays the default stuff!!


Hope that makes sense! Thanks SO MUCH for your help!

Dynamic Slideshow - Accessing Jpg File Dates?
Hi folks,

I've been asked to build a slideshow in flash, here's the idea;

A Mobile device takes a snapshot with onboard camera, the Jpeg is sent via bluetooth to a directory on a pc - new jpegs are loaded into Flash on the fly and displayed in a slideshow style presentation.

Ok, straight forward enough in principal - I've built slide shows in flash in the past so that's not a worry ... except this one needs to continually check for new image files as the slideshow runs.

How would I go about this? Is it possible for Flash to access file dates somehow to determine whether a new jpeg has been added to the image directory? Any input would be truly appreciated.

Cheers

Salad

Loading Variables From Text File. ( Not Fixed Variables )
i would like to know how to make my Flash werbby load variables like this automatically everytime i load my flash webby

(this is contained inside a text file) example:

&news[15462]=hello&
&news[14890]=uuuuuuuuuuuh :P&

but i won't be using fixed numbers. these numbers will be randonmize. but how do i tell my textfield to load allll variables that contain the word "news" and a value (number) ? or is there any other ways of doing this?
[Edited by xanbarian on 07-08-2002 at 12:56 AM]

Assigning Dynamic Text File Variables To Variables
Ok so I know exactly how to load variables from a text file and catching these variables in a dynamic textbox to show there string content. But I wanted to work with the string in the passed variable (ie from txt file) BEFORE I display the text in the dymnic text box. I seem to be having trouble assigning the passed .txt file variable to a newly created variable in my movie, it keeps saying "Undefined" when I run a trace().

<code>
//The contents of the text file looks like this
&textxxx=This is the text withing the text variabale

//1st frame, layer 2 in main
loadVariables("text.txt", _root)

//1st frame, layer 1 (below layer 2)
_root.strText = _root.textxxx

</code>

->So why does it say strText "Undefined" !? Does flash not allow variables to be assigned to variables?

If you help that would be fantastic

Strings To Variables
im loading variables input1, input2, and input3 from a text file and tried to put them into output1 or output2 but for some reason it doesn't work, it displays NaN which is basically stating that it is a full string. however input1 is being filled with 32 or some other numerical value.
input1, input2, and input3 load up ok.however, apparently as strings.
loadVariables("vars.txt","");
//set (output2,input2);
output1 = input1;
output1 = parseInt (output1);

Copyright © 2005-08 www.BigResource.com, All rights reserved