Solved

Flash using Swishmax

Posted on 2004-08-24
7
254 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 250 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 250 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change the background and font colors in Notepad++ 5 159
Help Required 2 46
Java pass by reference 3 25
Oracle programming for starter 14 37
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

730 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