Can Anyone Help Me With Page Refresh Issue?
I have a flash intro page (index.html) that, on the last frame, loads another flash page (that is the main page)..
If you do a screen refresh in Internet Explorer, it loads the intro screen. I'd rather it just refresh the main page. Is there any way to easily do this?
Thanks! Limey
FlashKit > Flash Help > Flash MX
Posted on: 08-01-2002, 12:29 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
On Refresh Page, Flash Doesn't Refresh Loaded Vars?
Hi my flash app loads random vars from a php script and shows the vars, but on refresh page the flash still contains the same vars as before? How do I reload the php script again and get new random vars into my flash app?
Mads
XML Refresh Issue...
My page loads great the first time, then takes forever to load the second time or any subsequent refresh. Here's the page:
http://www.islandathens.com/maps/cityviewer.php
Do I need to close the XML Object before moving on to another one? Is there anything else kind of like that? It will eventually load though...
- Jeremy
Refresh Issue - Please Help
wondered if anyone knew a script command to make the whole flash document restart, therefore resetting everything?
cheers
[ XML Refresh Issue ]
I can't make the data to refresh evry time I click on a button.
When I click on a button that has 3 or more nodes and one that has less then 3 the data does not go away it remains in the content.
[ You can go to my Site and see what is the problem ]
www.solid-gamers.addyour.net/
[ Please look at the pic ]
http://solid-gamers.addyour.net/example.jpg
I have 2 XML Files.
[ Here is the code ]
var xnTrailers:XML = new XML();
//In this code I'm Loading Trailers.xml
Code:
Code:
<trailers>
<content>
<Labels>Trailer</Labels>
<URLS http=""/>
<Images>Pic.jpg</Images>
<Durations>5</Durations>
</content>
<content>
<Labels>Trailer 2</Labels>
<URLS http=""/>
<Images>Pic2.jpg</Images>
<Durations>5</Durations>
</content>
</trailers>
function xnTrailers_function(){
xnTrailers.ignoreWhite = true;
xnTrailers.onLoad = xnTrailersLoad_function;
function xnTrailersLoad_function(){
var xnHolder:Array = this.firstChild.childNodes;
for(i=0;i<xnHolder.length;i++){
vTemp.i_holder.loadMovie("myFolder/" + xnHolder[i].firstChild.nextSibling.nextSibling.firstChild);
}
}
}
//--------------------------------------------------------------------------------
//In this code I'm Loading xnIndex.xml
xnIndex.xml contains the following:
Code:
<xnIndex>
<content>
<file>1</file>
</content>
<content>
<file>2</file>
</content>
<content>
<file>3</file>
</content>
</xnIndex>
function xnIndex_function(){
xnIndex.ignoreWhite = true;
xnIndex.load("sections/xnIndex.xml");
xnIndex.onLoad = function(){
var xnRoot:Array = this.firstChild.childNodes;
for(var i:Number = 0;i<xnRoot.length;i++){
xnClips.player_btn.videos = xnRoot[i].firstChild.firstChild;//Loading the Numbers
xnClips.player_btn.onRelease = function(){
xnTrailers.load("myFolder/Trailers" + this.videos + ".xml");
vTemp._visible = false;
}
}
}
[ XML Refresh Issue ]
I can't make the data to refresh evry time I click on a button.
When I click on a button that has 3 or more nodes and one that has less then 3 the data does not go away it remains in the content.
[ You can go to my Site and see what is the problem ]
www.solid-gamers.addyour.net/
[ Please look at the pic ]
http://solid-gamers.addyour.net/example.jpg
I have 2 XML Files.
[ Here is the code ]
var xnTrailers:XML = new XML();
//In this code I'm Loading Trailers.xml
HTML Code:
<trailers>
<content>
<Labels>Trailer</Labels>
<URLS http=""/>
<Images>Pic.jpg</Images>
<Durations>5</Durations>
</content>
<content>
<Labels>Trailer 2</Labels>
<URLS http=""/>
<Images>Pic2.jpg</Images>
<Durations>5</Durations>
</content>
</trailers>
function xnTrailers_function(){
xnTrailers.ignoreWhite = true;
xnTrailers.onLoad = xnTrailersLoad_function;
function xnTrailersLoad_function(){
var xnHolder:Array = this.firstChild.childNodes;
for(i=0;i<xnHolder.length;i++){
vTemp.i_holder.loadMovie("myFolder/" + xnHolder[i].firstChild.nextSibling.nextSibling.firstChild);
}
}
}
//--------------------------------------------------------------------------------
//In this code I'm Loading xnIndex.xml
xnIndex.xml contains the following:
HTML Code:
<xnIndex>
<content>
<file>1</file>
</content>
<content>
<file>2</file>
</content>
<content>
<file>3</file>
</content>
</xnIndex>
function xnIndex_function(){
xnIndex.ignoreWhite = true;
xnIndex.load("sections/xnIndex.xml");
xnIndex.onLoad = function(){
var xnRoot:Array = this.firstChild.childNodes;
for(var i:Number = 0;i<xnRoot.length;i++){
xnClips.player_btn.videos = xnRoot[i].firstChild.firstChild;//Loading the Numbers
xnClips.player_btn.onRelease = function(){
xnTrailers.load("myFolder/Trailers" + this.videos + ".xml");
vTemp._visible = false;
}
}
}
[XML Refresh Issue]
:x I can't make the data to refresh evry time I click on a button.
When I click on a button that has 3 or more nodes and one that has less then 3 the data does not go away it remains in the content.
[ You can go to my Site and see what is the problem ]
http://www.solid-gamers.addyour.net/
[ Please look at the pic ]
http://solid-gamers.addyour.net/example.jpg
I have 2 XML Files.
[ Here is the code ]
var xnTrailers:XML = new XML();
//In this code I'm Loading Trailers.xml
Code:
<trailers>
<content>
<Labels>Trailer</Labels>
<URLS http=""/>
<Images>Pic.jpg</Images>
<Durations>5</Durations>
</content>
<content>
<Labels>Trailer 2</Labels>
<URLS http=""/>
<Images>Pic2.jpg</Images>
<Durations>5</Durations>
</content>
</trailers>
function xnTrailers_function(){
xnTrailers.ignoreWhite = true;
xnTrailers.onLoad = xnTrailersLoad_function;
function xnTrailersLoad_function(){
var xnHolder:Array = this.firstChild.childNodes;
for(i=0;i<xnHolder.length;i++){
vTemp.i_holder.loadMovie("myFolder/" + xnHolder[i].firstChild.nextSibling.nextSibling.firstChild);
}
}
}
//--------------------------------------------------------------------------------
//In this code I'm Loading xnIndex.xml
xnIndex.xml contains the following:
Code:
<xnIndex>
<content>
<file>1</file>
</content>
<content>
<file>2</file>
</content>
<content>
<file>3</file>
</content>
</xnIndex>
function xnIndex_function(){
xnIndex.ignoreWhite = true;
xnIndex.load("sections/xnIndex.xml");
xnIndex.onLoad = function(){
var xnRoot:Array = this.firstChild.childNodes;
for(var i:Number = 0;i<xnRoot.length;i++){
xnClips.player_btn.videos = xnRoot[i].firstChild.firstChild;//Loading the Numbers
xnClips.player_btn.onRelease = function(){
xnTrailers.load("myFolder/Trailers" + this.videos + ".xml");
vTemp._visible = false;
}
}
}
Preloader Ie Refresh Issue ?
Hi.
I am an newbie when it comes to as and as3. I have been trying to learn by my self
and so far I think it’s going ok. But I have run in to some problems with the preloader.
I finally found a as3 preloader that worked with loading to frames not other mc:s.
Everything is working ok, but when I hit refresh in Ie the whole thing stops.
Everything works great in Ffox, that’s why I can’t understand why it doesn’t work.
I have searched all over for a solution to this problem, but the answers I find
doesn’t help me and doesn’t really explain the problem.
Here is my preloader code.
Code:
import flash.display.*;
this.stop();
addEventListener(Event.ENTER_FRAME,checkLoad);
function checkLoad(e:Event):void {
var pcent:Number=this.loaderInfo.bytesLoaded /this.loaderInfo.bytesTotal*100;
lbar.scaleX=pcent/200;
lbc.text=int(pcent)+"%";
if (pcent==100) {
removeEventListener(Event.ENTER_FRAME,checkLoad);
this.gotoAndPlay(3);
}
}
Please help me with this, and help me understand what i am doing wrong.
Martin
Ps. A big thankyou to Lee and the guys behind gotoAndLearn... by far the best tuts online...
Any One No How To Refresh A Page
sorry if my spelling is bad
any one no how to refresh a webpage from a flash file.
I have looked all over befour posting here.
I want to refresh the browser window after a button has been pressed in my flash file.
Hope you can help
thanks
Brian
Refresh Page
hi all, i am khader, realy i am so so happy about ur great answers and realy alwayes i find the answer for my questions.
acutlly i have problem and i tried to solve it, the problem is
i need to change the inner movie clipe in the main swf file ever time i press on the refresh button on IE , for example
i have the main swf and it contain two movieclipes called 1 and 2
i need when the user press on the refresh button on IE change the movieclip (swapping between 1 ,2)
i hope to find the answer , and i am sure u will send it to me
thanx alot
Refresh Page
im trying to make a button on my flash app refresh the html page its on.
basicallly, as it sends data out, i want it to also refresh the page too.
i know its something simple but i cant find the answer anywhere.
please make me feel more stupid than i am right now..
any ideas?
Refresh Page
I was wondering, within a flash animation, is there a way to asign a button to refresh the users browser?
Is a it a simple bit of actions script, and perhaps a little java script for the .htm page?
It seems like a basic situation, and i hope the matter can be resolved easly.
Thanx
Mark
[help] Refresh Php Page
Is it possible to refresh a php page using AS on a button inside a swf?
I want to have the page refreshed when a user clicks on my "restart game" button.
Is this possible?
[help] Refresh Php Page
Is it possible to refresh a php page using AS on a button inside a swf?
I want to have the page refreshed when a user clicks on my "restart game" button.
Is this possible?
Flash Loadvars And Refresh Issue
Ok I have a flash movie that every 10sec it checks for a page to loadsome data!
Everything works fine! but the page with the data changes every 10min or so!
The flash movie does not load the new data!
I hold the old ones!
In y browser everything works fine!
But from the flash it hold and old page!
How can I set up the flash so that everytime it really reads the new page again and again! and not try to earn time by loading the already downloaded page!
something like refresh!!
Any ideas?
thanx for your time!
Flash MX Refresh Page
I have a movie that in the first frame loadvariables from a txt file, if in my site after load the page that have this movie, i change the txt file contents, and then i return to the page of that movie, the informations are not refreshed with the new informations of the file txt. What could i do ? Even if i click in refresh browser button, the movie don't load the new informations, just if i open a new page it loads the new informations.
Refresh Page = New Image
hello, i cannot seem to find a script that can make the background image of my project change everytime the user hits the refresh button. can you please point me in the right direction please?!!??
thanks.
jonathan
Page Refresh Script?
is there an action script that will force a refresh on the current you url? Or better yet clear the cache?
[F8] How To Link To The Top Of A Page WITHOUT A Refresh?
Note: Please keep in mind I am the definition of a Flash newbie, so any advice you provide me with please spell things out for me. I appreciate your help in advance
I'm working on a Flash presentation, and I am using frame labels to go from one "screen" display to another. The problem is that on a lot of these screens you have to scroll down in your browser to view the entire page (which is fine), but when you click the link to go to the next scene you are too far down on the new scene. I want it so when you click a link, it does not refresh, but it goes to the top of the current HTML file. Oh yeah - this has to work on Safari and needs to be exported in Flash 8 due to all the movies I have in the file.
THANK YOU very much in advance for any help. I have experimented for hours with all kinds of javascript, GETURL's, gotoAndPlay's...can't get it right.
Banner Ad, Changes On Page Refresh Possible?
Hi there,
Im looking to design a banner ad system using flash to fit at the top of my forum.
I want to show a different ad/image from an arrays of ads, each time the page is refreshed. Each image needs to be clickable to goto aspecific URL. It also needs to be easily custimizable so I can add and delete images/ads from the database/array.
I know it has something to do with loadMovie(), Arrays and onClipEvent (load) but I cant for the life of me work out how to put it all together.
Can anyone help me?
Tim
Banner Ad, Changes On Page Refresh Possible?
Hi there,
Im looking to design a banner ad system using flash to fit at the top of my forum.
I want to show a different ad/image from an arrays of ads, each time the page is refreshed. Each image needs to be clickable to goto aspecific URL. It also needs to be easily custimizable so I can add and delete images/ads from the database/array.
I know it has something to do with loadMovie(), Arrays and onClipEvent (load) but I cant for the life of me work out how to put it all together.
Can anyone help me?
Tim
Need To Refresh Web Page To See Flash
I am having trouble when I view my web page. The web page has a swf file embedded in it. It is a sketch of my classroom. On the left hand side of the room is a button that has been placed on the sketch - "interactive whiteboard". I have found that this does not always appear until the page is refreshed.
Here is the website: http://www.mymathsroom.com
I have been trying to find out why this happens. I read somewhere that there may be a problem in the preloader scipt. Here is a copy of this script:
stop();
onEnterFrame=function(){
var framesLoaded=(Math.ceil((_parent.getBytesLoaded()/_parent.getBytesTotal())*100));
gotoAndStop(framesLoaded);
info_txt.text=framesLoaded+"% completed";
if (framesLoaded>=90){
_root.gotoAndPlay("Start");
}
}
Anyhow, I am not sure what to do to fix this problem so any help would be appreciated.
Thanks
Refresh Swf/page Problem
Hi,
I have an asp.net page with an embeded .swf file. When I make a change to my .fla file and compile a new .swf file, the .aspx page doesn't register the change when refreshing. Using the shift key when refreshing doesn't help either. I have to close down the browser and load the page again to see the changes appear.
It is pretty enoying having to close/open the browser every time.
Refresh Whole Page Besides Flash
Hi All,
I'm building a website using divs instead of the buggy frames but i've got a problem.
The site is just one page containing PHP and Div's and within 1 of the divs is a flash menu. My problem is that because it refreshes the whole page also flash refreshes when you click on a button, so i lose my animation and button state. Now I wonder, is there anyway to refresh the complete page besides the flash menu and without using frames?
I know i can use variables to set the button state to active or not, but i just want to continously keep my animations going on without refreshing the flashmenu in the page. It seems it can't be done, or can it?
Any help or tips will be much appreciated!
EDIT: I've uploaded the site here, so you can take a look at what i mean:
> SITE <
Thx,
AMparanoia
How To Force IE Page Refresh?
Hello.... I have a link/button in a flash file that when clicked, loads a cached version of the page (only in IE... in firefox, the latest page is always loaded). This "page" is a Basket Items page for an online store, so for example, if I add a product, remove it from the basket, click away and return to the basket page (via the link in my Flash header), the basket shows the old page (with the item still in the basket). Is there actionscript or something that I can add to the link/button that will force the latest page to be loaded?
Thanks!
Detecting Page Refresh
Hi,
I have an animation that reloads everytime as and when the page holding it refreshes. Is there a way I can detect a page refresh ?(either in flash) or thru js ?
[F8] AS2.0 Have To Hit Refresh To Load Page?
Hey anybody have any ideas why a site wouldn't load on first pull up? I have to press refresh to get it to pull up the content. All the content is dynamic pulling from a SOAP server.. Any clue why it wouldn't load? I don't think its a prob. with the content or the server. I used to have a random background script in there. But now we aren't using a random back ground. And now I think this might be the problem because the site is still all set up for this..
Has anyone heard of this type of problem?
If anyone can take a look at the .fla I can show them.
thanks..
Load PHP On Page Refresh
I've been working on saving variables to an SQL database (through PHP) and then passing them back into Flash, and its working exactly the way it should at the moment. It's set up so that when you click a "save" button, it saves the vars and then reloads them right away.
I need to set it up so in addition to doing this, it will load all the data when the page refreshes (essentially, the second part of the code show below). I'm just not sure what to change and/or add to make it work. Any help would be great - thanks!!!
ActionScript Code:
function saveIt(e:MouseEvent):void
{
var request:URLRequest = new URLRequest ("http://localhost/test.php");
request.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.tName1 = test1.text;
variables.tName2 = test2.text;
variables.tName3 = test3.text;
request.data = variables;
var loader:URLLoader = new URLLoader (request);
loader.addEventListener(Event.COMPLETE, onComplete);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);
}
function onComplete (event:Event):void
{
var variables:URLVariables = new URLVariables( event.target.data );
test1.text = variables.tName1;
test2.text = variables.tName2;
test3.text = variables.tName3;
}
[F8] How To Link To The Top Of A Page WITHOUT A Refresh?
Note: Please keep in mind I am the definition of a Flash newbie, so any advice you provide me with please spell things out for me. I appreciate your help in advance
I'm working on a Flash presentation, and I am using frame labels to go from one "screen" display to another. The problem is that on a lot of these screens you have to scroll down in your browser to view the entire page (which is fine), but when you click the link to go to the next scene you are too far down on the new scene. I want it so when you click a link, it does not refresh, but it goes to the top of the current HTML file. Oh yeah - this has to work on Safari and needs to be exported in Flash 8 due to all the movies I have in the file.
THANK YOU very much in advance for any help. I have experimented for hours with all kinds of javascript, GETURL's, gotoAndPlay's...can't get it right.
Swap SWF On Page Refresh
Hello all,
if I have a series of 6 small swfs, 130x60pxls in size and one of the swfs is placed at the top of the page (part of the header) Its just a simple anim of repeating colors and objects.
Is it possible to have the other swf's play in the page? something like a image randomizer, but uses swfs instead?
That way the page can have some sort of interest even on refresh or reload...
• [color red]idaryl[/color] • http://www.designedimage.com •
Refresh Page Script?
is there any AS that will refresh the html page that the swf is on?
thanks,shagPun.
Load PHP On Page Refresh
I've been working on saving variables to an SQL databse (through PHP) and then passing them back into Flash, and its working exactly the way it should at the moment. It's set up so that when you click a "save" button, it saves the vars and then reloads them right away.
However, I need to change it so that when you click "save," it only saves it (but doesn't load it). Then I would like it so that when the page refreshes, it will query and load everything that has been saved.
Here is the working code I have right now (that does everything at once):
ActionScript Code:
function saveIt(e:MouseEvent):void
{
var request:URLRequest = new URLRequest ("http://localhost/test.php");
request.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.tName1 = test1.text;
variables.tName2 = test2.text;
variables.tName3 = test3.text;
request.data = variables;
var loader:URLLoader = new URLLoader (request);
loader.addEventListener(Event.COMPLETE, onComplete);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);
}
function onComplete (event:Event):void
{
var variables:URLVariables = new URLVariables( event.target.data );
test1.text = variables.tName1;
test2.text = variables.tName2;
test3.text = variables.tName3;
}
I'm thinking I can probably leave the code that is there (it won't hurt anything to reload the data right away). But I'm not sure how to load the data when the page refreshes. Any help or suggestions would be much appreciated - thanks!
[AS2] Can I Refresh The Page From Within Flash?
Hi. I need a "Back" button on my flash movie to cause a page refresh. I did a search on google and found the following.
Code:
on(release){
getURL("javascript:window.refresh()");
}
I attached this code to my Back button but it doesn't work. On the face of it it seems like it should work. I am putting the code in the right place because I can make the button do anything else.
Thanks
Paul
Browser Refresh Issue With External Sound
so the other day i decided to slap together a little mp3 player in MX 2004. It has play, pause, and stop buttons, as well as timeline and volume scrubbing. Everything seems to work out dandy. That is, unless you try and refresh the page.
Check it out and see:
http://www.utsib.net/stuff/mp3player.html
Here's a section of the code, it's pretty standard and simple:
// initialize starting objects and variables
mySound = new Sound();
// check load progress and show percentage loaded
checkProgress = function (soundObj) {
bytesLoaded = soundObj.getBytesLoaded();
bytesTotal = soundObj.getBytesTotal();
percentLoaded = Math.floor(bytesLoaded/bytesTotal*100);
loadbar._xscale = percentLoaded;
};
mySound.loadSound("http://www.utsib.net/files/current.mp3", false);
poll = setInterval(checkProgress, 10, mySound);
mySound.onLoad = function(success) {
if (success) {
clearInterval(poll);
songtitle = ([this.id3.artist]+" - "+[this.id3.songname]);
loadbar._xscale = 100;
}
};
currentpos = 0;
mySound.onSoundComplete = function() {
stoptune();
timeline.timescrub._x = 0;
currentpos = 0;
};
the rest of it is just buttons and things, which are all self contained and shouldn't affect the loading of the MP3 at all. Anyone have any ideas why it's not reading the file after being refreshed?
Can I Refresh An Html Page From Flash
is there a way to refresh the html page from flash so the movie reloads and all the variables are reloaded
or is there a way to globally refresh all variables.
i have found a bug with swapdepths where the last swapdepths command leaves an invisible hittest area in the place of the last mc using the swap depths command and i need to refresh it ...any help muchly appreciated
Radom Image On Page Refresh
Hello All,
I would like to call a random image script from within Flash. So evry time an HTML page is refreshed my Flash movie will generate a new random image. Can anyone help me with this?
Thanks in advance!
Rotating Flash Ads On Page Refresh
I'm a little stumped on how to create this. I trying to rotate 2 flash ads on page refresh.
I tried using:
randomNumber = random(10);
bannerToLoad = “banner” + randomNumber + “.swf”;
loadMovieNum(bannerToLoad , 0);
Didn't work
Any help or link would be helpful and thanks in advance
Refresh Page But Skip Intro?
Good people of Flashland, do you any of you have a solution to this problem.
I have a site that has a preloader (frame 1) and a small intro (frame 2) at the start. The rest of the site is contained within the rest of the movie.
If the end user clicks refresh then the whole thing plays from the start. Is there any way (apart from adding skip intro button) that when refreshed the movie can go straight into frame 3 (the real start of the site).
Does anyone have any ideas please???
Diggz
Need To Refresh Page To See Parts Of Movie?
I am publishing in v.6 When I clear my cache in IE and go to the page, I cannot see my dynamic text and certain components. When I refresh or go to another page and come back, all is good. any ideas?
66.49.195.213 to see what i am talking about.
DK
Popup Causeing Page Refresh
I've done this before but I can't remember how.
I'm using a javascript:window.open via a getURL command. It launches the popup but for some reason its refreshing the page that launched it with a blank page that says only [object Window] and puts the entire javascript command into the URL.
Anyone know what causes this?
Heres the getURL line in question
Code:
getURL("javascript:window.open('launchWithOut.html','newWin','width=1020,height=790,top=0,left=0');void(0);");
Refresh Html Page In Actionscript?
I'm trying to reload my flash game, but it's giving me a lot of problems. Is it possible to simply have my "Play again" movie clip refresh the entire html page after it is clicked? Or just go to the url of the same page?
Prevent Replay After Refresh / Or Go To New Page
Hi!
I'm new to Action Scripting, know only the basics. Have a problem now with a flash heading I've made for a Joomla site. It consists of 17 mc's and has a stop and play button. That's OK when you're in one of the pages, but as soon as you go to another page, the flash starts over from frame 1 and it's nessesary to hit stop again. Can be kind of annoying...
I found a post here regarding just this (from sagacyte, posted in '95) and have tried that solution without any luck.
If anyone can help me out I would appretiate it highly!
PS! Remember I'm a neewbie... Using Flash 8 and Action Script 2.0
Page Refresh Killing My Tweens
Hello,
I have a flash book project which can be seen at: http://www.muldisdesigns.com/Pages/Home.html
It loads an external SWF (which is where the book and stuff are). It works fine on the first load, but if you try to visit the page again, or refresh the page without emptying the cache, all the tweens are dead (which means that essentially nothing works).
Am I missing something?? Doesn't flash reload the SWF each time? Why are all my other variables intact, and only my Tweens dead? I don't get it : (
Im guessing this is something you learn in school when they teach you flash, but I taught myself, and I can't find any info on it :/
Any help would be greatly appreciated!
On Page Refresh, Rollovers Not Working
I'm having a strange problem. I have created 12 buttons, and each of them changes the text of a textField titled nameText on rollover. Right now the y property of the textField is set to 50 and the rollovers work, however when I change the y property of the textField to stage.stageHeight - 80 the rollovers dont work. When I view the page, the rollovers work the first time, but when I refresh the page in IE they stop working. Any ideas?
Here's a snippet of my code:
Code:
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import fl.motion.easing.*;
import gs.TweenLite;
import gs.TweenMax;
import noponies.video.NpVideoProvider;
import noponies.display.NpFSObjectResize;
import noponies.events.NpVideoProviderEvent;
public class BasicFullScreen extends MovieClip {
//--------------------------------------
// PRIVATE VARS
//--------------------------------------
private var vid:NpVideoProvider;
private var i:int;
private var button:MovieClip;
//private var clickNow:MovieClip;
var xmlURL:URLRequest;
var urlLoader:URLLoader;
var xmlDesigner:XML;
var designerList:XMLList;
var designerName:String;
var nameText:TextField;
var nameFormat:TextFormat;
//--------------------------------------
// CONSTRUCTOR
//--------------------------------------
public function BasicFullScreen(){
initVideo();
initXML();
initText();
stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
}
//---------------------------------------
// LOAD VIDEO
//---------------------------------------
private function initVideo():void{
vid = new NpVideoProvider();
addChildAt(vid, 0)
//set video to play at start
vid.playAtStart = false;
//will attempt to play as soon as it loads any data
vid.loadPointToPlayAt = 100
//set it loop
vid.loopingPlay = false
//dont need metadata, as we are stretching this to fullscreen
vid.ignoreMetaData = false
vid.vidSmoothing = true;
//buffer the playback slightly
vid.vidBuffer = 1
//add an event listener so we can kill the audio. You must wait to you have video data before you can set its audio props
vid.addEventListener(NpVideoProviderEvent.PLAYING, killAudio);
//load the video file
//streaming
//vid.loadFile("rtmp://127.0.0.1/oflaDemo/AdobeMax2007_720p_500.flv");
//progressive
vid.loadFile("videos/Rain.flv");
//---------------------------------------
// MAKE VIDEO FULLSCREEN
//---------------------------------------
//This is where we add our video object to our fullScreenResizeObject class
var fs:NpFSObjectResize = new NpFSObjectResize();
fs.addResizeTarget(vid);
}
//litener for "PLAY" event
private function killAudio(event:NpVideoProviderEvent):void{
vid.soundVolume = 0
}
//Mouse Move Video Play
private function mouseMoveHandler(event:MouseEvent):void
{
//trace((event.stageX)/stage.width);
vid.seekAsPercent((event.stageX)/stage.width);
event.updateAfterEvent();
//clickNow.x = mouseX;
//clickNow.y = mouseY - 30;
}
//Create Text Boxes
private function initText():void
{
nameFormat = new TextFormat();
nameFormat.color = 0xFFFFFF;
nameFormat.size = 70;
nameFormat.font = "Continuum Light";
nameText = new TextField();
nameText.defaultTextFormat = nameFormat;
nameText.selectable = false;
nameText.x = 10;
nameText.y = 50;
nameText.antiAliasType = "normal";
nameText.autoSize = TextFieldAutoSize.LEFT;
nameText.alpha = 0;
addChild(nameText);
}
//Called in Constructor to init xml list
private function initXML():void
{
xmlURL = new URLRequest("designers.xml");
urlLoader = new URLLoader(xmlURL);
urlLoader.addEventListener("complete", xmlLoaded);
}
//XML on Load complete function
private function xmlLoaded(evt:Event):void
{
xmlDesigner = new XML(urlLoader.data);
designerList = xmlDesigner.designer;
//trace(xmlProjects..project.(@category == "Print").image);
for each(var designer:XML in designerList)
{
//trace(designerList.designer.@name + "<br>");
//trace(designer.@name);
//trace(designer.image);
button = new MovieClip();
button.graphics.beginFill(000000);
button.graphics.drawRect(0,0,(stage.stageWidth/30),(stage.stageHeight));
button.graphics.endFill();
button.x = (stage.stageWidth/12)*i+(stage.stageWidth/40);
button.y = 0;
button.alpha = 0;
button.designerName = designer.@name;
button.addEventListener(MouseEvent.MOUSE_OVER, doMouseOver);
button.addEventListener(MouseEvent.MOUSE_OUT, doMouseOut);
addChild(button);
i++;
}
}
private function doMouseOver(event:MouseEvent):void
{
//trace(event.target.designerName);
nameText.text = event.target.designerName;
TweenMax.to(nameText, 0.005, {blurFilter:{blurX:10, blurY:10}, ease:Back.easeIn});
TweenLite.to(nameText, 0.005, {alpha:1, ease:Linear.easeOut, onComplete:toRed});
//TweenLite.to(clickNow, 0.05, {alpha:1, ease:Linear.easeOut});
function toRed()
{
TweenMax.to(nameText, 0.05, {blurFilter:{blurX:0, blurY:0}, ease:Back.easeIn});
}
}
private function doMouseOut(event:MouseEvent):void
{
//trace(event.target.designerName);
TweenLite.to(nameText, 0.5, {alpha:0, ease:Linear.easeOut});
TweenMax.to(nameText, 0.1, {blurFilter:{blurX:0, blurY:0}, ease:Back.easeIn});
//TweenLite.to(clickNow, 0.05, {alpha:0, ease:Linear.easeOut});
}
}
}
UI Scrollbar Loads Only On Page Refresh?
I need some help with the seemingly easy to use Flash UI Scrollbar component. I cannot figure out why it will not work the first time the page loads, but works just fine after a page refresh.
The URL:
http://www.agsilver.com
Can anyone help? Thank you!
[Flash 8] How To Link To The Top Of A Page WITHOUT A Refresh?
Note: Please keep in mind I am the definition of a Flash newbie, so any advice you provide me with please spell things out for me. I appreciate your help in advance I am so newbie I don't even know what Actionscript - 1, 2, or 3 I am using - whichever comes with Flash 8.
I'm working on a Flash presentation, and I am using frame labels to go from one "screen" display to another. The problem is that on a lot of these screens you have to scroll down in your browser to view the entire page (which is fine), but when you click the link to go to the next scene you are too far down on the new scene. I want it so when you click a link, it does not refresh, but it goes to the top of the current HTML file. Oh yeah - this has to work on Safari and needs to be exported in Flash 8 due to all the movies I have in the file.
THANK YOU very much in advance for any help. I have experimented for hours with all kinds of javascript, GETURL's, gotoAndPlay's...can't get it right.
Can I Refresh My Html Page Using GetURL?
Is there a way I can automatically refresh the html page where my .swf resides?
Can I use a getURL action to do this even if they page is dynamically generated?
Reload Movie Similar To Page Refresh?
I am having trouble with removeMovieClip(). It simply will not remove all of the movie clips that I earlier attached with attachMovie(). I will spare you the details but after two full days of exploring potential workarounds, I'm ready to try something completely different...
Is there anything I can do with MX ActionScript to make the movie start from the very beginning and just reset everything, kind of like what would happen if you refreshed the browser?
|