- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHey all,
I have a small mc that has 10 or so frames. On each frame I am displaying different content.
I am atempting to create a kind of date selection peice of code that will check todays date and then for the playhead to go to the specific frame I have signaled in the AS.
eg.
newdate = Date();
if newdate = (is between monday 14 & sunday 20)
gotoAndStop("myframe")
if newdate = (is between monday 21 & sunday 27)
gotoAndStop("myframe2")
etc
my criteria is for a weekly selection, so every Monday morning at 00:00 hours it should go to the next frame(display the next frame) etc
Any help with this would be great.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: aneeshchopraPosted on 2006-08-16 at 05:22:17ID: 17325562
Hi,
&& todayDate-periodTo_1<=0) { && todayDate-periodTo_2<=0) { && todayDate-periodTo_3<=0) {
here is sample code for you:
1.
open a new FLA
2.
create a button with instance name "btn" on stage
3.
paste following code on frame 1 (not on button)
--------
function checkPeriod() {
var periodFrom_1 = new Date(2006, 6, 15);
//07-15-2006
var periodTo_1 = new Date(2006, 7, 26);
//08-26-2006
var periodFrom_2 = new Date(2006, 7, 17);
//08-27-2006
var periodTo_2 = new Date(2006, 8, 16);
//08-16-2006
var periodFrom_3 = new Date(2006, 8, 17);
//09-17-2006
var periodTo_3 = new Date(2006, 9, 14);
//10-14-2006
var todayDate = new Date();
if (todayDate-periodFrom_1>=0
trace("this is period 1");
} else if (todayDate-periodFrom_2>=0
trace("this is period 2");
} else if (todayDate-periodFrom_3>=0
trace("this is period 3");
}
}
btn.onPress = function() {
checkPeriod();
};
---------
4.
compile and check
Rgds
Aneeh