Solved

Changing background image dynamically

Posted on 2010-09-07
3
490 Views
Last Modified: 2012-05-10
Hello All,

I have a Flex application . when ever the page is loaded i need to load the page with different background image everytime.totally there would be 6 images. everytime when user refresh the page the background image should be changed.
Using timer i hope i can manage that one but inspite of this is there any other way to make this possible.
If any solutions for this please let me know.

Thanks In Advance.
0
Comment
Question by:srujanmiryala
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
andreMariano earned 500 total points
ID: 33670853
You can't guarantee that the bg image will change, if you don't save the last one somewhere, but you can try a random function...
create an arrayCollection in your application and add to it, all the bgImage source adress (ex: "assets/bg1.png")
then, in your creationComplete method, just do a random

for a random function, check:
http://www.flex-blog.com/random-number-in-flex/
0
 

Author Comment

by:srujanmiryala
ID: 33689020
Thank you andreMariano

It worked . Thank You Very much.
0
 

Author Closing Comment

by:srujanmiryala
ID: 33689024
Thank you
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question