?
Solved

Flash using Swishmax

Posted on 2004-08-24
7
Medium Priority
?
257 Views
Last Modified: 2010-04-17
I've created a website using SwishMax, which is an easy to use Flash .swf creator.

I have a static picture on one of the pages that I would like to change every few seconds.  I woul'd like it to work very much like the changing logos on the experts-exchange home under "Who's Using EE?".

Any suggestions?
0
Comment
Question by:Flashvue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11887114
Post your question to the Flash forum:
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/
0
 
LVL 4

Accepted Solution

by:
jcrumble earned 1000 total points
ID: 11887243
I think what you are looking for is something like an Image rotator.  Don't know if it has to be a part of the menu you designed in Swift or not but here is a link to an image rotator on www.flash-kit.com (generally a good source for flash development examples with sample code) that should server your purposes:

http://www.flashkit.com/movies/Applications/Banner_A-Brian_We-7949/index.php

Good Luck,
Jeff
0
 
LVL 3

Assisted Solution

by:IceColdas
IceColdas earned 1000 total points
ID: 11901356
Drag a sprite on the stage, and name it Background.
Then, create a function for that loads an external image
The function below loads an image with the index given as a parameter; i.e. : if index = 0, then it will load image0.jpg, which must exist in the same location with the movie.

function LoadImage(index) {
       tellTarget (("/Background")) {
        loadMovie("image"add(index)add(".jpg"));
    }
}

Now, the complete program :
Create 2 scenes. In the first scene make the initializations.

onFrame (1) {
_root.timer1 = 0;
_root.index = 0;
gotoSceneAndPlay("Scene_2",1);
}

In the second scene, drag the sprite on the scene, then use this script

function LoadImage(index) {
    tellTarget (("/Background")) {
        loadMovie("image"add(index)add(".jpg"));
    }
}

onEnterFrame() {    
    //after image5, it start again with image0
    _root.index ++;
    if (_root.index>5)
        _root.index = 0;
   
    /* timer1 is increased at every frame enter (that means 12 times/second at a movie rate of 12 frames/second
        so, if timer1 = 12, means one second passed; if timer1 = 120 means that 10 second passed */
    _root.timer1++;
    if (_root.timer1 > 120)
      {
          _root.timer1 = 0;
          LoadImage(_root.index);
      }
     
}

p.s. : the program will show the images only when u run the exported .swf movie, and will not show them in the Swish enviroment.
0
 
LVL 3

Expert Comment

by:IceColdas
ID: 11901395
one correction (the index must increase after the image change, not at every frame enter) :
onEnterFrame() {    
    _root.timer1++;
    if (_root.timer1 > 120)
      {          
          _root.timer1 = 0;
          LoadImage(_root.index);

            _root.index ++;
            if (_root.index>5)
                 _root.index = 0;      
      }  
}
0
 
LVL 3

Expert Comment

by:IceColdas
ID: 11901442
oh, seems like it doesnt work without using onFrame(1) statement. So final script for Scene_2 (tested and retested and reretested) :

function LoadImage(index) {
    tellTarget (("/Background")) {
        loadMovie("image"add(index)add(".jpg"));
    }
}
onFrame (1) {
    stop();
}
onEnterFrame() {
    if (_root.timer1 == 0)
      LoadImage(_root.index);
    _root.timer1++;
    if (_root.timer1 > 120)
    {
        _root.timer1 = 0;    
        _root.index ++;
        if (_root.index>5)
        {
           _root.index = 0;
         }
    }
}
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

771 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