ActionScript 2.0 :: Different Image On Refresh?
Oct 26, 2009I want to be able to externally load in an image into a movieclip and when the page is refreshed a different image from about 5 is displayed.
View 8 RepliesI want to be able to externally load in an image into a movieclip and when the page is refreshed a different image from about 5 is displayed.
View 8 RepliesI'm currently using Flash CS4, and Actionscript 2.0 to make myself a website for my artwork. My entire website is being created in Flash (not using Dreamweaver, so keep that in mind.) My site is constructed so that Frame 1 is my Home page, Frame 2 is another page on the site, etc.On my Home page, I want a random image (of my artwork) to show up in the body of the site (there is an interface surrounding it), every time a viewer visits/refreshes the page. It sounds simple, but I've been struggling with this a lot because I keep coming across really complicated Actionscript.
I know there are two possible ways to do this. 1) The images can be drawn from the same folder as my .fla file is saved in...OR...I can attach Movieclips (of my artwork) from my Library, to a blank target Movieclip where they will load on the page. Here's an outline of the functions I want:
-Random selection of image/movieclip
-target destination (where imagery can load)
-(I'll have a total of about 3 images)
i use as3 to change image in graphic file, and my graphic file is used by a button, how do i refresh the button to let it shows new image?
View 1 RepliesI need to reproduce these java screens in AS:
[URL]
It's basically a PNG that gets refreshed once a second.
I need to reproduce 3 such screens in flash. The code below works, but the refresh (loadClip) blanks out the previous image before loading the new one, creating a blinking effect.
Is there a way around that? can I refresh the movieclips smoothly, like it was a video?
ActionScript Code:
// ========= screen updater =====================
screen1_url = "http://cs-ccr-www2.cern.ch/vistar_capture/lhc1.png";
screen2_url = "http://cs-ccr-www2.cern.ch/vistar_capture/lhc3.png";
[Code].....
[URL]
The movie loads in an external image and refreshes it every second. What happens, though, is the previous image seems to stay in memory. Eventually the browser will hang, because the memory footprint of the flash movie is so large. Even while testing outside the browser, I can see the memory increase by a couple hundred KB every second. You can see it at [URL]
The code I'm using is below (don't make fun, I don't claim to be a programmer).
Code:
function refresh_url(event:TimerEvent){
var url:String = "http://www.live-photo.com/asheville-east.jpg?ID="+getTimer();
var request:URLRequest = new URLRequest(url);
[Code]....
I want to load a image lets say example [URL] I can get the image to load no problem in flash. I also have a timeline so it will go to 10 frames and start over. My problem is it keeps loading the old image.png file untill I refresh my browser. Is there a way every time Uiloader is displayed in flash it dosnt like cache the image without refreshing the page.
View 1 RepliesI have flash site and client wants random fullscreen background image to load on refresh. sounds easy right ?. but i've tried a lot of components and code snippets but it's causing headaches as nothing seems to work. i have a client squirming because it isn't done.
I did purchase a component from flashden (randombgholder) which does exactly what i want, but it seems to clash with the flashloaded fCMS system i have working in place, and somehow knocks it out, but that could be my bad amateur flash coding causing it. And when i go to center the swf over the background using his code he provided it goes haywire. perhaps i could do a random fullscreen background image on page refresh in html?? i tried some css ones, but nothing works probably because i'm very new to flash and the likes.
I had an issue with my index.html testing on IE and the preloader just stalls on "loading 0%". he told me that locally the progress event doesn't have time to load and to try uploading it to your server and see if it works. It worked just fine. Rah Rah Kglad.
So today I'm fine tuning the swf/ fla to clean it up. Reduced some picture sizes and deleted unused files and reduced the swf from 4000 KB to 350 KB Rah Rah Gene. replaced the swf in Dreamweaver and re-uploaded with Filezilla. Rah ah Filezilla.
Everything working great and my preload went from 23 seconds to less than 3. So I'm real happy except for one small issue. Firefox and IE both do this. If I hit the refresh button, it stalls on "loading 0%" once again just like it did locally.
If I hit the refresh several times it WILL refresh randomly....2 times refresh......10 times refresh etc.
[URL]
Spoke to my hosting company who said everything seems fine on the server. BTW he said Chrome did NOT have this issue Rah Rah Chrome.
Is there an "easy" way to set up a flash file so where when a person visits the website image "A" will show up, if they leave and come back, a different image is dispalyed, or a different image is dispalyed if they hit "refresh" on their browser?
View 7 Replieshow I would refresh my movie or put the changes into place when a user presses this button to reset the shared object positions:
Code:
//reset button
resetButton.onRelease = function () {
[code]......
[URL].. If you open this in IE. Look what happens if you navigate.
Why i am always with problems when making stuff for flash
I mean the SWF Object specifies the with and the height also the div container specifies the width and the height.
I use "loadvars" to get the dynamic info for a flash homepage from a ".txt" file. How can I force browsers to download a fresh copy of ".txt" files every access?
View 4 Repliesi'm working on a project that uses php and xml to link my database information with flash. I've successfully allowed flash to read the xml contents. I need to randomise the data i retrieved from the database, so my xml content will change everytime i refresh the browser. However, i realised that the flash content didn't change like the xml content. The script to read the xml is written on the 1st frame of my 1st scene. Is there a way to read the xml again everytime i refresh the browser or re-enter the scene?
View 2 Repliesthe .swf file keep loading everytime i click to any other links to call a page
Quote:
stop();
btn_co_location.addEventListener(MouseEvent.MOUSE_ DOWN, btnCoLocation);
function btnCoLocation(e:MouseEvent):void{
[Code]....
i created a pre loader animation for intro.
when i click on button btn_co_location to request co_location.php, the swf movie start loading again for intro just like when it started?
I have a canvas with its verticalScrollPolicy = "auto" and whenever I reload data into the canvas I want to set the position of the scroll bar back to the top of the page.
View 4 RepliesAbsolutely, I am not a professional, so sorry if the question is silly.
I have the script:
for (var i:Number = 1; i <= 5; i++) {
mov1.nextFrame()
}
The result is that I see the initial frame of the animation mov1 and frame 5. I do not see frames that are played during the loop. I need a refreshing function for frame or movie clip mov1, which could be placed in the loop . Alternatively, a function of pausing the action script to a vertical refres (vsync).
I have a scoreboard in flash which works great, but once go back onto the scores page at the end of the game it adds the text to each field again rather than refreshing the scores/names, therefore each item appears twice in each box..
Is there a correct way to dynamically update the scores each time I access the page ? I've tried creating a loop that sets the value of each text_box.text to ""; once I leave the page but that didn't work !!
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()");
[code].....
I am using a Tab Navigator component in which there are three canvas components. When I click one of the canvas (or tab), a Pie Chart is displayed. Actually what happens is that on-click
1. the canvas sends an HTTPService whose url is set to a php file
2. That php file actually gets information from a database. Based on that information an xml file is created
3. Fusion Chart uses that xml file to display a pie chart
The database is being updated after some time. Is there any way the Pie Chart may get updated after every 3 minutes to reflect the modifications in the database? or
Can I send the particular HTTPService again and again after every 3 minutes 'in background'? or
Is there any good way to update the information in a particular canvas (or tab) of Tab Navigator?
how to refresh the display in ActionScript ? The correspondent from Java:
pane.repaint();
In my flash application i have a button which should reload the webpage in which the flash application resides. However i don't know the code yet to be able to refresh the webpage when the button is pressed
View 9 Repliesso I made a simple game in one whole .as and link it as the main.as inside the .as I declared variables, generate random stuff, and as the game plays, the variables changed as well, until the end of the stage.what I want to know is, how to fresh start the whole things? once it's at the end of the game, it'll auto reset everything like it's being played for the first time.back in as2, I usually emptied the first frame, while declaring some fixed value in the 2nd frame and the rest of the codes in frame 3, so if I were to restart the game, I can just gotoAndPlay either the 1st or 2nd frame to reset all the vars as well as stages.
View 1 Repliesi am working on somthing where i need to be able to refresh the xml. Is there a way to only make it refresh the xml on one frame and not the whole movie? The way i have it set up now it refreshes what i need to, but the rest of the data becomes undefined.
View 1 RepliesI am developing a standalone flash application using xml. Its kind of a slide show. There are 100 slides and all the content is coming from XML. The problem is when ever i want to make a change i.e in XML- lets say 99th slide, i have to close the swf and run it again to check the changes in the 99th slide. Is there any option to load the xml everytime when i click next button.
View 5 RepliesI'm pretty new to flash and was hoping someone could offer some guidance with shared objects.hen the user refreshes the page by either refreshing or moving to another page the movie replays which is not the desired action.
View 2 RepliesI need to make variable word that should change every time people are visiting my website.
View 3 RepliesI'm having trouble finding a workaround to get IE to play my SWF again after a user refreshes the page. Here is the part of my preloader code that isn't initializing:
[Code]...
I am having the (apparently common) problem, where my flash file won't update its XML source when I make changes. I've research this, and learned that I need to add a unique reference to the loader, to "fool" the browser into reloading the XML each time.
However, I'm not sure exactly where to put the unique variable. Here's my XML loading code.
[Code]...
I have a FLASH portfolio that opens up with 4 options. The 2nd option works. But if you click on the first or fourth option, instead of going to their respective scenes it goes to then 2nd options scene. Here is the kicker though - if you refresh the page Control+F5 everything works fine How come it only works after you refresh the page? here is link FLASH PORTFOLIO. Then click on personal portfolio link.
View 1 RepliesI dynamically load in a .php file from a server as XML.What I would like to happen is for flash to load the XML every 2 seconds or to whatever time span I choose.
Code:
var myXML:XML = new XML();
var XML_URL:String = "server.php?" + Math.random()*999;
var myXMLURL:URLRequest = new URLRequest(XML_URL);
[code]...