遊客:  註冊 | 登錄 | 幫助





標題: [求助] javascript date-time problem
GT2     Rank: 3
青出藍
性別 男
UID 4090

精華 0
帖子 906
積分 244   詳情

閱讀權限 40
註冊 2006-8-5
來自
狀態 離線

 
 
 
 
發表於 2007-9-16 12:45 PM  資料  個人空間  短訊  加為好友 
javascript date-time problem

Hi,
I took some photos at the same place in different time,and I did those photos been a flash file.
I want to know how can make the those files automatically change in the html file.
for example,at 7am to 12pm is a.file,12-1800pm is b.file and 1800-0659 is c.file.
because I don't know,I just change the files manually now.
I just a amateur of flash,so hope someone can help how to do.
I think maybe  javascript can be do that,but be failure.
Thanks.



最後編輯: GT2 : 2007-9-20 10:00 AM
頂部

lhy     Rank: 3
青出藍
性別 男
UID 14043

精華 0
帖子 121
積分 330   詳情

閱讀權限 40
註冊 2006-10-16
來自 Netherlands
狀態 離線

 
 
 
 
發表於 2007-9-16 08:35 PM  資料  個人空間  短訊  加為好友 
I dont really get what you want.

1. you want to convert flash file into html? or you want embed it into html?
2. Do you want a application to do it automatically?

I dont think javascript is the way to solve your solution. For automatic convention when there is a new file (let say d.file) you need to schedule jobs to do the conversion at fixed time or listen to event when new file is detected (I think windows should have something like this) than run the conversion.

頂部



mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2007-9-16 11:04 PM  資料  個人空間  短訊  加為好友 
If I am guessing it right, GT2 have taken some photos and he has already used some software to convert them into flash (swf) files and the software also generated some HTML files to present the flash.  Somehow there is one HTML that shows all the flash files?  But he would like to separate them into multiple HTML files, each showing a group of photos categorized by time the photos were taken.

Is that what you like to do, GT2?  If so, can you give us an example in detail how you manually change the HTML file now?  Like, what did the original HTML file look like?  When you changed it, change what lines to what?  And how can you tell what time you take a photo?  Did you just look at the timestamp on your photo?

If possible, upload a zip with an example of one HTML file that include one or two photos, so we can look at the format for you.

頂部

GT2     Rank: 3
青出藍
性別 男
UID 4090

精華 0
帖子 906
積分 244   詳情

閱讀權限 40
註冊 2006-8-5
來自
狀態 離線

 
 
 
 
發表於 2007-9-18 11:39 AM  資料  個人空間  短訊  加為好友 
lhy,mickeyGoUp hello,

Sorry for reply be late!!
lhy,I am sorry for my explaination is not so clear.
As mickeyGoUp said,I had already convert the photos to different flash files.
In the index page,I use the javascript to call out the file.like this <script type="text/JavaScript" src="mainSwf.js"></script>.
So the js.file,I use  document.write('<param name="movie" value="morning.swf">');
As I said,I have three flash files(morning ,afternoon,night).
I want to make those be automatically.
Now I will change the file name manually.I mean when being 1200pm,I will change the file name be afternoon.swf.After six,I will change it to night.swf.

I hope both of you can understand my explaination this time.
Thanks a lot.

頂部

mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2007-9-18 09:47 PM  資料  個人空間  短訊  加為好友 
Thanks for the explanation.

I have a few more questions before telling you what can be done:

1. Each photo is one swf file?  Or the swf file contains multiple photos?  e.g., morning.swf contains all photos taken in the morning?

2. After you generated all the flash, what files do you have? morning.swf, morning.html, afternoon.swf, afternoon.html...etc.?  OR morning.swf, afternoon.swf, night.swf, main.html?  

3. Is mainSwf.js something you created or something that got generated by other software and you are trying to hack it?

4. Briefly describe the procedure: Say, after you take 12 photos, 4 in the morning, 4 in the afternoon, and 4 at night.  Then what do you do?  You run some software three times, one for the morning photos, one for the afternoon photos, and one for the night photos?

5. What does your index page do?  Does it have links to each photo?  

I am trying to understand the flow of your process, in order to come up with the appropriate suggestions for you.  

Thanks.

頂部

lhy     Rank: 3
青出藍
性別 男
UID 14043

精華 0
帖子 121
積分 330   詳情

閱讀權限 40
註冊 2006-10-16
來自 Netherlands
狀態 離線

 
 
 
 
發表於 2007-9-19 12:10 AM  資料  個人空間  短訊  加為好友 
lol mickey took al my questions
no comments   

but actually what I can pull out his post is he want to automatically rename those file :

頂部

mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2007-9-19 12:56 AM  資料  個人空間  短訊  加為好友 


QUOTE:
原帖由 lhy 於 2007-9-18 12:10 PM 發表
lol mickey took al my questions
no comments   

but actually what I can pull out his post is he want to automatically rename those file :

Hahaa.. *high5*

You might be right.  Either that, or he likes to look detect the date attribute of those swf files and dynamically point to those files from the index page.

頂部

lhy     Rank: 3
青出藍
性別 男
UID 14043

精華 0
帖子 121
積分 330   詳情

閱讀權限 40
註冊 2006-10-16
來自 Netherlands
狀態 離線

 
 
 
 
發表於 2007-9-19 01:19 AM  資料  個人空間  短訊  加為好友 
after a little search on internet it seems that the only way to send vars from flash to php is by POST. If GT2 want to read the date vars. I think it is nearly impossible. Except to modify to flash source manually

頂部

mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2007-9-19 02:43 AM  資料  個人空間  短訊  加為好友 
Yeah, if he wants to retrieve data from the flash files but the flash files were not "programmed" to provide data, there's no way to force to extract data out.

But let's hear GT2's answers to those questions, then we will get a even better picture of what he's trying to do.

頂部

GT2     Rank: 3
青出藍
性別 男
UID 4090

精華 0
帖子 906
積分 244   詳情

閱讀權限 40
註冊 2006-8-5
來自
狀態 離線

 
 
 
 
發表於 2007-9-19 10:09 AM  資料  個人空間  短訊  加為好友 
hi,
thank you for both of you are so concern my problem.

1. I took 15 photos at the same place in different time.(morning,noon,night)that mean each time zone have 5 photos.The five photos convert to a swf.file.and I did three swf.file.

2. I made three swf.files,morning.swf,noon.swf,night.swf.Those files are morning.swf,noon.swf,night.swf and index.html.

3. I just read the book and write the js.file(do you need all the script??)

4. yes,because I don't know how to do that be automatically,so I just change the file name every time.(I mean when being noon,I will change the file name to noon.swf.at night,I will change to night.swf)Hope both of you can understand my meaning.

5.The part of flash of my index page is as below:

<!--FLASH start-->
<div id="flash">
<script type="text/JavaScript" src="mainSwf.js"></script>
</div>
<!--FLASH end-->

I just want to know,is it possible to write a js.file to make it auto.
let say between 0500-1200,it will call out the morning.swf
1201-1800,it will call out the noon.swf and then night.swf
If possible,I just rewrite my js.file.

頂部

快速美言
           


當前時區 GMT+8, 現在時間是 2024-5-7 03:34 PM

    Powered by Discuz!  © 2001-2007 Comsenz Inc.   
Processed in 0.013011 second(s), 7 queries

清除 Cookies - 聯繫我們 - LIPS Corner 新天藍 - Archiver