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




Redirect URL On Timer



I have limited experience with flash but I want to include a little bit on a web page that asks the user a question. The embedded flash bit gives say 5 seconds for them to answer and then loads another page. If this is really complicated then I won't bother, its just bells and whistles.

####################################

Does not matter now, I did it! Didn't know I was a flash expert! LOL.



DevShed > Flash Help
Posted on: February 14th, 2004, 09:20 AM


View Complete Forum Thread with Replies

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

Timer Redirect To Another Page In Same Movie
Hi,

I have a website based on a flash movie.

When the website (movie) loads it displays the homepage on the movie. There are other menu buttons to take the movie to other pages.

The script behind one of these buttons is...
onClipEvent(load) {
num=3;
this.title.gotoAndStop(num);
}

on(rollOver) {
if(_root.link<>num) {
this.gotoAndPlay("s1");
this.sign.gotoAndPlay("s1");
_root.menu2["item" + num].gotoAndPlay("s1");
}
}

on(rollOut, releaseOutside) {
if(_root.link<>num) {
this.gotoAndPlay("s2");
this.sign.gotoAndPlay("s2");
_root.menu2["item" + num].gotoAndPlay("s2");
}
}


on(release) {
if(_root.link<>num and _root.animation==1) {
_root.animation=0;
this.gotoAndPlay("s3");
_root.link_prev=_root.link;
_parent["item" + _root.link].gotoAndPlay("s4");
_parent["item" + _root.link].sign.gotoAndPlay("s2");
_root.menu2["item" + _root.link].gotoAndPlay("s2");
_root.link=num;
_root.play();
}
}

where num is the number of the page in the same movie that is loaded when the menu button is clicked...

How can I have the movie load and then after 3 secs move to page num automatically ?

If I have not been clear, please ask me further...

Thanks for any help...

Auto Redirect Timer With Mouse Interrupt
Does someone know a script to redirect to a different swf from another one after a certain amount of time without action?

The setting is: overview.swf links 1.swf until 13.swf via LoadMovieNum(link, 0). After 5 minutes without click (the applications runs on a touch screen). I'd like to redirect to 1.swf from whereever the user went inthe meantime. It's no big deal putting a script into each of the files.

Unfortunatly I have hardly any clue of what I'm doing with that application (which I didn't create in the first place).

Thanks in advance for any clues,

Erik

Redirect Timer Function ( Within Flash Mx ) That Redirects To Html Page
help!
for html,there's a function that auto-redirects a page by using the <meta> tag...
i was wondering if flash mx has its own way of doing it,too
sample FLAs will be welcome

Redirect Timer Function ( Within Flash Mx ) That Redirects To Html Page
help!
for html,there's a function that auto-redirects a page by using the <meta> tag...
i was wondering if flash mx has its own way of doing it,too
sample FLAs will be welcome

Difference Between Timer.stop() And Timer.reset()?
Hello,

What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption?

Thanks,

Nilang

Difference Between Timer.stop() And Timer.reset()?
Hello,

What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption? Code is attached below.

Thanks,

Nilang







Attach Code

// Declarations
var url:URLRequest;// Url
var snd:Sound;// Sound Object
var sndChan:SoundChannel;// Sound Channel Object
var sndPosition:Number;// File offset
var tmr:Timer;// Timer object
var isPlaying:Boolean;// Flag to indicate whether file is
// playing or not
var isPlayDelayed:Boolean;// Flag to indicate whether starting
// of file has been delayed or not

var hours:Number = 0;// Hours
var minutes:Number = 0;// Minutes
var seconds:Number = 0;// Seconds
var milli:Number = 0;// Milliseconds

var pauseTime:Number = 0;// Time when paused
var pauseLength:Number = 0;// Length of pause
var buttonPressTime:Number = 0;//

var timing:Boolean = false;// Flag

// Initialize variables.
isPlaying = false;
isPlayDelayed = true;
sndPosition = 0;

// Get url
url = new URLRequest("sound1.mp3");

// Create new Sound object
snd = new Sound();

// Create new SoundChannel Object
sndChan = new SoundChannel();

// Create a new Timer Object with timeout of 5 sec.
// and repeat it only once.
tmr = new Timer(5000, 1);

// Load the audio file
snd.load(url);

// Enable Event Listeners
tmr.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
stop_btn.addEventListener(MouseEvent.CLICK, onStop);
pause_btn.addEventListener(MouseEvent.CLICK, onPause);
play_btn.addEventListener(MouseEvent.CLICK, onPlay);
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);

// Start time
pauseElapsedTime(false);

// Start Timer
tmr.start();

// Function that handles timer events
function onTimerComplete(e:TimerEvent):void
{
// Play audio file when timer complete event is received
sndChan = snd.play(sndPosition);

// Set the isPlaying to true to indicate file is playing
isPlaying = true;

// Set the isPlayDelayed to false
isPlayDelayed = false;

trace("onTimerComplete: " + e);
trace("target: " + e.target);
trace("current target: " + e.currentTarget);
}

// Function that captures frame events
function onEnterFrameHandler(e:Event):void
{
// Local variables
var totalTime:Number = (getTimer()/1000)-pauseLength;
var goTime:Number = totalTime-buttonPressTime;

// If flag is true, then calculate the time that has elapsed
if( timing )
{
// Calculate time
hours = Math.floor(goTime/3600);
minutes = Math.floor((goTime/3600-hours)*60);
seconds = Math.floor(((goTime/3600-hours)*60-minutes)*60);
milli = Math.floor((goTime-(seconds+(minutes*60)+(hours*3600)))*100);

// Display elapsed time
timeText.text = format(hours) + ":" + format(minutes) + ":" + format(seconds) + "." + format(milli);
}
}

// Function that captures mouse click events when user clicks stop button
function onStop(me:MouseEvent):void
{
// Reset time
restartElapsedTime();

if (isPlaying)
{
// If audio file is playing then stop the audio file, set file offset to zero,
// and set isPlaying flag to false
sndChan.stop();
sndPosition = 0;
isPlaying = false;
isPlayDelayed = true;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then reset the timer and
// set isPlaying to false
tmr.reset();
isPlaying = false;
}
}

// Function that captures mouse click events when user clicks pause button
function onPause(me:MouseEvent):void
{
// Pause time
pauseElapsedTime(true);

if (isPlaying)
{
// If audio file is playing then stop the audio file,
// set file offset to current offset, and set isPlaying flag to false
sndChan.stop();
sndPosition = sndChan.position;
isPlaying = false;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then stop the timer and
// set isPlaying to false
tmr.stop();
isPlaying = false;
}
}

// Function that captures mouse click events when user clicks play button
function onPlay(me:MouseEvent):void
{
// Start time
pauseElapsedTime(false);

if (!isPlaying)
{
if (!isPlayDelayed)
{
// If the audio file is not playing and playback is not delayed, then
// play the audio file from the last offset and set isPlaying to true
sndChan = snd.play(sndPosition);
isPlaying = true;
}
else
{
// If the audio file is not playing and playback is delayed, then
// start the timer and set isPlaying to false
tmr.start();
isPlaying = false;
}
}
}

// Function that sets the time to 00:00:00.00 (default)
function restartElapsedTime():void
{
timeText.text = "00:00:00.00";
buttonPressTime = (getTimer()/1000)-pauseLength;
pauseElapsedTime(true);
}

// Function that pauses time
function pauseElapsedTime(b:Boolean):void
{
if( b )
{
pauseTime = getTimer()/1000;
}
else
{
pauseLength = ((getTimer()/1000)-pauseTime)+pauseLength;
}
timing = !b;
}

// Function adds 0 to the front of the number when it is < 10 and
// returns a String
function format(n:Number):String
{
if( n < 10 )
{
return ("0"+n);
}
return n.toString();
}

Timer - Not Timer Class, But Time Taken To Do Certain Events
So i'm making a little game and want to know how to start a timer and display the number of milliseconds between the start and finish of two different events. I do not want to run a function after 5000 milliseconds or whatever, just record the length of time taken to say click two buttons.

Basically a stopwatch.

I saw the getTimer(); function but i'm not sure of how to use it or if that is what i need.

Once again, thanks for your time.

Running Timer And Timer With Offset
Hello all,

I'm trying to set up two timers in that dare feed the time in minutes and seconds from the server.

Basically, I've got a master running timer in seconds and minutes but also want to have a second cloned timer that is feed some seconds via flashVars to add to the the master time.

Both of these timers once set by the sever time feed in, and with one being offset, are called every second by a setInterval function call so they count up.

Setting up the master running timer isn't a problem but with my coding skills is a little messy..


Code:
_global.masterRunningTimeInMinutes = 59;
_global.masterRunningTimeInSeconds = 55;

if (_global.masterRunningTimeInSeconds>0 && _global.masterRunningTimeInSeconds<59) {
_global.masterRunningTimeInSeconds++;
} else {
_global.masterRunningTimeInSeconds = 0;
_global.masterRunningTimeInSeconds++;
if (_global.masterRunningTimeInMinutes>=0 && _global.masterRunningTimeInMinutes<=58) {
_global.masterRunningTimeInMinutes++;
} else if (_global.masterRunningTimeInMinutes>=59 && _global.masterRunningTimeInSeconds>=0) {
_global.masterRunningTimeInMinutes = 0;
}
}
if (_global.masterRunningTimeInSeconds<10) {
_global.masterRunningTimeInSeconds = "0"+_global.masterRunningTimeInSeconds;
}

_root.runningTime.text = "v"+_global.masterRunningTimeInMinutes+":"+_global.masterRunningTimeInSeconds;
Ideally I wanted to to get the master running time to display MM:SS so if anyone can help with that that would be great!

I suppose the real problem I'm having is is setting up the pattern for determining the cloned time with the offset.

This is becoming a real headache but if anyone can help I would really appreciate it! Basically I just wanted to have the running time with the cloned time always a certain amount of seconds ahead.

Many thanks, amp3

FPS Redirect
I have a movie which on some machines plays fast and on others slow. I know this is a flash FPS issue.

How can I test in my preloader if the pc running the movie can handle the faster more graphical version of the movie.

If it cannot, it then redirects to another version which is the slower less intence version.

How To Redirect A URL?
This doesn't have to do with Flash although i get all my flash help here....

how do i redirect a url to another one? i'm using coldfusion/html.

and do i have to redirect every single page to the new url?

how does it work...

thanks....ts.

Redirect
I'm preparing a flash page for a friend and have a question. When the movie ends, 10 seconds later, she wants it to redirect to her home page. Can anyone please provide me with that redirect code?

Redirect
HI i have 9 movieclips of 9 frames, each frame has a different image on it....

when you move your mouse over the moviie clip it progresses to the next frame...

my movie clips are on a 3 by 3 grid, and when you get all the movieclips onto the correct smaller images, it makes a big image.

i was wondering is there anycode that says something like if movieclip"mc1" is on frame 2 and movieclip"mc2" is on frame 4 and if movieclip"mc3" is on frame 1 etc etc untill movieclip 9 then it will redirect you to a website?


i want it to be like the "support Jig" (lefthand side about half way down on http://jayisgames.com/... thanks

Get Url From Url Redirect (please)
how can i get flv filename from a url that redirects to another to it?

one more try:
how can i get in acionscript
http://site.com/myprecious.flv
from url
http://site.com/getfile/?id=12345
which redirects to the flv file that i need



Code:
filename = "http://exodus.interoutemediaservices.com/?id=9dde1d58-161e-476d-ab64-a07791b21819&delivery=download";
nc = new NetConnection();
ns = new NetStream(nc);
videoScreen.attachVideo(ns);
ns.play(filename);

Redirect If No Cam
Hello,
I'm using standard videoconf component
how can i detect if user has no cam an redirect him

thank you

Can I Redirect From An XML Doc?
Ok guys here's the deal,
I've created a flash login, it contacts an XML file and gets the usernames and the passwords. But I want to be able to forbid access to the XML document. Is there any way to do that .

Thanks

Redirect At End Of Swf
okay so I have an flv playing in a swf on my index page, index.html. It is just a short intro and I would like to be able to go directly to home.html at the end of that short flv video. This is the actionscript I'm using to play the video, I assume it would go in here. Thanks.

var nc:NetConnection = new NetConnection();
nc.connect(null);
var nStream:NetStream = new NetStream(nc);
theVideo.attachVideo(nStream);
nStream.setBufferTime(5);
nStream.play("flv/logo_intro.flv");
playbtn_mc.onRelease = function() {
if (this.icon_mc._currentframe == 1) {
this.icon_mc.gotoAndStop(2);
nStream.pause();
} else {
this.icon_mc.gotoAndStop(1);
nStream.pause();
}
};

How Can I Redirect?
i have a flash intro... I would like to redirect to the main page of my site after the flash intro has loaded... how can i do that?

thank you....

Help With Redirect
I made this to help .swf

Html Redirect
How do you make the flash redirect to another webpage at the end of the flash???

Html Redirect (i Donīt Get It)
ok guys, here it is. I read everywhere that before a user loads a FLASH WEB SITE it should first be directed to a html page with some .GIF in order to link it the main site.

i mean, HOW DO I DO THAT? can i publish a HTML page in flash with out the .SWF? iīm really lost here. and another thing, how do i link the .gif image to the site.

Please excuse my english, i donīt speak it very well.

PLEASE dont leave me alone with problem, HEEEELPPPP me PLEEEEEEEEASEEE.

Thank you my friends.

Autorun/redirect From A CD?
I want to create a CD, that when put in the drive, automatically redirects the user to my website. What is the best way to do this? I had a company create one for me about a year ago, but now I want to do this in-house. Thanks in advance for the help.

Redirect In An If/else Statement
I have an app that rejects any user if two users are already logged in. The code that does this is posted below. If the user is rejected, I need to redirect them to a page that tells them the app is currently full (full.htm in the same directory). Is this a getURL thing? Any help would be great. Thanks.


application.onConnect = function(newClient)
{
// If there are already two people in this room, reject the connection attempt
if (application.clients.length == 2)
application.rejectConnection(newClient) ;

else
application.acceptConnection(newClient) ;
}

Redirect With Variables?
Hi guys, I am back again haha

Well my printing problem(http://www.flashkit.com/board/showth...hreadid=407049) is still not solved so I am thinking about other things...

By using a button I can just open the .txt files in a new browser window and use javascript for the print option. Easy, I think....(using redirect to the .txt file)

on (release) {
getURL("javascript:launchwin('REDIRECT.htm' , 'newwindow' , 'height=150,width=300')
");
}


When I change the subject( so this is the.txt) in my flash file it should do the following...the REDIRECT.htm should redirect it to the correct .txt file..(the same as my subject is)

Is this possible with a variable? or in another way?

sounds crazy but I have NO clue at all! I am thinking about changing the print buttons into a movieclip, so when you click on an item the correct button appears (with the correct redirect.htm in the ActionScript) , but this seems a bit too much work for an easy thing as this.....

are there other ways?

Thnx for looking into my problem guys!


Joris

Redirect Code
After a client contacts you using your contact form, it brings them to a "thank you page" I need the "thank you page" to redirect the person after a few seconds back to the home page. Does anyone know this code? Thank you.

Invisible Redirect?
Here's my question:

User is on index.html, Flash movie redirects him/her to index2.html after detecting Flash player. How do you remove index.html from the user's browser's back button history so it doesn't trap him/her in your site when he/she tries to go back?


Thanks a bunch!
Rick

How To Redirect To A New Url In Another Window.
Hello,

I have a window "A" which open a pop-up window "B" containing a swf, this swf contains a button which should do the following :

- redirect the window "A" to a new url.
- close the window "B"

this maybe easy but i'm not a specialist.

thanks a lot

Redirect After Unloadmovie
Just wondering if anyone can help...

I've got a base movie containing another movie in level 1. From the level 1 movie I want to be able to click a button which unloads this movie and redirects to a particular scene in the base movie.

The unload etc is fine, I just can't get it to redirect.

Any help would be great, thanx

Danni

Redirect After Unloadmovie
Hi just wondering if anyone knows the script to do this...

I have a base movie containing a further movie in level 1. I want to ba able to click a button in the level 1 movie which unloads then redirects to a particular scene in the base movie.

All is fine except the post-unload redirect.

Any help would be greatfully received, thanx.

Danni

Redirect Problem.
My web site has a input text field for people to apply weekly news letter. After clicking "send" button. It will redirect to the 1st frame. Is it possible to NOT redirect at all? because after clicking send, everything on screen will be gone.
I would like to make everything remain in the same status. Just a small text saying "thanks".

Loadmovie(redirect.asp)
Hi all!
I want to make a redirect using asp and I want to do it with the loadmovie function

for instance.. if the end of my movie1 has been reached, I'd like to call "loadmovie(redirect.asp)" and in that redirect.asp I'd have a code such like this

<%@LANGUAGE="VBSCRIPT"%> <%
response.redirect "movie2.swf"
%>

of course the above doesn't work - but I guess thats sorta how the asp code has to look like, right?

thanks for your time helping me!
-Murdock

Redirect After Flash
hello all, well hope you can answer this and understand this lol .

Right before you say make it in flash or use a meta refresh in there page thats not what im wanting to do.

Basically i want to link to a movie file but want to have a little intro saying about my site.

for example a create a link quickly which links to the flash swf file called "flash.swf" which then after played redirects to the main movie.

im not sure how to do this, but might be possible, its easy to do in flash and a page, but i don't want to make a new flash movie or page each movie as it wastes space

hope someone can help

thanks

Detect And Redirect? How Do I Do It?
I have published my site for Flash 6, and I thought that this would automatically redirect my users to Macromedia to get the Flash player.

It doesn't do that!! That certainly stinks, but I would be someone here knows how to do that.

How do you do that?

Auto Redirect?
Anyone know a good script that redirects someone depending on wether they have flash or not? I found one at www.javascriptsource.com but it doesnt work.

all i want is users with flash sent in and users without sent to a different version of the site.

Auto Redirect
I'm using flash mx 2004, and I made an intro for a website, and I want it to automatically open the main page when the movie is done playing. How can I go about this?

Many thanks in advance,
Tim

Auto Redirect
I was wondering how to make my flash intro automaticaly take people to my main page without them having to click on an "enter" button.. is that possible? please help me out. thanks, Xander

Redirect To Another Url After A Swf Is Played
Hi,
I want to load another page after the current page has played a swf movie. How can I do it? Thank you very much!

OnSoundComplete() Redirect In URL?
hello, i'm new in flash, i'm trying to do this when the sound is finished playing. i want to redirect to another URL. is that posibble? i need your help plss.. thanks in advance.

Redirect Script?
i'm using flash mx pro. need actionscript to redirect to an htlm page after flash movie ends.

full question: using DW for this site, have a little flash file embeded in the index page. when movie is done i need actionscript or something to redirect and refresh in same window to the home page. if anyone could help

East Redirect
Hi, I know this is easy but I think I keep writing in the code wrong. All I want to happen is that at the end of the movie I want it to rediret to a different html page. Can someone show me what the code is supposed to look like?

Simple Redirect
once the viewer has finished watching a movie i want to redirect them to my homepage. how do i do this? i know the script will be something like

getURL("www.mysite.com","_blank")
}

but dont i need an event handler? if so what can i use?

Redirect With Timming?
Hi!

I'm using a flash intro for a site, and at the end of the movie clip I'm using a geturl code to redirect to the next page. It's working, but the thing is that it takes too long to redirect, about 5 seconds or so, and I wanted it to be immediate. Is there any way to do that? Thanks!

Swf Redirect Problem
hi guys, i have a flash movie that has links that are controlled in xml, and one of the link goes to a blank swf with redirect code to a html page.

...this all works fine and it redirects like id like, but when i use the back button on the browser it dosn't take me back to the main movie, it redirects me back to where i was.

Is there a way to make it skip past the redirect page and go back main movie?

[F8] Redirect To Html
My client wants a Flash intro to redirect automatically to an html page. Can anybody tell me how that's done? Thank you.

Intro Redirect
Hello everyone,

I have a flash intro in my page that contains the link for the mainpage. What can i do to redirect to the main page the users that do not have the flash plug-in installed?

Thanks in advance

[F8] Intro Redirect
Hi
I have an intro page and would like it to re-direct to the main website after about 10 seconds.
What is the script that I need for this action and where do I place it.

I am truly sorry if my question is too basic for you.

Thanks
Ecinele

Redirect Within An Embed?
Hi there,

I would like to redirect my flash movie to another flash movie within an <embed>.
I tried geturl("http://www.foo.com", _self); but it still either redirected the browser, or made a popup!

Is this possible, and if it is...how?

Thanks in advance,
tgifriday

Simulate Redirect...
Is it possible in ActionScript to direct a user from one frame to another after a certain time limit, like in 5 seconds redirects the user from frame 10 to frame 50 as an example....?

URL Redirect At End Of Video
I am a rookie with Flash. I knew enough to take Quicktime .mov files and turn them into flash videos to put up on my web site.

I have 11 different short videos about 30 seconds each. Each one is at a different URL. mysite.com/video1, mysite.com/video2, etc...

How can I redirect the URL from /video1 to /video2 at the end of the first video?

Please remember, I am a rookie. :)





























Edited: 12/05/2007 at 03:29:40 PM by jchristianb

Auto Redirect
Any code suggestions on how to create a time line based auto redirect to an html page *.html (navigated in the current frame not pop-up) that activates automatically at the end of a movie?

I have a product demonstration movie under construction and want to auto redirect to an html form to allow a product trial signup. The form exists and we don't want to develop it in flash. Your help to an Actionscript newbie would be greatly appreciated.

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