douliang9057 2011-05-07 16:38
浏览 84

在Flash中创建与日期相关的函数 - 可能使用INTERNAL php

So here goes my stackoverflow debut... (And I tried searching and reading thru a lot of posts (php flash date) before asking this)

I would like to make an swf that will find out what date it is and do sometinhg correspondingly. Eg. go to a specific frame or load a movieClip.

I would also like to avoid the Actionscript "Date Class" because I need to feel fairly certain that my end user will see the swf of the day not of his/her local date-setting.

So I'm thinking to somehow bring in php with 'echo date' inside the swf and then have the result create a goto-(or load-)command.

To make matters worse I have to rely only on code within the swf using ActionScript2 (in CS4 or 5). I am not able to publish any outside php (or any other code for that matter) so everything must be done internally. Only swf has to work regardless of server (I am expecting the server will work with php)

So I hope some gurus here will be able to tell me: 1. If this is possible 2. How I make the date thing happen in Flash 3. And how I somehow grab the date as a variable (?) and make that determine some action.

How do you like them apples?

  • 写回答

1条回答 默认 最新

  • doulei8475 2011-05-08 02:47
    关注

    To get the date from server, use loadVariablesNum. Let's say you have the date as string in the format you specified on date.php, "Y-m-d", you can do something like:

    // split the string into of an array of day, month and year.
    var dateString:String = "2011-05-08";
    var parts:Array = dateString.split("-");
    // now create the date as an Date instance. ( just to be more organized, but you can just save day, month and year into separate vars.
    var date:Date = new Date(parts[0],parts[1]-1,parts[2]);
    // If you have a frame for each day
    gotoAndStop(mydate.getDate());
    
    评论

报告相同问题?

悬赏问题

  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像