Images Depending On Time
what i want to do is create a site that knows what the time is in your area via your pc clock hopefully and depending on the time puts a different background image up e.g. night time = night picture daytime = sunny daytime pic
any ideas
-Tom
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-07-2004, 09:59 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Images Depending On Time
what i want to do is create a site that knows what the time is in your area via your pc clock hopefully and depending on the time puts a different background image up e.g. night time = night picture daytime = sunny daytime pic
any ideas
-Tom
Loadmovie Depending On Time Of Day
I would like to have my flash movie load specific images from external swf files based on the time of day like morning, afternoon, evening, and late night. I can do this in Javascript as such
script language="JavaScript"
function writeImageTag() {
var today = new Date();
var day = today.getDay();
var hours = today.getHours();
if (((day > 0) && (day < 6)) && ((hours > 21))) {
document.myPicture.src = "media/images/wdlate.jpg"
}
and so on. How can this be done in flash?
Loadmovie Depending On The Time Of Day
I'm doing a site for a radio station, and I need to load a particular external movie depending on the time of day (for that particular dj).
I've tried something like below that I found in the forums, but its not working:
myDate = new Date();
hr = myDate.getHours();
if(hr >= 8 && hr <=19) {
loadMovie("day.swf", "loader");
} else {
loadMovie("night.swf", "loader");
}
If anyone can help me with this, it would be greatly appreciated.
Thanks in advance!
Matthew
Change Depending On Time
I have 2 frames, one has a black background the other white.... I want to make that people would be able to see my white background say between 8am to 6pm and black background from 6pm to 8am... How would I go about and doing this?
[F8] LoadMovie Depending On Time
Hey I have a flash banner on a website I'm working on for my church, here it is Calvary Chapel . Each slide on that banner is just a externally loaded .swf. My church has a live broadcast via the internet, and I was wondering how I could make it so that when that live broadcast is going on instead of loading the first external .swf like normal it will load a different one saying "Our live broadcast is underway" or something like that. So pretty much I just want to know how to make it play a certain slide in place of the first one say from 8:30 to 10:30 AM on Sunday, and 7:00 to 8:30 PM on Wednesday. How would I do this?
Go To Frame Depending On Time?
How do I set up my document so that depending on a certain Day(number and dayname) and month an image will rotate
for example:
if the day was the first of the month one of my 3 images will rotate 10 degrees
if the date was wednesday, my second image will rotate 30 degrees
and if the month was April my third image will rotate 50 degrees
What would be the easiest way to set this up?
Thanks,
Nate
Change Sky Depending On Time
Does anyone know how or have examples of changing a colour of something depending on the time on the system of the user?
Thanks.
Change Movie Depending On Time.
I heard that a movie can change depending at what time you view it. If so how? (Example)I want to make a movie cartoon with 10 scenes. When you play it 12:00pm you get to view scenes 1,2,4,6,& 8 and then at a later time like 3:00pm you can see scenes 3,5,7,9... is that possible? If so how and I would like a detailed explanation. Thanks for any help!
Change Graphic On Depending On Time.
I have a site and I want to make it change depending on time.
[example] 7AM-3PM a picture of a sun would be on the site and when it's 3PM-9PM a sun half way showing some moon. 9PM-7AM moon ETC...
Anyone know the code?
Load Movieclip Depending On The Time
Hi all
Does anyone know how to load a specific movie clip depending on the time. I have twelve flash banners that i want to load into a target movie clip every hour.
i.e.
if the user accesses the page between 1 & 6 minutes past the hour they will see banner1.swf. if they access the page between 7 & 12 minutes past the hour they will see banner2.swf.
Thanks
Loading A Different File Depending On What Time It Is...
I've made a movie which will successfully go and load the contents of a text file. Is it possible using getTime(); to load the contents of different text files depending on what day and time (GMT) it is...
ie -
Monday 10am til 12 - get Mondaytextfile01
Monday 12 til 2pm - get Mondaytextfile02 etc.
Tuesday 10am til 12 - get Tuesdaytextfile01 etc.. etc...
Then display the contents using my working code:
Code:
lvText.onLoad = function() {
// Display the value in the text field.
externalfile.text = this.displayValue;
};
If anyone's got any good ideas for this I'd be very appreciative...
Cheers
FLV Clips Loading Depending On Time Of Day.
I thought I was doing something that no one else has done before but found a website doing the same thing I am trying to do and I am way stuck. I am stuck. I figured out that this site is not a live enviroment, rather using FLVs for certain days of the week - and the office is even all dark after 6PM. Looks like they have an FLV library loading clips for specific days and also for the time of day. I am trying to do the same but I am stuck on my CS3 code. I think my problem resolves here:
var CurrentDate = GetPHL_date();
It doesn't seem to retrieve date - videos won't load!
To see what I'm trying to do, please visit this site:
www.customedialabs.com
Any help you can offer - I would be most appreciative.
Jerry
Rollover That Plays Depending On Time
hey every1 argh my flash skills are getting weaker cuz I've been toying around with after effects and 3ds lately but anyways I made a normal rollover button but how do you AS it so the animation on the button plays according to how long you keep your cursor over the button. eg: FL ppl http://avionics.flashlevel.com/
FLVs Loading Depending On Time Of Day.
I am stuck. I figured out that this site is not a live enviroment, rather using FLVs for certain days of the week - and the office is even all dark after 6PM. Looks like they have an FLV library loading clips for specific days and also for the time of day. I am trying to do the same but I am stuck on my CS3 code. I think my problem resolves here:
var CurrentDate = GetPHL_date();
It doesn't seem to retrieve date - videos won't load!
To see what I'm trying to do, please visit this site:
www.customedialabs.com
Any help you can offer - I would be most appreciative.
Jerry
Display A Movie Depending On The Time Of Day
I read the tutorial on displaying a random .swf file, but I was wondering if anyone can explain how to display a .swf movie depending on the time of day (ie. morning, afternoon, evening). Any help would be appreciated. Thanks.
-Jordan
Control Movieclips Depending Of Time
I download a tutorial to make a digital clock now what I want to do is make my movieclips go to a different frame depending of the hour
you know I want to make that effect of day/nigth
well I hope you could help me
thanks
Display A Movie Depending On The Time Of Day
I read the tutorial on displaying a random .swf file, but I was wondering if anyone can explain how to display a .swf movie depending on the time of day (ie. morning, afternoon, evening). Any help would be appreciated. Thanks.
-Jordan
Picking Movie Clip Depending On Time ?
im creating s fake webcam
when the user goes to view it, it will show a random image
but i want to split the pictures up to (day) and (night)
ive put all the day pictures in one movie clip called 'DAY' and the night ones in 'NIGHT'
how can a set it so that up until 5pm it will randomly choose pictures from the DAY movie clip.... and after 5pm it would randomly choose a picture from the NIGHT movie clip
ACTION SCRIPT 1
[F8] How To Write A Method That Can Be Altered Depending On Circumstance At Run Time
Hiya people!
I have an issue with something, i have been getting into Flash Lite and basically i eventually found a way to navigate with the keypad in a class...
var array:Array = new Array ("Start","Options","Help","About");
var selected:Number = 0;
//keypress up =
selected --;
//keypress down =
selected ++;
//keypress select =
array[selected].onSelect();
So basically, you can see how this works, its simple and it works for the main part of my program but i am having an issue with the Main Menu because each button does something completely different.
The MovieClip class contains an onMouseDown... or something like that... im not infront of flash as i write this, but
onMouseDown = function (){}
works.
How can i create a public method that all buttons use but that i can set on a per button basis
var button1:MyButton = new MyButton();
button1.onSelected = function (): Void
{
//code for button 1... say it draws a circle
}
var button2:MyButton = new MyButton();
button2.onSelected = function (): Void
{
//code for button2... say it draws a rectangle
}
Im unsure how to implement this in code. Can someone give me helping hand?
Cheers!
AS 2.0 Loading/changing Images Depending On Selection (example .fla Included)
Hello,
I would like to have sort of a menu to the left of the screen (roughly 8 different ones).
Then each menu will display from 3-8 options on the right hand side. Each option has a picture and a little description.
My question is, how can i change the menu image on the left to the image of the option selected on the right (after they have chosen their selection)
So for example:
imagine this is done all by images, not text.
My menu is 1 2 3 4
user presses 1 and is displayed with the options a b c d
they select d
the menu is now D 2 3 4
I have included wha ti've got so far in a .fla
thank you very much for any help on this. I'm not sure the most correct way to do this. I didnt want to load the images from a database because i'll only have up to 8 options max..
here is my little .fla i made for it..
http://www.yoce.com/options.fla.zip
AS 2.0 Loading/changing Images Depending On Selection (example .fla Included)
Hello,
I would like to have sort of a menu to the left of the screen (roughly 8 different ones).
Then each menu will display from 3-8 options on the right hand side. Each option has a picture and a little description.
My question is, how can i change the menu image on the left to the image of the option selected on the right (after they have chosen their selection)
So for example:
imagine this is done all by images, not text.
My menu is 1 2 3 4
user presses 1 and is displayed with the options a b c d
they select d
the menu is now D 2 3 4
I have included wha ti've got so far in a .fla
thank you very much for any help on this. I'm not sure the most correct way to do this. I didnt want to load the images from a database because i'll only have up to 8 options max..
here is my little .fla i made for it..
http://www.yoce.com/options.fla.zip
Help With Unique Random Images - Multiple Images At A Time
Ok so what i would like to do is set up a page that has 36 images on it. But every time anyone goes to the site i want them to show up in random order. I have jpgs they are all labeled 1.jpg, 2.jpg 3.jpg and so on. I have used code that pulls the images form a folder that the swf isnt in like /images/1.jpg. So what im saying is i want to pull them externally. Any one have any ideas on how to do this?
Attaching Multiple Images - Load Images One At A Time?
I have a photo gallery that loads many images using a for loop (image data is from XML file). Simplified code looks like this:
Code:
var photos_xml = new XML();
photos_xml.ignoreWhite = true;
photos_xml.onLoad = function(success) {
if (success) {
var photos = photos_xml.firstChild.childNodes;
var itemCount = 0;
for (var i = 0; i < photos.length; i++) {
var path = photos[i].attributes.path;
// attach the photos
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);
photo_mc.empty_mc.loadMovie(path);
itemCount ++
...
Then on the photoFrame_mc clip I have a loading like:
Code:
onEnterFrame = function () {
loader_mc._visible = false;
var t = empty_mc.getBytesTotal();
var l = empty_mc.getBytesLoaded();
percent = Math.round((l / t) * 100);
if (l == t && t != undefined && t > 10) {
loader_mc._visible = false;
delete this.onEnterFrame;
} else {
loader_mc._visible = true;
if (isNaN(percent)) {
percent = 0;
}
loader_mc.percent_txt.text = 10 - Math.round(percent / 10);
}
};
So what happens now is that many images get attached at once and they are all loading at the same time.
What I'd like to do instead is to have them load one at a time. The first pass through the for loop attaches an image and then it loads, but it doesn't move on to the next image until the first one is done loading. Is that possible?
Or maybe is it better to let them load all at once? I just think that when the image count is very large it will really bog down loading so many images at once and it might be best to load one at a time. Please advise.
Images Load First Time, But Not The Second Time - Help
I have a function that loads an array of images defined by an XML file. Depending on what "page" you are on, a different childnodes set of images loads... this works great - the first time they are called.
But... if you click on another 'page' calling the same function (or the same page for the secont time), nothing.
The image names will trace, but nothing is shown.
There is a createEmptyMovieClip and loadMovie to show the images.
For other content in the movie, we have placed "clearing" functions that would reset the variables to "" (empty string). But what about for loaded images/mc's? I have tried
removeMovieClip
unLoadMovie
However, the loading images function is a bit confusing and I might not be sure what arguments to pass to the "clearImages" function.
Any direction is appreciated!! really stuck here!
Thanks
Different Time, Different Images
Is there a way to load up a different bg or images from your library in flash depending on the time it is?
So basically flash reads the time on the computer and displays an images accordingly. or a completely different swf but in the same html page.
Does anybody know what I'm talking about? I know it has to do with "date class".
Please help!
Load Images At A Certain Time
Does anyone know how to tell flash to display images/movies according a certain time?
like:
at 4-10am = display a "good morning" movie
7-11pm = dislay a "good night" movie
thanks alot!!
Preloading Images One At A Time
hello all, i'm using MovieClipLoader (trying to atleast) to preload a set number of images. For example, the script will load the first image, then once it is done, it will load the second, then the third, and so on. However, the way i have it coded, it only wants to load the first image. Hopefully, all you smart flashers can give me some insight on what i'm doing wrong. here's my code:
PHP Code:
// Add a listener and an image loader.
var imageLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
loadListener.onLoadComplete = function(target_mc:MovieClip)
{
var boxNum:Number = findMCNum(targetPath(target_mc));
imageLoader.loadClip("images/portfolio/" + index + "-" + (boxNum+2) + "tn.jpg", _root[path]["imageHolder_" + (boxNum+1)]);
}
imageLoader.addListener(loadListener);
// Create an empty movieclip for each thumbnail and load each image into it.
for (var i = 0; i < numImages; i++)
{
_root[path].createEmptyMovieClip("imageHolder_" + i, _root[path].getNextHighestDepth());
}
imageLoader.loadClip("images/portfolio/" + index + "-1tn.jpg", _root[path].imageHolder_0);
So as you can see in my script, I'm trying to load the next JPG once the one before it has finished using onLoadComplete. Why isn't this working, and how do I rectify it?
Thanks in advance,
Show Two Images At The Same Time
I'm using action script to show one image (.jpg) as background and is making fade in and fade out, but now I want to show after a few seconds later a second image as foreground (.gif) but I can't find the way to do that.
Images Don't Load First Time Through?
I have a star rating in my movie rater. It takes a variable and then runs it through a series of tests to determine which stars to activate.
Here's the code:
Code:
//Turning all the stars off as default
star1._visible = false;
star2._visible = false;
star3._visible = false;
star4._visible = false;
star5._visible = false;
//Turning the stars on based on user rating
if (rating == 5){
star1._visible = true;
star2._visible = true;
star3._visible = true;
star4._visible = true;
star5._visible = true;
}
if (rating == 4){
star1._visible = true;
star2._visible = true;
star3._visible = true;
star4._visible = true;
star5._visible = false;
}
if (rating == 3){
star1._visible = true;
star2._visible = true;
star3._visible = true;
star4._visible = false;
star5._visible = false;
}
if (rating == 2){
star1._visible = true;
star2._visible = true;
star3._visible = false;
star4._visible = false;
star5._visible = false;
}
if (rating == 1){
star1._visible = true;
star2._visible = false;
star3._visible = false;
star4._visible = false;
star5._visible = false;
}
I know there's an easier way to do this using loops and what not but the system is already in place so I'm gonna go ahead and leave it. the problem is when it first loads the first scene, no stars are displayed. Once you leave the first scene, all other scenes (first scene included) work fine.
Any idea how to make it work right off the bat?
Import Images Run Time
Is it possible in any way to import images into Flash MX in Run Time ?
E.g. passing and url to a jpeg file and then view it ?
Import Images Run Time
Is it possible in any way to import images into Flash MX in Run Time ?
E.g. passing and url to a jpeg file and then view it ?
Loading 9 Images At A Time From Php Vars?
Hi I've made a script which loads a lst of images, lets say it loads 21 thumbnails, which I've then put into a two dimentional array.
iie.
0 1 3
img1 img10 img19
img2 img11 img20
img3 img12 img21
img4 img13
img5 img14
img6 img15
img7 img16
img8 img17
img9 img18
and I load the first column into 9 movieclips [0][1-9] and shows them on the screen, but now I would like to by the click of a button to remove row [0] and display row [1] instead. Ive tried using delete(symbols1-9), but still it gets messy when I want to show column 1. Especially when I click my net column buttom and it goes to show row [2]? Any suggestions to how I can present 9 images at a time, clicking a button will show net 9 images???
Mads
First Time Trouble Loading Images Through Xml...
Hi,
this is the first time i encountered something of this kind.
Have a look at the below code. All it does is load an xml and depending on the nodes, it will create titles and galleries below titles so it would look like that:
title1
gallery1
gallery2
title2
gallery3
gallery4
gallery5
Code:
galleriesData = new XML();
galleriesData.ignoreWhite = true;
galleriesData.onLoad = function(success) {
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
cspacing = 40;
gspacing = 100;
for (i=0; i<total; i++) {
newTitle = _root.attachMovie("menuTitle", "title"+i, _root.getNextHighestDepth());
newTitle._y = hght + i*cspacing;
newTitle._x = 0;
newTitle.title.text = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
len = xmlNode.childNodes[i].childNodes[1].childNodes.length;
hght = _root._height;
if (len > 0) {
for (j=0; j<len; j++) {
newGallery = _root.attachMovie("submenuEntry", "submenuEntry"+j, _root.getNextHighestDepth());
newGallery._x = 30;
if (j == 0) newGallery._y = hght + 50;
else newGallery._y = hght + j*gspacing;
newGallery.title.text = xmlNode.childNodes[i].childNodes[1].childNodes[j].childNodes[0].firstChild.nodeValue;
newGallery.desc.text = xmlNode.childNodes[i].childNodes[1].childNodes[j].childNodes[1].firstChild.nodeValue;
picLoader = newGallery.createEmptyMovieClip(j, 0);
picLoader.loadMovie(xmlNode.childNodes[i].childNodes[1].childNodes[j].childNodes[2].firstChild.nodeValue);
}
}
hght = _root._height;
}
}
galleriesData.load("data/menu.xml");
The problem is that although the code does attach movies correctly through the library, it will not load all thumbnails, but only the last in each for loop.
Titles will show up ok (the first for loop). The second for loop (the nested one) is the one that gives me headaches. It always will only load the last gallerie's thumbnail. So if you were to have 2 titles, one with 2 galleries and one with 3, this code would only load the second thumb for the first title and the third for the second title.
I suppose it has to do with the for and the instances and whatnot but up till now i didnt have any problems with this code snippet. I also tried using a movieClipLoader but it has the same effect.
What is it i am doing wrong?
I might be overlooking something big do to so many hours of looking at it.
Loading Images From XML Ahead Of Time.
I'm trying to build a function that looks through the an xml node and loads content additional images into a hidden clip so that as the user browses through the galleries a lot of content is already loaded. making it faster. My current code:
Code:
loader = new MovieClipLoader();
loader.addListener(this);
function onLoadInit() {
backBorder();
if (currPage == 0) {
preloadArray();
}
trace("success loading image");
}
function onLoadError() {
trace("error loading image");
}
That works great for loading the initial image, and then calling the necessary display functions for the initial image. But with my preloadArray function i load more images and I don't want it to use the same onLoadInit.
How do i define a new onLoadInit? I clearly don't have a firm grasp of the movieClip class. And I'd like to learn more, but the adobe docmentation on this is a bit opaque to me. I want to understand this, and what the possibilities are, not just paste a fix into my code.
Can anyone give me any insight or point me to a resource with info into how to say have seperate onLoadInit() functions for diffent content through the site. And maybe even where a load animation with getBytesLoaded fits into this.
In search of enlightenment.
-greg
Associate Images To Buttons At Run-time
Hi evryone,
I ve got an xml list of thumbnails images, and I want to associate them to an array of buttons programatically.
Suprisingly, the button class doesnt have ' background' property. Is there any way to program that (obviously without going to the stage)?
Thanks a lot
Nas
Loading Images At Random 5 At A Time
hi, i tried searching, but not many i found helpful.
i am trying to create a sort of slideshow. where images are loaded randomly from an external source. say xml file.
i want to load em into a movieclip. which then fades out. sort of morphing into the next picture in a sense.
but i want to load 5 at a time. show them. and while they're showing load the next 5. so on a decent internet connection it would be non stop. with just a not very noticable progress bar on bottom. incase lower internet conn people are viewing.
i am not very familiar with actionscript. only the basics. but have worked with php for quite sometime and some C,C++.
i've an idea on how to load an image into a movie clip and fade it out. but not sure on how to load 5, show, while loading next 5.
if somebody could point me into directions on how to accomplish each of those tasks. that would be very helpful
thank you in advance
How Do I Time The Appearance Of The Duplicated Images
I am trying to get these attached movie clips to attach themselves in a timed sequential order. One after the next. Any help would be great. I looked all over but didn't find an answer.
Here is the code I am using:
PHP Code:
//////////////////////////////////////////////////////////////// place bg imagevar bw = 40;var sw = Stage.width/bw;for (i=0; i<sw; i++) { var bg = attachMovie("bg", "bg"+i, i); bg._x = bw*i;}
How To Crop And Export Images In Run Time
I have a picture, how do i "crop" part of the picture and publish the crop portion as a separate jpeg file? Can flash be able to handle this or do i have to use other languages like c++?
Displaying Images One At A Time Then Keep Looping
I have an HTML page Using CSS. At the top I have text 3 images and another line of text that I would like to highlight one at a time each time someone accesses the page. I will attach the page. Does anyone know how to do this.
Thanks
Time Responsive Dynamic Images
Hi, for my website I'm looking at creating a main image that automatically updates itself every hour or so, depending on the local time of the user, kinda like the dynamic display pictures some people have on MSN and things.
I was thinking, would the best way to do this to have 24 seperate images, then somekind of script that calls the correct one onto the page, maybe using SSI or something?
Or to build a flash image that changes continually for a set amount of time, but uses information from the user, like the local time, to find out which part of the movie to play?
I'm just bouncing ideas around at the moment, but I want to find a way of doing this. The image, by the way, will probably be a flash movie in itself, with moving parts and a mulititude of links etc.
Any help to do with any part oft his would be helpful, cheers.
Images/objects Change Based On Time
I am trying to think through this tutorial that allows you to change an imgae based on time:
http://www.flashkit.com/tutorials/Ti...-788/index.php
and in particular this code:
onClipEvent (enterFrame) {
daynight = new Date();
dayframe = daynight.getHours()+1;
this.gotoAndStop(dayframe);
}
I'm not really understanding what's happening here. How would I modify this code if I wanted the object to appear for 8 hours, then dissapear for 16 hours?
My goal is to have 3 different objects that appear, each for 8 hours. For this solution, I would have to put the 3 different objects on 3 different layers, each with the proper code, right?
Thanks for the help.
Loading External Images To Flash At Run-time
I have a map (created in Flash MX) which consist of many location node's represented by the 'square' icon (image in JPEG format, 3KB in size). It will take nearly 50 seconds to load all the icons (more than 90 icons) and display it on the map. I'm using actionscript to fetch the icons from server.
Few questions to ask here :- Hope you expert guys out there can hands the help.
1. What's is the best way to load all the icons in terms of design, coding and technology wise.
2. How to make faster loading time of icons?
3. Is there any possibilities to load and save the icons(images) to local PC (using cache) for future local-loading?
4. What about using XML for loading images?
Icon Table
ID status url blink
1 11 yellow.jpg 1
2 12 red.jpg 1
ASP coding
---
strSQL = "select * from map_ico"
Set rs = objConn.Execute(strSQL)
i = 0
While Not rs.EOF
Response.Write "&ico_status" & i & "=" & rs("status")& "&<br>"
Response.Write "&url" & i & "=" & rs("url")& "&<br>"
Response.Write "&blink" & i & "=" & rs("blink")& "&<br>"'add for
i = i+1
rs.MoveNext
Wend
Response.Write "&icoNum=" & i & "&<br>"
---
Actionscript coding
----
_root.icoUrls.splice(0);
_root.icosNum = lvData.icoNum;
for (i=0; i<lvData.icoNum; i++) {
_root.icoUrls[i] = new icoUrlClass(lvData["ico_status" add i],lvData["url" add i],lvData["blink" add i]);
}
some codes here
for(j = 0; j<_root.icosNum; j++){
if(_root.icoUrls[j].status == lvData["ico" add i]){
eval("_root.summary" add i).ico.url = _root.icoUrls[j].url;
eval("_root.summary" add i).ico.gotoAndStop(2);
break;
}
}
----
Loading And Resizing Images - Works, But Not 1st Time...
HI guys, im using this to load images into a movieclip, then resize them:
Code:
loadMovie"picture.jpg", _root.holder);
_root.makeSmall(_root.holder, 192, 173, 0);
function makeSmall(theImg, maxWidth, maxHeight, num) {
if (num) {
// stop interval
clearInterval(num);
}
// resize the image if it's too big
with (theImg) {
if ((_width>maxWidth) || (_height>maxHeight)) {
ratWidth = maxWidth/_width;
ratHeight = maxHeight/_height;
if (ratWidth<ratHeight) {
_height = _height*ratWidth;
_width = _width*ratWidth;
} else {
_height = _height*ratHeight;
_width = _width*ratHeight;
}
}
}
}
-- This works fine. After being called for a 2nd time. If i run the code, the image will load, but not resize. If i run it again, it resizes.
The image being loaded is random each time - and it resizes everytime after being the 1st load not working.
And advice? or any better function to load then resize an image in a movieclip.
Regards
Preload Bar For Loading Images Which Take Time To Load1
Hi,
Can someone please tell me how I can get a preload bar inside flash, for loading images inside the same scene in Flash MX. I want a preload bar for loading images which take time to load. Similar to http://www.jkr.co.uk, click we did this and then any item.
Thanks
[F8] Click A Button To Move Different Images At The Same Time
Hi there can someone help me
l have been unable to build the code where random action is needed when
clicking on a button.
l have before me four buttons at the top of the flash stage and ten image down the side " when clicking on a button" l want only some of the images to move along at a key position along the page and so on when you click on a different button same again happens with the other images can this work... l am using Flash 8 and Actionscript 2. Can someone help me.
Many Thanks
Cleveco
Interactive Designer/FT.com
Unique Date And Time...loading Images....
first i get the current date and time like this
ActionScript Code:
myDate = new Date();
mnt = myDate.getMinutes();
dd = myDate.getDate();
hr =myDate.getHours();
mm = myDate.getMonth();
ok....so far so good...
then i load external images depending on date and time...i load images in MC-s on stage....
i have a check function like..this and load images in mc-s
ActionScript Code:
if (mm = 0)
{
loadMovie("januar.gif", _root.month_MC);
}
else
if (mm = 1)
{
loadMovie("februar.gif", _root.month_MC);
}
else
if (mm = 2)
{
loadMovie("marec.gif", _root.month_MC);
}
else
if (mm = 3)
{
loadMovie("april.gif", _root.month_MC);
}
else
if (mm = 4)
{
loadMovie("maj.gif", _root.month_MC);
}
else
if (mm = 5)
{
loadMovie("junij.gif", _root.month_MC);
}
else
if (mm = 6)
{
loadMovie("julij.gif", _root.month_MC);
}
else
if (mm = 7)
{
loadMovie("avgust.gif", _root.month_MC);
}
else
if (mm = 8)
{
loadMovie("september.gif", _root.month_MC);
}
else
if (mm = 9)
{
loadMovie("oktober.gif", _root.month_MC);
}
else
if (mm = 10)
{
loadMovie("november.gif", _root.month_MC);
}
else
if (mm = 11)
{
loadMovie("december.gif", _root.month_MC);
}
so far so good...
but when i load hours and minutes.... it dosent load the images!?!?!
is it becouse i load the same image in diferent MC-s?
if its 22:12 time
then i load 2.gif 3 times....
help
Changing Images With Definite Time Interval
Hi All,
I am working on a cbt that has a set of 70 jpg's and defined time intervals. I have worked out the XML which loads into the fla, but i am not able to write a function that would change the images at defined intervals. Please can any one help me on this. Its important.
Thanks in advance.
Here is the XML Structure.
<content>
<Video image_url="Images/Image01.jpg" image_duration="5"></Video>
<Video image_url="Images/Image02.jpg" image_duration="10"></Video>
</content>
And here is the code that loads the image in an empty movieclip.
var imageArray1 = new Array();
var imageArray2 = new Array();
//Load XML
var content:XML = new XML();
content.ignoreWhite = true;
content.onLoad = function(ok) {
total1 = content.firstChild.childNodes.length;
for (var i = 0; i<total1; ++i) {
imageArray1[i] = new Object();
imageArray2[i] = new Object();
imageArray1[i] = content.firstChild.childNodes[i].attributes.image_url;
//trace(imageArray1[i]);
imageArray2[i] = content.firstChild.childNodes[i].attributes.image_duration;
//trace(imageArray2[i]);
loadImage();
}
firstImage();
//trace("loaded");
};
content.load("images.xml");
function loadImage() {
for (var i = 0; i<total1; ++i) {
_root.holder_mc.loadMovie(imageArray1[i]);
}
}
function changeImage() {
setInterval(loadImage,imageArray2[i]);
trace(imageArray2[i]);
}
//Loading the First Image
function firstImage() {
_root.holder_mc.loadMovie(imageArray1[0]);
}
|