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




When A Picture Is Loaded?



Hi Flash World;

I'm trying to do one simple thing... I'm trying to load a picture and when this it's loaded I want to mask that loaded picture.

When I load the picture... for instance pressing a button and the next sentence is loaded_movie_image.setMask(myMask) it doesn't work... but if I create this button to load and another button to mask ... it works properly. I think the error is that if I write both sentences together the computer goes to the second and the picture isn't loaded yet. So... this is my question.... is it possible to know when a picture is loaded? or is it my error?

Thank you very much!!!



FlashKit > Flash Help > Flash MX
Posted on: 06-10-2002, 10:11 AM


View Complete Forum Thread with Replies

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

I Want A Picture To Appear In My Flash Movie.. But.. I Want The Picture Loaded From..
I want a picture to appear in my flash movie.. but.. I want the picture loaded from the internet.. so..

In other words..

I have a button. When i press the button, I want this image:

http://www.era-morrison.com/westford/media/topper.gif

to show up.. Im also going to apply a variable, so I cant just copy and paste the image into the flash file.. Is this possible? thanks!

Picture Appearing Along With The Kbs Loaded..
hi

i got a script of progress bar which looks like this :


Code:


var totalSize; // will hold the whole movie size
var amountLoaded; // will hold how much is in cache
var percentComplete; // will hold the result of a calculation

totalSize = _root.getBytesTotal();
amountLoaded = _root.getBytesLoaded();
percentComplete = (amountLoaded/totalSize)*325;

_root.bar._xscale = percentComplete;

if (percentComplete == 100) {
gotoAndPlay (3);
}



there's a rectangle named 'bar' .
what i'd like to have is a picture being revealed along with
the procentage of kbs loaded. maybe revealed is a bit ambigous - it should be wind ( from left to right ).

any ideas how that could look like?

thanks.

Dynamically Loaded Picture - Resizing
I am working on a picture viewer that will step through all pictures in folder. The pictures are all different sizes.

How would i go about resizing the dynamically loaded picture to fit inside a specified area in the movie? Below is the update function used to load the picture.

Thanks

function update() {
url = filename+picnum+".jpg";
loadMovie(url, picture);
}

Positioning Picture That Is Loaded Dynamically
Hello all -
This is my first posting here and I need help. What I'm doing is putting together a site that will dynamically load photos that will be uploaded daily. The visitor enters a code and then the flash movie brings up their photos one at a time. They click 'Next' to see the next photo, etc. I am using Flash MX so I utilized loadMovie to bring the pictures in. As this is dynamic and new photos will be added every day, i use a loop to bring in the pics. All the photos will be saved as image1.jpg, image2.jpg inside a folder named with the code given to that person. Now - what I want to do is spontaneously position the pics on the page. As there will be both landscape and portrait formats, the movie needs to evaluate which they are (I'm using a width>height type test) and then positioning the pic to a pre-set coordinates of x and y for that format. How do I evaluate and then position the photos? In case I wasn't clear, the pics are loaded into the same empty MC. Any suggestions? Thanks for any help you can offer

Loaded Picture Hides Cursor
Hi!

I have a custom cursor in place, which (after some trouble) finally works just like a regular mouse cursor.

The only problem comes when I load a picture from the main script- the image takes priority over the cursor. In other words- the cursor is in 'on top' of everything until I load an image from my xml file:


Code:
_root.createEmptyMovieClip("holder", 1000);
holder.loadMovie("pics/"+XML_object ... ... ...);
at this point the cursor is still in front of everything except the newly loaded image.

I've tried changing the layer it loads to, but I'm not the best actionscript guy around. Could someone recommend a potential solution?

Many, many thanks for any help.

Gallery Problem, Only First Picture Is Loaded
Hi
I try to put together a gallery with transitions out and in, loading pictures from an XML file, but only the first picture is loaded.
I cant figure out what's depending on.
I'm stacked with that problem since several weeks and I cant go further in working on the gallery.
Can someone have a look at my code, please?


PHP Code:



var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
    if (success) {
        var gallery = this.firstChild;
        for (var i = 0; i<gallery.childNodes.length; i++) {
            tArray.push(gallery.childNodes[i].attributes.title);
            pArray.push(gallery.childNodes[i].attributes.source);
        }
        con.loadPic(0);
    } else {
        title_txt.text = "Error!";
    }
};
gallery_xml.load("gallery.xml");
//--------------------------------
var pArray = new Array();
var tArray = new Array();
var c = 0, con, oldCon;
MovieClip.prototype.loadPic = function(id) {
    info.text = "";
    con = this.duplicateMovieClip("cont"+c, this.getNextHighestDepth());
    oldCon = this._parent["cont"+(c-1)];
    c++;
    con._alpha = 0;
    con.loadMovie(pArray[id]);
    temp = this._parent.createEmptyMovieClip("temp2", 998);
    temp.onEnterFrame = function() {
        var t = con.getBytesTotal(), l = con.getBytesLoaded();
        if (con._width) {
            doTransition(id);
            delete this.onEnterFrame;
        }
    };
};
//-------------------------------
import mx.transitions.*;
//-------------------------------
function doTransition(id) {
    con._alpha = 100;
    var transType:Transition = Photo;
    var myTM:TransitionManager = new TransitionManager(con);
    myTM.startTransition({type:transType, direction:0, duration:2, shape:empty, startPoint:5, xSections:empty, ySections:empty, dimension:0, easing:easing.Elastic.easeOut, shape:empty});
    function transOut() {
        if (con.getBytesTotal()>20) {
            var myListener:Object = new Object();
            myListener.allTransitionsOutDone = function() {
                loadPic();
            };
            var transType:Transition = Wipe;
            var myTM:TransitionManager = new TransitionManager(oldCon);
            myTM.addEventListener("allTransitionsOutDone", myListener);
            myTM.startTransition({type:transType, direction:1, duration:0.5, shape:empty, startPoint:5, xSections:empty, ySections:empty, dimension:0, easing:easing.Strong.easeOut, shape:empty});
        } else {
            loadPic();
        }
    }
}
//--------------------------
this.prevb.onRelease = function() {
    if (c == 0) {
        con.loadPic(pArray.length-1);
    } else {
        con.loadPic(c-1);
    }
};
this.nextb.onRelease = function() {
    if (c == pArray.length-1) {
        con.loadPic(0);
    } else {
        con.loadPic(c+1);
    }
}; 

How To Print Dynamically Loaded Picture
Hi, I want to print a page with dynamic text boxes and a dynamically loaded picture. The text boxes get printed with all the right values, but the picture is still missing. I'm loading this picture via a loadClip in a movieclip "logoHolder" which resides in the movieclip that gets printed. At the second frame I have the bounding box for the printed page. I have tried various things, such as putting the movieclip "logoHolder" inside the bounding box frame, but it didn't do the trick. The actual print command is executed on the onLoadComplete event of the loadClip of my dynamically loaded jpg to ensure that it's fully loaded.

I am really stuck here, have searched the forums but no luck yet. Who can help me out?

Load A Picture After Loaded Mc Is Done Playing
I have a mc called thisAgent. We have a bunch of swf files that have a "teacher" helping a student out with algebra. The problem we have is that sometimes the clip ends with the "agent" blinking or with just a dumb look on there face.

THE SOLUTION: What we want to do is unload the movie as soon as it is done playing and then load a picture into the mc.

THE PROBLEM: I don't know how to detect when the mc is done playing the swf.

THE SETUP: The setup was really easy. We just used loadmovie:
loadMovie("the movie we want to play.swf", thisAgent);

So is there a onFinishedPlaying or something like that I can use to determine when to unload the mc. We are deploying Monday and I have a bunch of other things that I need to fix too so any help on this would be great. Thanks for all the help you have provided in the past.

Jason

Picture Album Using Loaded Variables
What i am trying to create is an online photo album which uses the fuction 'loadMovie' to load thumbnail .jpg images. Currently, the .fla file has two buttons. These buttons correspond to two individual sets of pictures. The way I invision the album working is that when the user presses one of the buttons, a variable will be called-in from a text file giving the flash the number that corresponding to the right set of images. This number will be concatenated with a string of text that will create the correct url for the images being displayed. Using a series of for loops, i was able to achaive this.

If you view the .html file you will see that the code works as the images are displayed. However, I am not sure how to utilize that similar code from the buttons so that i can change the images being displayed. I would greatly appreciate your input and that is why i have provided the following new links.

http://www.bootie.org/~toni/picNum.txt
http://www.bootie.org/~toni/picLoad.html
http://www.bootie.org/~toni/picLoad.fla

and a link to a folder with the images:
http://www.bootie.org/~toni/images/

I would greatly appreciate if anyone could look at the .fla and tell me now i can produce a similar affect as seen now; however, that may be able to be controlled with buttons. THank you =]

Event-Handler On A Loaded Picture
Hey Guys,

I think I'm getting crazy
I don't get my stupid script to work.

Alright, I try to create an emptyMC (this works ;-))
Then I laod an image to that MC with load movie.
Now I want to give the MC an Event-Handler.

Here ist what I tried so far:


ActionScript Code:
for (xy=1; xy<5; xy++) {    createEmptyMovieClip("dodo"+xy, xy);    _root["dodo"+xy].loadMovie("w.swf", xy);    _root["dodo"+xy]._x += sx;    _root["dodo"+xy]._y += sy;    sx += 75;    sy += 75;}


Ok this creats now 5 MC's and move them 75 on the x and y.

This works fine but the eventhandler is empty wenn I use this:

I have an empty MC wich has this action


ActionScript Code:
onClipEvent (enterFrame) {    for (xa=1; xa<5; xa++) {        _root["dodo"+xa].onRollOver = function() {            _root["dodo"+xa]._x += 10;            _root["dodo"+xa]._y += 25;        };    }}


It looks like that each Object has an event, because when I move the mouse over the even the courser changes, but nothing happens.

Has someone any sugguestions what I could try.
Or maybe there is an easier way to generate something like that.

Thanks vor you help

Preloader For XML Loaded Picture Slider
The script below creates a slideshow of images. I've been trying to create (1) a preloader that will load all the images before showing any of them or (2) a preloader for each individual image.
Can anyone help?


Code:
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("food.xml");
////////////// arranges contents of XML data into two arrays
///// image - which is a url to the image
///// widths - the width of the image (necessary for setlocation() function)
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
widths = [];
totalwidths = [];
totalwidths[0] = 0;
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
widths[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
for (i=0, count=0, j=1; i<total; i++, j++) {
y = widths[i] - 0;
count = count+ y + 3;
totalwidths[j] = count;
}
loadimages();
}
};
/////////// loads the images into individual movieclips
function loadimages() {
widths = [];
var totalwidth = 0;
for (i=0;i<total; i++) {
var picref = this.createEmptyMovieClip("container"+i,i);
picref.loadMovie(image[i]);
}
setLocation();
};
//////////////// sets the _x location of the images
function setLocation() {
for (i=0; i<total; i++) {
var contain = "container"+i;
setProperty (contain,_x,totalwidths[i]);
}
};
////////////////// scoller limits
this.onEnterFrame = function() {
var rightposition = (700 - 344 - totalwidths[total]);
if (_root.nav.contents._x >= -344) {
tellTarget ("_level0.nav.scroller.scroll_right") {
gotoAndStop(1);
enabled = false;
}
} else {
tellTarget ("_level0.nav.scroller.scroll_right") {
enabled = true;
}
}
if (_root.nav.contents._x <= rightposition) {
tellTarget ("_level0.nav.scroller.scroll_left") {
gotoAndStop(1);
enabled = false;
}
} else {
tellTarget ("_level0.nav.scroller.scroll_left") {
enabled = true;
}
}
};

[AS 2]How To Resize Dynamically Loaded Picture
Hello,

Guys i have a problem, how can i resize the dynamically loaded pictures:
I use this tutorial:
http://www.kirupa.com/developer/mx2004/thumbnails.htm
but i have around 100 pictures, and i don't have the time to make thumbnails from every picture. i'm thinking to change the image size to display the thumbnails.

In the xml i want to put only the <image>the link of the picture</image> code, and in flash i want to resize this image that will be displayed in the thumbnail scroller.

Any ideas, how i can make this work?

Thanks in advanced, btibia!

How To Have A Picture In Flash, Loaded From A .jpg File?
Hi

Im trying to make a slideshow in flash, but i want to be able to change the pictures in the flash file, by just uploading new ones to a FTP server, with the right names and resolution..

Does anyone know how to do that?

Picture Album Using Loaded Variables
What i am trying to create is an online photo album which uses the fuction 'loadMovie' to load thumbnail .jpg images. Currently, the .fla file has two buttons. These buttons correspond to two individual sets of pictures. The way I invision the album working is that when the user presses one of the buttons, a variable will be called-in from a text file giving the flash the number that corresponding to the right set of images. This number will be concatenated with a string of text that will create the correct url for the images being displayed. Using a series of for loops, i was able to achaive this.

If you view the .html file you will see that the code works as the images are displayed. However, I am not sure how to utilize that similar code from the buttons so that i can change the images being displayed. I would greatly appreciate your input and that is why i have provided the following new links.

http://www.bootie.org/~toni/picNum.txt
http://www.bootie.org/~toni/picLoad.html
http://www.bootie.org/~toni/picLoad.fla

and a link to a folder with the images:
http://www.bootie.org/~toni/images/

I would greatly appreciate if anyone could look at the .fla and tell me now i can produce a similar affect as seen now; however, that may be able to be controlled with buttons. THank you =]

Transitions For Externally Loaded Picture
Hello again, so far i have got the picture gallery working as i want to apart from now i wish to create a nice transition once the picture has loaded. i have tried a number of methods to get a smooth transition and none seem to work

i call a function "picLoaded" once a picture has been loaded, at which point i set the width etc before finally making it visible

ive been trying to make the picture fade in, or ideally some sort of wipe effect before revealing the picture.

ive tried a setinterval loop, but it went really slow no matter what i set the interval too, and i also have tried a while loop to incrementally increase the alpha of the picture, none of these methods seemed to have created a decent effect.

i wonder if any1 has some ideas, tutorials, or base code i could look at to point me in the right direction

thanks guys

Simple Preload For Dynamic Loaded Picture
I need a simple preloader for a single picture.

The problem is that I use

mypic.ondata=function(){
[update preloader code]
}

I need the size of the pic and the number of bytes loaded.


I tried mypic.getbytesloaded and mypic.getbytestotal but they don't seem to work since getbytes.. refer to the main static movie .

Also I do not know if I have to place the update for the preloader in a clipevent(enterframe) on main movie or on the ondata.


I just need to pass name of pic to a swf and I need it to load that pic with a simple preloader progress bar similar to the front pages loads found newseum site.

The preloader is easily implemented when the picture is already in the movie. ie. not dinamically loaded but I need it for dynamically loaded pictures whose name is passed to the .swf via parameters.

Thanks

Dynamically Changing A Picture From 5 Loaded Objects
Hey Guys,

Im having a bit of a problem with some AS3 code and wondered if anyone could help me? Basically, I am trying to get scales to move up and down on depending on the position of a slider. In order to get it to move smoothly I need to load the 5 pictures as it enters that frame (I have managed to get this to work.) I am now having a problem getting the right picture to show as the slider is moved, it currently just sticks on the last picture to be added. Could anyone point me in the right direction of how to swap the picture that is shown depending on the event.value?

My code is below:


ActionScript Code:
for(var i:uint = 1;i<6;i++)
{
  var photo:Loader = new Loader();
  photo.name = "photo_"+i;
  photo.load(new URLRequest("/scales/scale_"+i+".jpg"));
  addChild(photo);
  photo.x = 201.9;
  photo.y = 131.5;
}

function changeHandlerscale(event:SliderEvent):void {
    var photo:Loader = getChildByName("photo_"+event.value) as Loader;
    //getChildByName("photo_"+event.value);
    var choice:Number = event.value;
}

Thanks

Can Flash Remember Which External Picture Was Already Loaded
Hi!

Can Flash remember which external picture or external MovieClip was already loaded-downloaded, so it wouldn't be downloading it again. Maybe store it in some cache or something.

Example:
If user pres a "thumbnail picture button1", the "large picture1" is loaded.
Then the user presses "thumbnail picture button2", the "large picture2" is loaded. So far so good.

Now what I'm interested in is:
If the user presses again "thumbnail picture button1", the "large picture1" should be loaded immediately, without downloading it.

Thanks, Mario :)

Problem With Aligning And Scaling The Picture Loaded Into MC
Hello.

When I use Loader component to show some images it scales and align them in the middle of it(of course scaleContent is set to true)

...is it possible to get same effect in MovieClip?

I've tried so many things to do this and still no progress...

If anybody can help me?...please!

Thanks for now.

mloncaric

Loaded Picture Does Not Follow The Motion Of Its Holder...
HI there ! I browse the FAQs but did not find a solution to my problem... so here it is.

Code:

var l = new Loader(); holderb.addChild(l);
l.load(new URLRequest("fg1.jpg"));
holderb.play();


I have an object on the screen which is a simple empty square, a MovieClip named holderb. It has a small timeline that makes it appears from left to right.
I have pictures to load from a file, called 'fg1.jpg', and I want the pictures to appear in holderb as its holder. Using the following script, the first pictures is loaded but appears at the last position of holderb in the timeline, not at the beginning. What I mean is that the picture loaded does not follow the movement holderb is undergoing.

Reading the followin FAQ : (viewtopic.php?f=29&t=17601&p=88267&hilit=loader+AND+MOVIECLIP+and+content#p88267),
I tried to change holderb.play() by l.content.play() but got an error : "Error #1009: Cannot access a property or method of a null object reference."

What should i do to make the animation work properly ?

Thanks in advance for your help !

Picture1 Loaded -> How To Load Next Picture In Folder? (slideshow)
Hello guys

I want to make a slideshow that runs by itself.

The problem is that it has to be able to see, which picture is loaded and start from there. The reason why, is that you can choose the pictures from a menu, so if you click on the slideshow, it should start from the next picture in the folder.

All pictures are named *name*+number.jpg

Any help is really appreciated.

Regards
Fahlsten

Refreshing Doesnt Update External Loaded Picture
Hello!

I have a simple flash file that loads external jpgs using a MovieClipLoader and loadClip into blank movieclips. Everything works fine and as expected.

However, if I replace or update the jpg files, the browser still displays the old image...even if you hit refresh on the browser.
The only way I can get the new image to display is by manually clearing the browsers cache OR by closing the browser, open it again and enter again to the webpage with the swf... (im trying this with localhost)
The problem with this is, when uploaded on real server... visitors to the site will not see the newly updated image.

Is there any way to remedy this situation?

Thanx in advance for your help!
Cheers,

User Uploads Picture > Can Move And Edit Picture With Tools In Flash File
Hello,

I am looking for some help with this. It seems like something that can easily be done.

http://www.sonypictures.com/movies/t...customization/

I am looking for the user to be able to upload their picture, and then the picture loads into the flash file. once in the flash file, they can move their picture up, down, left or right, rotates in a circle, and also click a button that makes their picture smaller or larger.

I am working on a project for my family, so they can put their picture with an actor and I wanted to know if anyone could point me in the right direction for this?

Thanks so much in advance.

Enlarging A Thumbnail Picture On A Separate Window The Same Size Of Picture
Hi,
I feel like a dumb, but I still need to ask this question:
When you are using thumbnail size pictures acting like buttons, how can you create a link to a new window page the size of the new enlarged picture only?...I don't want a new window showing the picture with a white background covering 100% my Flash site..
You see, I told you it was a dumb question...
Any help?

Upload Picture From Database, Transform Picture In FLash
Hi, all.
I just want to do a test: I made an swf file that is to be embedded in an html web page. Inside swf I want a picture to be upload from database ( for customized purpose ), say ASP, or XML. And new picture will replace that old one inside swf. Further more, e.g. I upload just a picture that is a piece of tile. When it appears in swf, it should be tiled 5 by 5 and transformed for perspective. Is that possible with AS? if yes, could anyone offer help? And how to write interface code -- ASP or xml communicates with FLASH, to upload picture from database? Thanks.

-percy

Changing A Pixel Picture To A Flash Picture
I need help on how to make a Pixeled image into a flash image so i can change it with flash tools. I don't even know if this is possible but someone told me it was. please Help ASAP !!! making a movie for my school !!

Is Loading A Picture? Better Than Having The Picture In The Main .swf File?
Is Loading a Picture? better than having the picture in the main .swf file?

Isn't this going to cause a loading picture "pause/lag" everytime the page is re-loaded?

when the picture is loads once and the user re-loads the page... will it cause it to load the picture again from scratch???

thank you.

Is Loading A Picture? Better Than Having The Picture In The Main .swf File?
Is Loading a Picture? better than having the picture in the main .swf file?

Isn't this going to cause a loading picture "pause/lag" everytime the page is re-loaded?

when the picture is loads once and the user re-loads the page... will it cause it to load the picture again from scratch???

thank you.

Click On A Picture To Download The Picture.
Hello,
How do you set up something so that when they click on a "thumbnail", they download the file. I assume I would set it up as a button... But where do/how do I set up the download aspect after they click on it... anyhelp would be appreciated. Thank you.

Fade: Picture Into Picture(white)
Hi, i want to fade a picture of someone into that picture, but coloured white.

I've tried a shape-tween but it seems that shape-tween don't work well when its about multi-coloured objects.

Does someone know a solution?

Greetz

Using Arrays To Fade Out Picture And In A Different Picture
As Title Says Really.

I have a rectangle with 6 pictures in,
and i have about 10 other pictures to show.
i want to for example:
fade out picture 1, fade in another 7
fade out picture 4, fade in picture 12
fade out picture 2, fade in picture 14

im sure you get the idea, i have tried to look for adding and removing items from an array but couldnt find much concrete info and not sure if that is the right direction i should be looking.

if anybody has any suggestions on where to start looking it would be much appreciated
thanks
Dan Hodkinson

Adding Bg Music/Bg Picture + Picture
I have looked at a few tutorials and none i found really seem to help

This is what im looking to do(im completly new to flash)

I have created a stupid bg image in mspaint that i want as the background

Have a mp3 playing the whole time the flash is run.

and a picture of my mate i cut out in photoshop to appear after say something like 20 seconds this dissapear


sounds so simple but i cant find no online help.

Load Picture No Picture Gallery
i dont want a picture gallery!!!! i just want the commands or what i have to do so when they get to the frame! just download the picture...without clickin a button!!!! can somebody send me a example? mi mail is leerabanal@hotmail.com

PLEASE HELP ME

Picture-in-picture-in-picture- ... -effect
I've seen examples of this elsewhere but just bumped into this one in the kirupa forum in the "cool sites" section:
http://www.sofake.com/

How on earth is this programmed in flash?
I had an idea for our new bendsite and this could be perfect (although our site would have less text and a would be little more image-heavy)
And would it be possible to include multiple links per "zooming-level"?

Thanks in advance!
Sieg

(i'd love to say I'm working on it but I'm 100% stuck because I really don't have a clue on how to begin...)

Picture Within A Picture, Zoomed In
I'm trying to create an effect where a picture is made up of lots of smaller pictures when it is zoomed in. I've uploaded an example which shows a big red cross, but as it zooms in, it looks as if the red cross is made up of lots of small red faces.

Is there a better and more effective way of doing this than what I've done so far? The swf file size is a lot bigger than I want it to be and it slows down quite a bit on some computers. Are there any tutorials out there showing an example of this, or do does anyone have any ideas on how I can improve it?

Thanks for any help
redfaces.fla example 30KB

Second Picture Overwrite First Picture Help
Once i click on the movieclip the picture appear on the stage but if i click on the movieclip, the second object will overwrite the first picture. How can i do to not overwrite the picture? and how can i allow muliple click and mutiple picture appear?









Attach Code

var mySelection = "";//Gobal declaration

wire.onPress = function (){

this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idwire", "wire", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function

}

resistor.onPress = function (){

this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idresistor", "resistor", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function

}

ps.onPress = function (){

this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idps", "ps", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function

}

ammeter.onPress = function (){

this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idammeter", "ammeter", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function

}

voltmeter.onPress = function (){

this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idvoltmeter", "voltmeter", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function

}
//Function for dragging
function dragging(mc)
{
mc.onPress = function()
{
this.startDrag(true);
mySelection = this;
}
mc.onRelease = mc.onReleaseOutside = function()
{
stopDrag();
}
}
//Btn function for flipping
flip.onRelease = function() {
mySelection._rotation += 10;
};

Preloader In Externally Loaded Swf Stops Working (loaded Into An Empty Movie Clip)
SEE BOTTOM OF THREAD FOR CURRENT PROBLEM

1. I have my navigation buttons in level0

2. When a button is pressed it loads an external .swf into the highest empty level

3. There is an MC in this loaded .swf called loadmovie and inside that another MC called empty.

4. Inside the 'loadmovie' MC, there is a frame action that loads another external .swf file into the 'empty' MC.

The problem I am having is that the preloader that is on the external .swf that is loaded into the 'empty' MC does not work.

It works fine if you test it on its own. But not when loaded into a Movie Clip.

MY SCRIPT:
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = (iBytesLoaded/iBytesTotal)*100;
percentageNumber = Math.round(iBytes)+"%";
setProperty("progressBar", _xscale, iBytes);

Do I have to refrence it differently? Because of where it is situated?

e.g
iBytesTotal = _level32._root.loadmovie.empty.getBytesTotal();

confesed!

Calling A Function That Is Whithin An Externaly Loaded Clip Form Another Loaded One
I am having trouble, I am loading external movies within a target that is on another movie clip. If I call it directly in that movieclip it works. What I need to do is call it from a button that exists in another movie clip. Help Please.

on (press) {

_root.paperSlide.my_mc2.loadClip("movies/apollo.swf", "secondaryContnent");

}

my function is called my_mc2 which is located on the firs key frame of _root.paperSlide.

if after the script in _root.paperSlide I call the function like my_mc2.loadClip("movies/apollo.swf", "secondaryContnent"); it works fine. But when I try to call it from a button within another clip that is externaly loaded as well it will not work.

please help, my head hurts.

Load Bar Progress Using Bytes Loaded As Opposed To Frames Loaded
My problem now is that I would like to build a preloader with a load progress bar etc., that is based on bytes loaded rather than frames loaded.
This is because I have most of my content loading in movie clips on just 1 or 2 different frames within the movie, perhaps bad design but somewhat of a necessity due to nested clips. So, the load bar hangs on these one or two frames for a long time while preloading, whereas if it could be based on bytes loaded the load bar would have a nice gradual sliding effect. I've been playing around with it myself but have yet to get if functioning. Any help would be greatly appreciated.

Checking If Movie Loaded Into An Instance Has Fully Loaded B4 Playing
Hi,

I'm building a site that streams a series of small movies into some preset into instances on the _root timeline but are paused on an empty frame 1 until needed. So while the first movie is playing the second movie is already being loaded and is cued on frame 1 ready to play.

However, if the timeline tells the loaded movie (i.e. _root.content ) to play frame 2 before this movie has finished loading it will not play. This shouldn't happen because the movie loaded into _root.content should have loaded, but I need a failsafe.

Is there a way to run a routine once the _root timeline is finished to constantly check the status of the movie being loaded in _root.content and then play once it is loaded.

I've tried running this code in a routine:

if (_root.content._framesloaded >= _root.content._totalframes) {
_root.gotoAndPlay(2)
}

..but I'm not sure if it will work.

I really want to avoid a preloader (each movie is only about 10k big )

Any help would be greatly appreciated

Cheers

How To Make Sure Randomly Loaded Externals Swfs Are Fully Loaded [F8]
I am randomly loading external swfs into my main movie. I've got the random part working. However, I don't know how to make sure the random swf is fully loaded before jumping to a specific frame in my main movie.

I have a preloader inside each external swf, but I don't know how to make my main movie understand that the random swf is completely loaded before the main timeline should gotoandPlay("start").

What I Have So Far:

I have a blank MC (named "location") on the main stage, which I am using to hold the random swfs. On the first frame inside this MC, I have the following code:

choice = Math.round(Math.random()*2);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;

}

Loading the random swfs is working perfectly. But after the external swf is fully loaded, I want to move onto a frame labeled "start" on the main stage. I just don't know how to make sure the random swfs are completely loaded before I say gotoandPlay("start").

I've tried piecing together bits from so many tutorials, and I just don't know what I need to do to make it work with my current code.

Thanks so much!

Checking If A Movie Loaded With LoadMovie Loaded Succesfuly
Hi,

I have a movie called main. I want to load into a movieClip that sits in main an .swf.

To do it i use a

pictureClip.loadMovie("PR001.swf");

My question is: is there a way that the main movie can know that PR001.swf was not loaded?

Thanks fo the help.

Playing A Loaded Movie Clip (loaded In A Different Level)
I really don't understand the problem here, I'm loading a swf containing a movie clip with 2 frames with Stop(); on each. The file is loaded on _level5 so I tried this:

Code:
tellTarget (_level5.musicmc) {
gotoAndStop (2);
}


but instead of telling the musicmc movieclip to go to frame 2, it tells it to the main timeline to go to frame 2 and stop...What's the problem, when I use "Debug Movie", I can see the:
_level5
......._level5.musicmc (....... = spaces)

what's wrong, it seems to don't want to tell the MC to go to frame 2. I passed many hours on this simple d*mn thing and I really can't find out...


BTW, I'm using Flash 5

Setup Loaded Movies To Work Loaded Or Standalone
Hi Guys

How do I get a movie to work as a standalone movie - when i'm building it - and also work as a loaded movie in a parent movie that loadMovie or loadMovieNum this movie.

It just get annoying having to always change paths after I finish building my sub-movies because half the time I get it wrong - it might take me a couple of hours to get the move working as a standalone, but then i can take more hours to get it working as loaded.

any ideas??

thx

How To Reference A Loaded Swf, When Loaded Inside A Loader Component?
I am trying to control a movie (swf) that I loaded into the flash loader component. I have two files: preloader.swf and movie1.swf.

Preloader.swf has the Flash component from mx.controls.loader.
I have given this component the instance name "myLoader".
Once preloader.swf is called, it loads movie1.swf.
Movie1.swf has a button that controls the frame of a mc played within movie1.swf. When I test the movie1.swf without loading it into the preloader component, the button works as expected. However, when I load movie1.swf into the preloader.swf, it doesn't control the play of the mc.


#This is the AS I attached to button in movie1.swf when I am loading movie1.swf into the preloader.swf. Which DOESN't work.

_root.myLoader.mc1.gotoAndPlay(10);



#This is the AS I attached to button in movie1.swf when I am playing movie1.swf WITHOUT loading it into the preloader.swf. Which DOES work.

_root.mc1.gotoAndPlay(10);



I can't seem to figure out how to reference the loaded movie in the preloader.

Any help would be appreciated.

Thanks!

Problem With How Dynamic Loaded Text Is Displayed When Loaded...
Hello!
Ive been struggeling all day with this!
I found a code in this forum on how to scroll and load a .txt in a dynamic textfield in flash 2004 (thx alot timothye )
This all works, but the problem is that I cannot get it to display some text bold. the
HTML Code:
<b></b>
does not work... why?! I did the same thing in flash MX and here it works just fine!
any help will be most welcome!
I'll post the flash for u to have a look at!

thx!

Function Not Working After Clip Is Loaded, Unloaded And Then Loaded Again
I have a Movie Clip in my Library that I'm loading on to my stage using the attachMovie command. Within that movie clip, I have actions set on the first frame.

From the root level of my movie, I call "profile-section" clip by pressing a button in my nav and it loads properly and works. The functions and handlers all work correctly within it. Then when I press another button from the root level, I have code to removeMovieClip. That works and removes the "profile-section" clip.

My problem is when i click on the button to re-load the "profile-section", the function doesn't work properly anymore. I'm attaching the function for you guys to look over. Any help would be greatly appreciated. Thanks.


//
// Variables
//

var speed = 3;

//
// Sub-Section Rollover Red Bar Function
//

function subSectionRollOverLoop(movieClip, speed, distance, callBack):Void {
if (speed > 0 && movieClip._width <= distance) {
movieClip._width += speed;
} else if (speed < 0 && movieClip._width >= distance) {
movieClip._width += speed;
} else if (movieClip.__interval) {
clearInterval(movieClip.__interval);
movieClip.__interval = 0;
if (callBack) {
callBack(movieClip, speed, distance);
}
}
}

function subSectionRollOverStart(movieClip, speed, distance, callBack):Void {
if (movieClip.__interval) {
clearInterval(movieClip.__interval);
movieClip.__interval = 0;
}
movieClip.__interval = setInterval(subSectionRollOverLoop, 10, movieClip, speed, distance, callBack);
}


joan_btn.onRollOver = joan_btn.onDragOver = function ():Void {
subSectionRollOverStart(joanRoll_mc, 30, 140);
};

Urgent Loaded Movie Controlling Other Loaded Movi
I need this one done today!


I have two holder movie clips in my main .swf. One is selectloader, the other is normloader.

So selectloader.loadMov..... that works

In the select I load a selection with three boxes, the user chooses one.

When the user clicks one of the boxes I do
_root.normloader.loadMovie...
and it doesn't work!

So I created a new frame on the holder .swf for each of the three buttons so all the selectino has to to is go to another frame.
That works, but I also want each of the boxes to direct to a certain frame in normloader

so the problem comes back again

I can't get one loaded movie to control another loaded movie

I'm assuming it has to do with levels, and I need to do more then just _root.normloader.gotoAndPlay(3);

what do I have to do?

Play A Frame In A Loaded Movie From Another Loaded Swf
this is driving me crazzzzy []
i have the main movie which is 1 frame (containing the menu navagation for the site), under the 1 frame i have an MC (called scoot) that is 8 frames long and each frame has a stop action. I have set the site up to use browser back/forward button <script>
varPass=location.search.substring(1,location.searc h.length); //grab variable from cgiPass
if (parent.main.num == 1)
{parent.main.num = 2;}
else
{parent.main.num = 1;}
parent.main.controlFlash(varPass);//call controlFlash funct in main.html
document.write(varPass); //for testing purposes
</script>

the above script is a sample from the back/forward function/procedure.

Now... I labled the 5th frame of scoot as "map" and under the 5th frame, when it is played, is a button to open another swf, i'll call swf2. In swf2 is a button that i'm trying to action to go back and play map of scoot. But what ever i try nothing seems to work. Swf2 is loaded into level3 of the main movie and the loading action is in the first frame (and only frame) of the main movie. Someone please help me..... ???? Thanks a gekadrazillion in advanced !

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