Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Trying To Display 2 Random Images In A Single Frame



Im trying to display 2 random images from a directory on my mainpage. I have the files listed in my xml file.... images.xml and using the following script pointing to my instance name picture_mc. all works well for 1 image..how can I get a second image and position it correctly? Do i have to clear the variables? is there an easy way to place the mulitple images into location? Script below...thank you for any help! Please keep explanations simple, I'm very very new at this:this._x = 400; //Offset from top-left corner (0,0)this._y = -100; //Offset from top-left corner (0,0)xmlImages = new XML();xmlImages.ignoreWhite = true;xmlImages.onLoad = loadImages;xmlImages.load("images.xml");function loadImages(loaded) { if (loaded) { xmlFirstChild = this.firstChild; imageFileName = []; totalImages = xmlFirstChild.childNodes[0].childNodes.length; for (i=0; i<totalImages; i++) { imageFileName[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.title; } randomImage(); }}function randomImage() { if (loaded == filesize) { var ran = Math.round(Math.random() * (totalImages - 1)); picture_mc.loadMovie(imageFileName[ran],1); pause(); }}



KirupaForum > Flash > ActionScript 3.0
Posted on: 12-16-2008, 06:53 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Display Random Images
Is there an easier way to display random images, for example I want it to display an image or two and then three or four second’s later change to another.

I have over 100 images to display and don’t really want create each frame and place a new image on every 5 or so frame.

There must be somewhere out there some action script that can do this, can anyone help I would very much appreciate it, and thanks in advances for your help.

0rlando

Display Random Images Using Xml
I need to make a simple flash video. In the video, I need to have two seperate images move across the screen or else just fade in/out. I would ideally like to have each of the two image change RANDOMLY each time it either scrolls across the screen or each time they fade in and out. I have previously used xml to make one picture change randomly so I could easily update the pictures without having to have access to flash software. Ideally I like to have both of the images moving across the screen load from the same xml file. Is this possible? Is there an easier way to do this?

My goal is to complete a website with a flash banner on it and hand it off to a group that doesn't know anything about flash. I would like them to be able to simply edit a line or two of code to update the banner with new pictures instead of having to buy flash to edit the .fla file

Display 4 Random Images
Hi, I want to display 4 random images in row when the page loads from a folder which has 15 jpg images and need to avoid repetition.
I don't want them to repeat. For instance I want images displayed like like: 3, 7, 11, 1, when you load the page but not 3, 7, 11, 3.
Many thanks.

Random Display Of Images To Fill A Grid
I've got a grid of thumbnail images 14x6 so there are 84 tiny thumbnails in total. What I'm trying to do is display them randomly using a setInterval so evently after 84 loops there are all 84 thumbnails showing.

I'm thinking about placing them all on the stage to start with and then set visibility to none and then on each loop, turn the visibility on. That way, all 84 are in the right place, I just need to know how to display them in a random order.

Any ideas on how to get me started with the loop would be a great help.

Thanks Mark

Random Image(frame) Display
Hi there,

I am seeking some assistance with a problem I am having in Flash MX. Please excuse my ignorance if I am posting in the wrong ActionScript section, I am uncertain which version MX uses.

I am trying to use flash to create a banner for a website which contains 5 different images/designs. I would like for a randomly selected banner to be displayed each time the page refreshes. I decided to do this flash and ActionScript as opposed to JavaScript as it means not having to edit every page of the the large website I am working with.

So far I have tried this:

5 frames, each with a new image to display and a random number generator script:


Code:
function randomizer(min,max){
return min+random(max-min);
}

output=randomizer(1,5);

gotoAndStop(output);
The script seems to work in Flash when I test it, but when I export it and include it in the web page, it stays on the first frame.

This is the code for the Flash object on the webpage:

Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="316">
<param name="movie" value="ranBan.swf">
<param name="quality" value="high">
<embed src="ranBan.swf" width="700" height="316" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>
I have tried what I think are several logical methods but none seem to work. One I tried is creating a movie clip, and having that clip onEnterFrame the above script, with the 5 banners/5 frames in the clip, but this ends up continuously looping.

Please excuse me if I have failed to provide any critical information, I am a beginner.

Thank you,

Murray S.

Random Frame: To Display Background
I have a movie clip placed on the first frame within the main timeline.

- The movie clip contains 4 frames, each frame has a different image.
- I want to display one of these frames at random every time the game loads.

- What script would i need to target a random frame within this movieclip?
- Would this script be placed on the main timeline?

Any help, much appreciated
Cheers
Peter.D
chockybickyman@hotmail.com

Random Frame: To Display Background
I have a movie clip placed on the first frame within the main timeline.

- The movie clip contains 4 frames, each frame has a different image.
- I want to display one of these frames at random every time the game loads.

- What script would i need to target a random frame within this movieclip?
- Would this script be placed on the main timeline?

Any help, much appreciated
Cheers
Peter.D
chockybickyman@hotmail.com

I Couldn't Able To Do Control Sound By Using Single Button In Single Frame....
Hai All,

I've developed file with sound control. But i would like to do in single frame control by using buttons.

Actually i've to place mp3 files in each frame and it should be controled by on/off button. When file loading the audio should start play and button should be in OFF state.

When user click the button to make it sound on then audio should play. Every frame will be in stop action. So user will listen audios by clicking next button to go next frame to listem next frame audio.

So If user stops the audio in frame 1 and it should be globally controlled in rest of frames and if sound on globally for next frame audio.

Right now i developed by using:
frame 1:
var my_sound:Sound = new Sound();
my_sound.attachSound("Audio1");

and placed one movie clip in stage. Inside movieclip two button[on and off] in two frames separately.

Inside movieclip frame1:
this._parent._parent.my_sound.start();
stop();

and for ON button:
on (release){
this._parent._parent.my_sound.start();
gotoAndStop(2);
}

Frame2:
this._parent._parent.my_sound.stop();
stop();

and for OFF button:
on (release){
this._parent._parent.my_sound.stop();
gotoAndStop(1);
}

I hope somewhere i did mistake...

Can you please help me on this and give me an idea to make it.

Thanks
Sathish

Random Frame Stops Working When Images Are Used
Hello,
I have built a movie (Flash MX 2004 Porfessional) with the objective of going to a different frame each time the page loads. The movie works fine when I only have text in any of the frames. As soon as I add an image to any of the frames the ramdomization quits working. On top of that, the behavior is Opera/Netscape and IE is different.

In IE, the movie always displaysframe 1 (no content, just the actionscript).

In Opera/Netscape the movie always displays frame 2 (the first frame with content).

The code:

code:
var randomFrame; // Stores the randomly picked frame number
var numFrames; // Stores the total number of frames on the timeline
numFrames = _totalframes; // Assign _totalframes property to numFrames

// Pick a random frame
randomFrame = Math.floor(Math.random( ) * numFrames + 2);

gotoAndStop(randomFrame); // Send playhead to chosen random frame


I have attahed the file for convenience sake.
You can also see the behavior by going to the following two links:

with images (not working)
http://www.prophegy.com/temp/flash.html

w/o images (working):
http://www.prophegy.com/temp/flash2.html

Any insight into why this happens is greatly appreciated!!

John

Display Single Digit Numbers With A Zero Before It
Is there a way to make flash put a 0 in front of the numbers 1-9 when it computes a value equal to 1-9? so it would display 01, 02, 03... instead of 1, 2, 3... ?

thanks in advance : )

Popup. Only Needs To Display A Single Image.
i saw the tut on this site but it says no dice for netscape and mozilla. i enjoy opera so thats no good for me.

i have a gallery that i would like to have the thumbnails clicked and open the images in a new window, since the images are bigger than my flash site in some cases.

i've tried with javascript but with no luck. all i really want is a window with no buttons or scrolling etc. can anyone point me to a tutorial or tell me a good way to do this, any help would be appreciated.

Popup. Only Needs To Display A Single Image.
i saw the tut on this site but it says no dice for netscape and mozilla. i enjoy opera so thats no good for me.

i have a gallery that i would like to have the thumbnails clicked and open the images in a new window, since the images are bigger than my flash site in some cases.

i've tried with javascript but with no luck. all i really want is a window with no buttons or scrolling etc. can anyone point me to a tutorial or tell me a good way to do this, any help would be appreciated.

Need To Display Multiple Font In Single Text Field
Hi All,
I am working on a flash application which would have a text field displaying multiple fonts in it. I have embedded the fonts and have added it to the library.I can view them in my computer whereas when viewed in another computer without the font used, display is different.

Add a <font face="library font one">registered mark </font>directly (®) or <font face="library font two"> with a Unicode escape sequence</font>

After the fonts are embedded size of the swf does go up. What could be wrong?

How Do I Display Data From 2 Lists In A Single Barchart Component
Hello Everybody,

I'm new to flash. I'm using the flash barchart component, which gets the values from a cfc via remoting. See the below code. It magically works.

var theData = new DataProviderClass();
var items = new Array();
for (var i = 0; i < list_temp.length; i++) {
items = {bytes: "", value: list_temp};
}

for (var i = 0; i < items.length; i++) {
theData.addItem(items);
}

myChart.setDataProvider(theData);

In the code above I'm looping through the list (list_temp - ex: 100,200,300,400,500) and pushing its contents in a array (items). Looping through the array and pushing the values to the top of the chart's data provider and finally setting the instance of the chart component with the data.

So all this works fine. I want to now pass another list of data to the same chart. So I want the chart to display the data from two lists. I don't know how to do this and need your help.

Basically I want my graph to represent the sales figures in the current month and sales figures in the last month. If possible display the sales figures in two different colors. I hope this is making sense. Please help

Allan


Playing A 20 Frame Movieclip In A Single Frame
can anyone tell me how to get a movieclip to play in a single frame before it goes to the next frame on the timeline?

Click On Choice Of Pictures, Display Enlarged Image In Single Box
First of all, I am new to actionscripting.

Basically, I have a bunch of small photo's lined up on my flash 8 GUI.

How can I code it so if one picture is clicked on, it will appear enlarged in a separate box another place on the gui?

Thanks for all your help!

Load Single Mc At Random Interval
I have a mc &amp;quot;bird&amp;quot; on the root timeline I would like to load randomly between 15-30 seconds. It is the same mc over and over, I just want to break up its pattern a bit with a random load. On the bird mc I have the following:


function go() {
_root.loadMovie("mc1");
}
setInterval(go, 100000);


HOWEVER, this gives me the following error after 10 seconds:
Error opening URL &amp;quot;file:///C|/Documents%20and%20Settings/John/Desktop/mc1&amp;quot;

Anyway....if anyone that knows what they are doing can help lead the blind (me), I would appreciate it. Again... being able to set a min and max interval time and randomly load the same movie clip on the main time line is what the goal is.

Using Flash Pro 8 AS 2.0





























Edited: 02/04/2008 at 08:46:33 PM by harms239b

Load Images Into A Single MC
I have a single rectangular movie clip (see diagram) where I want to load several images into it.

At the moment, when I use the lines:


Code:
main.loadMovie("image0.jpg");
main.loadMovie("image1.jpg");
main.loadMovie("image2.jpg");
Obviously, only image2.jpg appears. I want to load 3/4 images and have them appear in the format shown in the diagram. How can I achieve this? Plus, how can I position these images and text with the MC?

For the record. I'm using Claudio's scroller. Therefore, I intend this MC and the images & text within it to be scrollable.

Thanks

Load Images Into A Single MC
I have a single rectangular movie clip (see diagram) where I want to load several images into it.

At the moment, when I use the lines:


Code:
main.loadMovie("image0.jpg");
main.loadMovie("image1.jpg");
main.loadMovie("image2.jpg");
Obviously, only image2.jpg appears. I want to load 3/4 images and have them appear in the format shown in the diagram. How can I achieve this? Plus, how can I position these images and text with the MC?

For the record. I'm using Claudio's scroller. Therefore, I intend this MC and the images & text within it to be scrollable.

Thanks

[F8] Random Placement Of Mc That Grows Out From A Single Point
Hopefully I can do a decent job of explaining what I'm trying to accomplish. Currently I'm using this code to duplicate an animated (growing) circular movie clip across the stage to reveal a masked image:

Code:
X = 0; // X StartPoint of the MoveiClip ( Growing Animated MC)
Y = 0; // Y StartPoint of the MoveiClip ( Growing Animated MC)

dupliX = _parent.mcImage._width / 50; // Number of Duplication in X-Axis with respect to the width of the Image
dupliY = _parent.mcImage._height / 50; // Number of Duplication in Y-Axis with respect to the height of the Image


for (i=0; i<dupliY; i++) {
X = 0;
for (j=0; j<dupliX; j++){
duplicateMovieClip("mcItem", "mcItem"+i+"_"+j, this.getNextHighestDepth());
eval("mcItem"+i+"_"+j)._x = X + 15;
eval("mcItem"+i+"_"+j)._y = Y + 55;
X += 50;// X position change with in the line
}
Y += 50; // Line Change
}


I want to introduce random placement. rather than having these masks all in allignment across the page I want them to duplicate and appear in random locations across the stage.

I imagine I'll have to set boundries with variables as to where the mc can be duplicated. Something like this:

Code:
xMin = 0;
xMax = 500;
yMin = 0;
yMax = 280;

How do I then get the placement to happen randomly?

That is step 1, but then I'd like to figure out how I could incorporate everything I just described and tweak it so that the duplicated mcs would grow from a certain point on the stage.

This process would have to happen over time and continue to grow. For example, if you use x=50 & y=120 start point, the first 3 duplicated mcs would apear within lets say within 100px from the org. start point and that would happen within the the first 1/2 sec. Next, the duplication would happen again but this time within 200px of the startpoint duplicating 6 more mcs and again in a 1/2 sec. this would continue until the stage was full and the image was fully revealed. Is this even possible?

Fps In A Single-frame App
Hi guys.

I'm developing an app in flash, and it only has a single frame in the timeline, everything is scripted.
Since it's my very first flash work when i started it i left the "fps" settings in my main fla in the default 12fps that Flash8 has. Now i have a few dragable components into my stage and they are working great but if i wonder if increasing the fps would do the drag looks more smoothly... because i've read that fps determines the "refreshing" of everything, Is that true?

If it is..are there any cons on increasing fps?
In the other hand those dragable elements are imported to library from other fla's...is there any difference changing those fla's fps?

Thanks!

Random To Call Flash Movies In A Single Htm Page
do you know how to call 1 of flash movie in an html page with special script(javascipts???)

Animation On Single Frame
I have create a symbol that will keep changing. But once the main timeline has stopped, the symbol also stop. How do i make the symbol continue changing even when the timeline has stopped. I have set the symbol to loop, but when return to main stage, it stills stopped. And if I add panel control such as stop to the keyframe. All tweenings on that keyframes also stop. I don't want the tweenings to stop, only the frame. Please help...thanx

HELP Print Single Frame
Hello. Thanks for the peek. I am trying to print a single frame from my flash MX .exe. I have tried the #p labeled frame in an MC but it isn't working. This is action for the print button:

on (release) {
print("_root.1big", "bframe");
}

1big is a movie clip (instance name) on the main timeline. The MC only has one frame and it is labeled #p. It is presently trying to print all frames. What do I do?? Have searched the forum but the answers are cloudy and that is if they are even answered.

Thanks,
1M.

Single Frame Looping
I have a stop action on frame 1 of my timeline. I need this stop action for my actionscripting to work. How can I do a "ifFrameLoaded" loop action within this frame? I have the actionscripting going on this frame and I also need a loop going on to check to see if a frame down the line in the movie is loaded, once it is I need the movie to gotoandPlay frame 2.

--Thanks for any help

Kyle

Preloading A Single Frame?
Can you use a preloader to load a single frame?

I've got a game I made that's a maze. The squares are colored, and depending on the state of the movement token, you can move the token around.

All is well in the stand-alone player, but when I try it in IE, half the time the maze isn't colored, but simply comes out white (the default color of the squares).

I'm thinking that it might be some kind of load-time issue, and the execution is somehow getting truncated. I've attached the file. Any help would be hugely appreciated.

Pre-loading A Single Frame...
Running Flash 5.0.

Here's the scenario: I know how to make your traditional "if frame is loaded" pre-loader, but that won't work for what I'm trying to do. On my site, I have the option to load music into a level of my main .swf. The music file is basically a .swf with 3 key frames:

1. if frame 3 is loaded, goto and play 3
2. goto and play frame 1
3. music file

But I deceided I wanted to try something new. I want to put a "loading progress" bar into it so the user can tell how far along the download is, but I don't know a way to program the file to determine the progress of a single frame.

Does anyone out there know how I can do this? It'd be a BIG help

Printing A Single Frame
I have a movie clip with a control bar, on the control bar is a stop and a print button. I want the user to be able to stop the movie and then print the current frame. Is there any way to do this without using #b as a frame label?

Printing A Single Frame
I have a movie clip with a control bar, on the control bar is a stop and a print button. I want the user to be able to stop the movie and then print the current frame. Is there any way to do this without using #b as a frame label?

Refresh A Single Frame?
Hello all, I have a slight problem. I have a frame with 20+ movable MCs on it. I also have a button on the bottom that will refresh the frame. In essence I just want it to put all the MC's back to their start position, visibility, etc.

I have the same button on another frame and the


on (release) {
gotoAndStop (4);
}

works perfect there, but the same code on the button that is ON frame 4 doesn't do anything.

Is there something simple I can put on this button to refresh that frame only?

Right now I just have the Frame 4 button gotoAndPlay (3) then when it plays it comes back to Frame 4, but that looks stupid.

Any Ideas?

I am using MX Pro 2004 if it matters.

Thanks!

~MoN

Movie In A Single Frame?
Hi,
Does anyone know how to make a movie / graphic play in a single frame? when the whole flash movie has stopped on a single frame, i still want the chicken to wiggle from left to right! ? can anyone help?

Thanks

Won't Work On A Single Frame...
Hi All - I am hoping that someone can put me right on this...

I am trying to integrate a lightbox type of effect into my fla - the fla basically consists of a single frame timeline - with content contained in a movieclip

I have got the lightbox working fine - but it needs to be on two frames - the first frame of the timeline has this script...

PHP Code:




myListener.onResize = function () {
centerItems(); // called when you resize
}
centerItems(); // called on load
Stage.addListener(myListener);







and this is on the second frame:


PHP Code:




var cb:ThickBox = new ThickBox ();
CENTERpages.img1.onRelease = function() {
    cb.loadThickBox ('img01.jpg', 'loader_mc');
};
CENTERpages.img2.onRelease = function() {
    cb.loadThickBox ('img02.jpg', 'loader_mc');
};
CENTERpages.img3.onRelease = function() {
    cb.loadThickBox ('img03.jpg', 'loader_mc');
};
CENTERpages.img4.onRelease = function() {
    cb.loadThickBox ('img04.jpg', 'loader_mc');
};







when I drop the second frame script onto a layer of the first frame of the timeline the resize/centered effect won't work!

the fla also calls this script to set the lightbox up - how can I make this work in a single frame timeline???


PHP Code:




/*
ThickBox, versión 1
actualizaciones: www.after-hours.org
autor: Toni López
versión: 1.0
*/
import mx.transitions.Tween;
import mx.transitions.easing.*;
class ThickBox {
    /*
    propiedades:
    width,height: ancho y alto del objeto Stage
    centerX, centerY: calor cálculado para centrar objetos (escenario/2) - (objeto/2)
    box_width,box_height: ancho y alto inicial de la caja blanca
    */
    private static var width:Number;
    private static var height:Number;
    private static var centerX:Number;
    private static var centerY:Number;
    private static var box_width:Number;
    private static var box_height:Number;
    private var x:Number;
    private var y:Number;
    /*
    bg_mc: capa semitransparente que ocupa todo el ancho alto de la pantalla
    box_mc: marco para la imagen
    image_mc: contiene el clip contenedor holder_mc y tiene comprtamiento de botón.
    holder_mc: carga la imagen
    loader_mc: contiene el clip de película precarga.
    */
    private static var bg_mc:MovieClip;
    private static var box_mc:MovieClip;
    private static var image_mc:MovieClip;
    private static var holder_mc:MovieClip;
    private static var loader_mc:MovieClip;
    // -- constructor de la clase
    public function ThickBox () {
        // -- ancho y alto del escenario
        width = Stage.width;
        height = Stage.height;
        // -- calcular centrado
        centerX = Stage.width / 2;
        centerY = Stage.height / 2;
        // -- tamaño de la caja inicial
        box_width = 200;
        box_height = 200;
    }
    /*
    método: drawBox (dibujar cajas)
    parámetros:
    clip: Clip de películ destino.
    x: Posición en eje _X
    y: Posición en eje _y
    w: Ancho final.
    h: Alto final.
    c: Color
    a:Number
    */
    private function drawBox (clip:MovieClip, x:Number, y:Number, w:Number, h:Number, c:Number, a:Number) {
        clip.beginFill (c, a);
        clip.lineTo (x, h);
        clip.lineTo (w, h);
        clip.lineTo (w, y);
        clip.lineTo (x, y);
    }
    /*
    método: loadThickBox (motor)
    parámetros:
    url: dirección donde se encuentra la imagen que se cargará
    tween_mc: clip de película vinculado en la libreria del clip de película
    que instancia a la clase (opcional)
    */
    public function loadThickBox (url:String, tween_mc:String) {
        // -- dibuja la capa negra con transparencia.
        bg_mc = _root.createEmptyMovieClip ("bg_mc", _root.getNextHighestDepth ());
        /*
        Asignando evento de botón a  la capa transparente(bg_mc), se evita que
        los botones y clips de película en niveles inferiores reciban eventos.
        */
        bg_mc.onRelease = disable ();
        // -- aparece bg_mc con suavizado _alpha
        drawBox (bg_mc, 0, 0, width, height, 0x000000, 30);
        new Tween (bg_mc, "_alpha", None.easeOut, 0, 100, 1, true);
        // -- dibuja la caja que alberga la imagen que se amplia.
        box_mc = _root.createEmptyMovieClip ("box_mc", _root.getNextHighestDepth ());
        box_mc._x = centerX - (box_width / 2);
        box_mc._y = centerY - (box_height / 2);
        drawBox (box_mc, 0, 0, box_width, box_height, 0xffffff, 100);
        /*
        Se asignan eventos de botón a image_mc, el evento onRelease, provoca
        el cierre del ThickBox, el comportamiento botón se activa una vez finalizada
        la carga de la imagen.
        */
        image_mc = _root.createEmptyMovieClip ("image_mc", _root.getNextHighestDepth ());
        image_mc.enabled = false;
        image_mc.onRelease = destroy;
        // -- crear contenedor imagen
        holder_mc = image_mc.createEmptyMovieClip ("holder_mc", _root.getNextHighestDepth ());
        image_mc.holder_mc._alpha = 0;
        // --
        var mcLoader:MovieClipLoader = new MovieClipLoader ();
        var listener:Object = new Object ();
        // -- elminar animación preloader una vez alcanzado el 100% de la carga
        listener.onLoadComplete = function (target:MovieClip):Void  {
            loader_mc.removeMovieClip ();
        };
        // --
        listener.onLoadInit = function (target:MovieClip):Void  {
            // -- centrar image_mc.holder_mc
            target._x = centerX - (target._width / 2);
            target._y = centerY - (target._height / 2);
            // -- tween ancho box_mc
            var w1:Number = box_mc._width;
            var w2:Number = target._width + 20;
            var tx:Object = new Tween (box_mc, "_width", Regular.easeIn, w1, w2, 0.5, true);
            // -- tween _x box_mc
            var x1:Number = box_mc._x;
            var x2:Number = centerX - (w2 / 2);
            new Tween (box_mc, "_x", Regular.easeIn, x1, x2, 0.5, true);
            tx.onMotionFinished = function () {
                // -- tween _width box_mc
                var h1:Number = box_mc._height;
                var h2:Number = target._height + 20;
                var ty:Object = new Tween (box_mc, "_height", Regular.easeIn, h1, h2, 0.5, true);
                // -- tween _y box_mc
                var y1:Number = box_mc._y;
                var y2:Number = centerY - (h2 / 2);
                new Tween (box_mc, "_y", Regular.easeIn, y1, y2, 0.5, true);
                // -- tween _alpha image_mc
                ty.onMotionFinished = function () {
                    new Tween (target, "_alpha", None.easeOut, 0, 100, 1, true);
                    // -- permite recibir eventos de botón a la imagen (onRelease = cerrar ThickBox)
                    image_mc.enabled = true;
                };
            };
        };
        mcLoader.addListener (listener);
        mcLoader.loadClip (url, image_mc.holder_mc);
        // -- mostrar animación precarga si se especificó.
        attachPreloaderTween (tween_mc);
        // --
    }
    // -- animación precargar
    private function attachPreloaderTween (attached_mc:String):Void {
        loader_mc = _root.createEmptyMovieClip ("loader_mc", _root.getNextHighestDepth ());
        loader_mc.attachMovie (attached_mc, attached_mc, loader_mc.getNextHighestDepth ());
        loader_mc._x = centerX - loader_mc._width / 2;
        loader_mc._y = centerY - loader_mc._height / 2;
    }
    // -- esconde cursor mano para background gris
    private function disable () {
        bg_mc.useHandCursor = false;
    }
    // -- eliminar todos los clips de película
    private function destroy ():Void {
        box_mc.removeMovieClip ();
        image_mc.removeMovieClip ();
        // -- la capa oscura desaparece con suavidad.
        var at:Object = new Tween (bg_mc, "_alpha", None.easeOut, 80, 0, 0.5, true);
        at.onMotionFinished = function () {
            bg_mc.removeMovieClip ();
        };
    }
}







...can anyone see how to do it please?

Only Get Single Frame When Reimporting Swf
Hi,

I work for a company where one guy made an animation and exported it as a swf file, then got fired, and the fla file was erased. I need to import the swf file as single frames to change it but I only get the first frame.

Also for some reason I was able to import it this way before, but now I can't. I saved the original swf file, so I don't even understand why I only get a single frame now when I was able to import it before.

How can I import all the frames to a new fla file?

Loop Single Frame With AS
I have a main timeline with 3 frames. I use AS2 to pause them, with

PHP Code:



function pause(){

play();

clearInterval(timer);

};


stop();

timer = setInterval(pause, 2500);




in the first frame, and just


PHP Code:



stop();
timer = setInterval(pause, 5000);




on the next two.
It's basically a slideshow, with no fancy transitions or animation.
However, on frame two, I have a Movie Clip with an animation that plays for 60 frames/4 seconds. I'm AS noob, but assume the stop hinders the MC playing.
What I want is this frame to play (or loop ?) for 4 seconds, preferably with AS, instead of inserting frames in the main timeline for the duration of the MovieClip.

The solutions I've found so far all involve scripts with two or more frames.
Any help, hints and suggestions would be greatly appreciated.

Single Frame Actionscript
Hey Guys,

My coding conventions for AS suck. Since my start with actionscript I've been attaching my code to objects and their instances. My larger projects become almost too convoluted to debug and I am in desperate need to change my habits to a single location for all my actionscript. My question is regarding attaching movieclips and the standard convention.

For Example:
Lets say I set up a basic site that has 3 pages (each a movieclip) and I attach them using simple buttons calling an attachMovie() function. Since I'm attaching the pages I can't define the unique functions for each page until after they've been attached.

Is it recommended to avoid the attachMovie function and rather hide the already attached clips?
Or would it be recommended to create an initialize function for each page?
Or is there some better standard?

I want to make the move to writing better code so all advice helps

Thanks,
theitalianone

Preloading Single Frame Swf,,
I have a problem with loading one frame swf,
I put the preloader within this frame, the preloader appears after loading finishing !!!
hence it does not achieve its purpose,
how can I preload one frame swf??

Replaying A Single Frame
This question seems very elementary, and I'm surprised that after using Flash for a few years, I've never come across an ideal solution. I've come up with several satisfactory ways to work around the issue, but never a direct solution. Anyway...the question - How can I replay a single frame until some condition is met? For example (I realize this is not practical and could be handled with a for loop, but just for the sake of simplicity):

Frame 20
if (c == 1000){
trace("i'm done");
stop();
}
else{
c++;
gotoAndPlay(20); // <-- I realize this doesn't work, but it's the idea I want
}

How can I accomplish this without adding an extra movie clip or using 2 frames? Thanks.

Different Frame Rates In A Single Fla?
Hi all,

I've created a simple animation which I have exported as an swf. I really want to be able to have lots of this animation duplicated all on one fla document, each playing at different speeds. Is there any way of having several swf files playing in a single fla all at different frame rates (or any other way of varying the speeds?).
thanks in advance! Beet.

Single Button That Loads Multiple Images
hello all- i'm working on a project using flash 4-is there a way to command a single button to load consecutive images? for instance-first click loads image A, next click loads image B etc- then have a second "back up" button which can "back up" the photos if the viewer wants to go back and review an earlier photo.
i'm aware of a "scroll strip" where i would connect all the photos together and use a mask- but i'm very concerened about load time- these are fairly large photos-thus my reluctance to load them all into one frame. each page will have about 10-15 photos!
any help will be most appreciated.
thanks
r

Call A Single Random Movie Clips To Play Out Of A Group
Hi all,

Right , I have 10 movie clips on the stage and I want to call one randomily to play every so many minutes..I used to do it like this in flash 4...how do I do it in 5

-----------------------

Begin tell target ("/MC" & (Random(9) + 1))
go to and play
end tell target

-----------------------

it's adding the name on to the end of the movieclip I confused about ...I want it to ..call MC1..then MC6...then what ever.
("/MC" & (Random(9) + 1)) is this bit I need to create in the new form of action script

3 Sec Delay Using A Single Frame Script
Does anyone have a suggestion for creating a two to three second time delay within a single frame script???

Printing Single Frame With Flash
I have a site with several pages and I can print it out no problem. but I am trying to only print out 1 page so what code would i need to isolate one frame for print

thnaks
J-

Timing For Single Frame Movie
need to find out how to get the frame that a playing movie is on.
the movie is attatched to the stage through actionscript. using functions to control specific tasks but i need to find out where each movie that is running is so i can control other movie clips to respond at the right time.

HELP

Enter Key In Single Frame Chat
I'm working on a Flash/ASP chat application and have everything working BUT the enter key. I want the enter key to submit the comment the same way clicking the button does. The movie is only a single frame long.

In one layer, I have this action script:


Code:
function onChange(component) {
if (component._name == "btnGo") {
addComment()
}
if (component._name == "btnLogOff") {
getURL("leavechat.asp?isession="+isession)
}

}
function addComment() {
varComments = new LoadVars();
varComments.NewComment = myComment.Text;
loadVariablesNum("addcomment.asp?isession="+isession,0,"POST");
myComment.Text = "";
myComment.setFocus;
}
In another layer, I have:


Code:
if (Key.isDown(Key.ENTER)) {
addComment();
}
The enter key submits the form maybe 75% of the time but the other 25% of the time you have to hit the enter key twice or even three times to get it to go!

Any help would be appreciated!

Time Delay In Single Frame
hello,

i am inside MovieClip.
50 frames of animation inside the same.
when the header comes to 25th frame, i want to stop the header for 5 seconds and should proceed to next frame.
[ i have seen the scripts which uses another movie clip for the same.
but i want to do all those scripts in a single frame. ]
- how to do this.

Thank you in adavance

How Do You Make You Animation Into A Single Frame?
I would like to know how you can turn your animation into a single frame animation like this .fla file...

Custon Cursor For Single Frame...how Do I Do It?
How do I make this:

onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
mouse.show();
}

For only 1 frame that I want? Since I made a custom cursor but I want it to only work on frame 10....

Checking To See If A Single Frame Loaded
Im trying to figure a way to check and see if the current frame is laoded ...maybe something like this ... if(_root._currentframe.loaded) etc etc but thats obviously not it .. this is for streaming sound because im trying to make a text box display text that says buffering or playing ...and if the current frame isnt loaded yet then it would say buffering. if you know a way to have a sound bufferer function or know a way to check and see if the current frame is loaded please respond.

Taking A Picture Of A Single Frame
How do I take a picture of a single frame in flash and then save it as a bmp or jpg or other image file?

Is this possible and if it is how do I do it?

Thank you!!!

Craig

Copyright © 2005-08 www.BigResource.com, All rights reserved