Some Help With Images Loaded Into Movie Clips.
I have a series of images that are loaded from an xml file into some movieclips, which are inside other movieclips on the stage. A quick diagram to help explain:
Main Movie Clip ----> Inner Movie Clip ---> Image
So I have several of these movie clips on the stage and I would link to find out which image is in the movie clip that the user currently has their mouse on. I feel like I'm close to getting it but it never works. So any help would be much appreciated! If I haven't given enough info please let me know and I'll fill in the holes. Thanks in advance!
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 07-27-2006, 12:16 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Aligning Dynamically Loaded Images Within Empty Movie Clips
Hey Guys,
this might be a stupid question, but if I create an empty movie clip and dynamically load a jpg into it, is there a way to align it to the right? At the moment the image's top left corner will be put at the top left corner of the emptymovieclip. I want to put the top right corner of the jpg and align it right inside the movie clip. Is that possible?
Matt
Dynamically Loaded Clips With External Images & Sp
Hi fellow flash developers
I'm trying to build a little function that loads some variables from an online PHP file, where I get
the number of existing elements, the correspoding thumbnails and the associated text for each.
This elements are to be placed horizontally 120pix right after each other. For this,
I chose to use a "for in" loop, that executes the number of times equivalent to the number
of elements retrieved from the variable in the PHP file the SWF connects to.
Unfortunately the PHP file still doesn't have the paths to the thumbnails set in any
variable, so for purposes of testing I am loading these thumbnails from the hard
disk. They are in the SWF's folder.
The connection with the PHP is working fine, I am able to get the number of elements in
it. The address if you want to check the variables, is
http://www.imaginando.net/resin/traction.php .
So, in a more synthetic way, how do I get these images to appear on each corresponding clip,
and how do I make them have a specific .onRelease function?
Going through the script helps to understand
ActionScript Code:
//declare the thumbnails's pictures array
releasesArray = new Array("RSI001small.gif", "RSI002small.gif", "RSI003small.gif", "RSI004small.gif");
//load the number of elements from the PHP
loadReleases = new LoadVars();
loadReleases.load("http://www.imaginando.net/resin/traction.php");
loadReleases.onLoad = function() {
//the number of elements is the variable ntractions
_global.numberOfElements = this.ntractions;
trace(numberOfElements); //this shows 10 in the output panel, there are 10 elements
//let this loop 10 times then.
for (i=0; i<numberOfElements; i++) {
//the next line of code is my attempt to set the "currentTractionImage"
//to "RSI001small.gif", doesn't seem to work
currentTractionImage = releasesArray[i];
trace(currentTractionImage);
//this unfortunately outputs underfined
//get the button instance from the library (linkage id "traction_element")
//containing an MC with the instance name "holder_mc" where I would like to
// place an image from the SWFs folder, more precisely the actual [i]
//element of releasesArray:
var currentTractionItem = _root.attachMovie('traction_element', 'traction_element'+i, i);
//place the newly created item 120pix to the right
currentTractionItem._x += i*120;
//here I try to dinamically load the external GIF but the requested
//releasesArray's value is not retrieved
currentTractionItem.holder_mc.loadMovie(releasesAr ray[i]);
//the following command tests the button's activity, and works
//> //how do I apply a specific action for each?
currentTractionItem.onRelease = function() {
trace("button pressed");
}
//yet another yellow attempt to reach releasesArray's content
var imagetoLoad = ["RSI00"+i+"small.gif"];
trace("imageToLoad = " + imageToLoad); //outputs undefined
}
}
stop();
so.. that's my frustrated attempt to do it, and what fails is listed in the code's comments.
If you see any mistake or any suggestion to make, I thank you in advance!
Dynamically Loaded Clips With External Images & Specific Functions
Hi fellow flash developers
I'm trying to build a little function that loads some variables from an online PHP file, where I get the number of existing elements, the correspoding thumbnails and the associated text for each. This elements are to be placed horizontally 120pix right after each other. For this, I chose to use a "for in" loop, that executes the number of times equivalent to the number of elements retrieved from the variable in the PHP file the SWF connects to.
Unfortunately the PHP file still doesn't have the paths to the thumbnails set in any variable, so for purposes of testing I am loading these thumbnails from the hard disk. They are in the SWF's folder.
The connection with the PHP is working fine, I am able to get the number of elements in it. The address if you want to check the variables, is http://www.imaginando.net/resin/traction.php .
So, in a more synthetic way, how do I get these images to appear on each corresponding clip I create, and how do I make them have a specific .onRelease function?
Going through the script helps to understand
Quote:
//declare the thumbnails's pictures array
releasesArray = new Array("RSI001small.gif", "RSI002small.gif", "RSI003small.gif", "RSI004small.gif");
//load the number of elements from the PHP
loadReleases = new LoadVars();
loadReleases.load("http://www.imaginando.net/resin/traction.php");
loadReleases.onLoad = function() {
//the number of elements is the variable ntractions
_global.numberOfElements = this.ntractions;
trace(numberOfElements); //this shows 10 in the output panel, there are 10 elements
//let this loop 10 times then.
for (i=0; i<numberOfElements; i++) {
//the next line of code is my attempt to set the "currentTractionImage" to "RSI001small.gif", doesn't seem to work
currentTractionImage = releasesArray[i];
trace(currentTractionImage); //this unfortunately outputs underfined
//get the button instance from the library (linkage id "traction_element", containing an MC with the instance name "holder_mc" where I would like to place an image from the SWFs folder, more precisely the actual [i] element of releasesArray:
var currentTractionItem = _root.attachMovie('traction_element', 'traction_element'+i, i);
//place the newly created item 120pix to the right
currentTractionItem._x += i*120;
//here I try to dinamically load the external GIF but the requested releasesArray's value is not retrieved
currentTractionItem.holder_mc.loadMovie(releasesAr ray[i]);
//the following command tests the button's activity, and works
//> //how do I apply a specific action for each?
currentTractionItem.onRelease = function() {
trace("button pressed");
}
//yet another yellow attempt to reach releasesArray's content
var imagetoLoad = ["RSI00"+i+"small.gif"];
trace("imageToLoad = " + imageToLoad); //outputs undefined
}
}
stop();
so.. that's my frustrated attempt to do it, and what fails is listed in the code's comments. If you see any mistake or any suggestion to make, I thank you in advance!
IMAGES..and Movie Clips?
I have a site I am working on...I was trying to make a movie clip...I went to Insert>>>>>New Symbol>>>>MovieClip..
I started drawing my movie scene stuff...and when I went to import a image...I couldnt..the option was greyed out..WHY?..Can you NOT use .jpg's/.gif's inside of a movie clip??? What the deal?..Am I doing something wrong here? (which I'm sure I am..LOL..) Thanks for the help all.
-whispers-
Targeted Movie Clips Don’t Work Once Loaded Into A Container Movie.
Here’s my problem…
I have several external SWF (child) movies that are to be loaded upon demand into another SWF container (parent) movie file. Pretty straight forward.
Each of the child movies has MCs communicating with other MCs within the same child movie.
For instance the timeline of one MC will have a frame action, which targets another MC instance to play(). Again, Pretty straightforward stuff.
These files work beautifully when viewed independently. The problem is when they are loaded into the parent container movie the target MC functionality no longer works.
I believe it’s because once the child movie is loaded into the parent movie the absolute path of the targeted MC has changed and what was once the “_root” in the child movie is no longer the actual root?
I have tried both methods in the child movie:
//method without using ‘with’
_root.ContentWindow.play();
And using the “with” action like so:
//method using ‘with’
with (_root.ContentWindow) {
play();
}
It would seem that in theory once the Child SWF file is loaded into the Parent SWF file the targeted path would have to have another level in it – cuz now the MC “ContentWindow” is no longer one level down from the “_root” but two levels?
For example: _root.LoadedChildMovie.ContentWindow.play()
Can anybody please help me with this? I’m afraid I have a ton of work that’s relying on this functionality and my deadline is dangerously drawing near!
Trouble With Images In Movie Clips
ok.. im working on a site for a tattoo parlor.. i want to have a thumbnail-type section page, but rather than clicking on the images to view a lager version, i want the images to fade in on a designated section of the page as a rollover, just a larger version of the picture. how would i use the same image in the library in a differnt size without having the small thumbnail changing in size as well? or would i have to duplicate the image; would i need two of every image in my library.. one small one large? any help will be greatly appreciated. thanks. -j
Loading Images Into Movie Clips
How do I load an image located in a folder into a Movie Clip.
I have tried with picture1.loadMovie("images/pic1.jpg") but this doesn't seem to work.
Inserting Images Into Movie Clips
How do I load an image located in a folder into a Movie Clip.
I have tried with picture1.loadMovie("images/pic1.jpg") but this doesn't seem to work. I have also tried loadMovie("images/pic1.jpg","picture1")
Wide Movie Clips And Images
I have about 8 images lined up side by side in a movie clip, which makes it about 4400 px wide, but when i export it, and pan the mc to the left or right, the images on the extreme ends of the movie clip upon publishing appear as the first vertical columns of pixels repeated over the length of the image. Does anyone know why this is, or how I might be able to fix the problem?
dave
Transitions Between Images/movie Clips
I'm trying to use masks to transition from one image to another. When someone clicks on a button, I want the transition to take place on top of the old image.
An example of exactly what I want to do:
http://www.royalhawaiianweddings.com/mauiweddings.html
When a button is clicked transition occurs.
My question:
Are seperate files loading into a blank movie clip (target) or is it loading onto levels.....or is there a different way to transition that I don't know about (I'm definetly not an expert)?
I'd appreciate any insight. Thanks.
Make Xml Images Movie Clips
I have created a 3D carousel. The tutorial I used though takes the images in the xml and makes them bitmapdata.
Code:
public function CarouselItem(image:DisplayObject):void {
_data = new BitmapData(image.width, image.height, true, 0x00FFFFFF);
_data.draw(image);
var bmp:Bitmap = new Bitmap(_data, "auto", true);
bmp.x -= bmp.width*.5 ;
bmp.y -= bmp.height*.5;
updateDisplay();
addChild(bmp);
I need them to load into an empty movie clip so I can make them interactive and also so I will be able to load swfs as well as jpgs.
I have tried everything I can think of from making a new movie clip to a new sprite. I have also attached my fla and classes and xml if the will help understand my problem better.
How To Line Up Images In Different Movie Clips?
Hi there,
I have a movieclip, does some animations etc.
Is it possible to view that movieclip at the last frame on the stage, so that i can then line up items in another movieclip with it?
Driving me nuts trying to get the pixels perfectly lined from two different clips
Limit To Images Or Movie Clips?
i recently created a project (Flash MX) that had 24 jpg images that were loaded into movie clips so that i could fade them in and out, but anything after the 11th movie clip would create distorted fade ins. has anyone faced such a problem?
Loaded Movie Clips Communication With _root Movie
I am trying to produce an app for the ppc ipaq. I want to load the various movies into the root movie. this works ok.
I cannot get a button in a loaded movie to fire a function from the main holder movies _root . This is my function in the holder movie _rot I want to fire from the button in the loaded movie.
function getrules() {
removeMovieClip("splash");
loadMovieNum("rules.swf", 1);
}
Thanks for any help.
Pre-loaded Movie Clips
I want my viewers to see a movie clip after they've clicked the button, but I want the movie to have already loaded so they don't have to wait after clicking.
How can I have the movie clip already loaded before they press the button?
Thanks
Loading Images Into Empty Movie Clips
Can anyone tell me how to load an image called "frame.png" into an empty movie clip on the stage called "frame"?
I tried doing this on the first frame of the main timeline (there is only one frame in the movie so far)
loadMovie("images/frame.png", "frame");
This doesn't work. What am I doing wrong?
Thanks
Movie Clips Vs Graphic With Nested Images?
Can someone (or someones) tell me what is better in certain situations and the advatages and disadvantages of using a Movie Clip to illustrate a something like a walk cycle or eye blink vs the same thing with a Graphic with nested images?
I'm not really familiar with Graphics with nested images, so can you give me a little bit of quick info on how it works or a tutorial that would help me?
Thanks
Dynamically Creating Images (movie Clips)
I'm kind of new to flash, but I've been following a few tutorials on AS3 and I think I know the language pretty well (just working on memorizing the functions and constants.. but that will come with time).
I'm wanting to create a dynamic image gallery, where image URLs will be loaded from an XML file and displayed on the flash scene.
My main question is, inside of my XML loop, how can I create a resized image in the scene? Since the number of images will vary, I can't create image1_mc, image2_mc etc. movie clips. They need to be created dynamically.
And how can I make them show inside of a scrollable box?
Big thanks in advance. You don't have to create anything for me, I believe in doing things myself. Unless of course you're just feeling really generous. But just some tips and/or links to tutorials will be fine!
Wes
Loading Images To Duplicated Movie Clips
Hi ppl,
I have a problem in loading pictures to duplicated movie clips. I have a dynamic sliding menu and I wanna load images to submenus. However I havent succeeded yet.
Here is the code:
setProperty("Rub", _visible, false);
setProperty("subrub", _visible, 0);
bas._visible=false
n = 0;
while (n<=TotalRubs) {
n = n+1;
set("PosY"+n, getProperty(n, _y)+RubHeight- 1.5);
if (TargetRub==n and eval("Total_Subrubs_Rub" add n)>0) {
z = 0;
while (z<eval("Total_Subrubs_Rub" add n)) {
z = z+1;
duplicateMovieClip("subrub", n+"_"+z, Number((n*10))+Number(z));
this[n+"_"+z].img.loadMovie("urun2.jpg");
set(n+"_"+z+":subtxt", eval("L" add n add z));
if (Number(z) == 1) {
setProperty(n+"_"+z, _y, Number(getProperty(n, _y))+RubHeight- 1.5);
} else {
setProperty(n+"_"+z, _y, getProperty(n add "_" add (z-1), _y)+SubrubHeight);
}
}
max = SubrubHeight*eval("Total_Subrubs_Rub"+TargetRub);
//set("PosY" add TargetRub, Number(getProperty(TargetRub, _y))+Number(getProperty(TargetRub, _height)));
set("Distance" add n, eval("Distance" add n)+5);
if (eval("Distance" add n)>=max) {
set("Distance" add n, max);
}
//setProperty(Number(TargetRub)+1, _y, eval("PosY" add TargetRub)+eval("Distance" add TargetRub));
} else {
z = 10;
while (z>0) {
z = Number(z)-1;
removeMovieClip(n+"_"+z);
}
set("Distance"+n, eval("Distance"+n)-10);
if (eval("Distance"+n)<=0) {
set("Distance"+n, 0);
}
}
setProperty(n+1, _y, eval("PosY"+n)+eval("Distance"+n));
}
I ll be very happy if somebody help me on this problem
thanks in advance...
Load External Images In 2 Movie Clips
Hi,
What I'm trying to achieve is this:
I have 4 images which I want to load in to 2 different movieclips.
But, I would like the next image to fade over the previous image - without any "gaps" between each image.
So would I use an if/else statement: ie if mc1 does not have an image load the external image in to that, else load it in to mc2?
Please see attached. That's as far as my knowledge takes me at the moment.
Thanks for any feedback in advance.
Jo
Problems With Copying Images Between Movie Clips
What I am trying to do is:
1) load all the images off stage
2) copy the first image into a main image movie clip
3) replace image in main movie clip by image corresponding to user selection
First, the array I store the images in and the movie clip I want to copy them to:
Code:
var imageMovieClipArray:Array = new Array();
var mainImage:MovieClip = this.createEmptyMovieClip("mainImage", this.getNextHighestDepth());
I get the image names via an XML file, loop through the file and the insert them into the array..
Code:
var imageMovieClip:MovieClip = this.createEmptyMovieClip("imageMovieClip" + count, this.getNextHighestDepth());
imageMovieClip._x = -1000;
imageMovieClip._y = -1000;
var imageMovieClipLoader:MovieClipLoader = new MovieClipLoader();
imageMovieClipLoader.loadClip(pathToImage, imageMovieClip);
imageMovieClipArray.push(imageMovieClip);
loading the first image
Code:
duplicateMovieClipImage(imageMovieClipArray[0], mainImage);
Function to copy the image to the main image movie clip
Code:
function duplicateMovieClipImage(from, target){
// position the mainImage movie clip acording to image size
/* CURRENTLY NOT WORKING *
mainImage._x = 525 - (from._width / 2);
mainImage._y = 55 + (480-55)/2 - (from._height / 2);
mainImage._width = from._width;
mainImage._height = from._height;
*/
// create new bitmap data instance and copy from image to target
var visuals:BitmapData = new BitmapData(from._width, from._height);
visuals.draw(from);
target.attachBitmap(visuals, 1);
tweenImageIn = new Tween(target, "_alpha", Strong.easeOut, 0, 100, 50, false);
Right now, nothing is showing up in the mainImage MovieClip - but I don't know if it is because I am using BitMapData incorrectly or if I am not storing / referencing the MovieClips correctly in imageMovieClipArray.
Any ideas?
P.S. I found 'duplicateMovieClipImage' here: http://www.senocular.com/flash/source.php?id=0.174
Nested Images In Graphics Or Movie Clips?
Can someone (or someones) tell me what is better in certain situations and the advatages and disadvantages of using a Movie Clip to illustrate a something like a walk cycle or eye blink vs the same thing with a Graphic with nested images?
I'm not really familiar with Graphics with nested images, so can you give me a little bit of quick info on how it works or a tutorial that would help me?
Thanks
Loading Images To Duplicated Movie Clips
Hi ppl,
I have a problem in loading pictures to duplicated movie clips. I have a dynamic sliding menu and I wanna load images to submenus. However I havent succeeded yet.
Here is the code:
setProperty("Rub", _visible, false);
setProperty("subrub", _visible, 0);
bas._visible=false
n = 0;
while (n<=TotalRubs) {
n = n+1;
set("PosY"+n, getProperty(n, _y)+RubHeight- 1.5);
if (TargetRub==n and eval("Total_Subrubs_Rub" add n)>0) {
z = 0;
while (z<eval("Total_Subrubs_Rub" add n)) {
z = z+1;
duplicateMovieClip("subrub", n+"_"+z, Number((n*10))+Number(z));
this[n+"_"+z].img.loadMovie("urun2.jpg");
set(n+"_"+z+":subtxt", eval("L" add n add z));
if (Number(z) == 1) {
setProperty(n+"_"+z, _y, Number(getProperty(n, _y))+RubHeight- 1.5);
} else {
setProperty(n+"_"+z, _y, getProperty(n add "_" add (z-1), _y)+SubrubHeight);
}
}
max = SubrubHeight*eval("Total_Subrubs_Rub"+TargetRub);
//set("PosY" add TargetRub, Number(getProperty(TargetRub, _y))+Number(getProperty(TargetRub, _height)));
set("Distance" add n, eval("Distance" add n)+5);
if (eval("Distance" add n)>=max) {
set("Distance" add n, max);
}
//setProperty(Number(TargetRub)+1, _y, eval("PosY" add TargetRub)+eval("Distance" add TargetRub));
} else {
z = 10;
while (z>0) {
z = Number(z)-1;
removeMovieClip(n+"_"+z);
}
set("Distance"+n, eval("Distance"+n)-10);
if (eval("Distance"+n)<=0) {
set("Distance"+n, 0);
}
}
setProperty(n+1, _y, eval("PosY"+n)+eval("Distance"+n));
}
I ll be very happy if somebody help me on this problem
thanks in advance...
How Do I Control Swf's Loaded Into Movie Clips?
Hi,
Can anyone help me with this problem?
I have written some actionscript to create a number of movie clips and then load .swf’s into them. The .swf’s are small videos converted using Sorenson Squeeze.
The function I have created looks at the number of parameters passed to it and then loops that many times, so creating and filling the correct number of movie clips. The code is as follows :-
function loader() {
// number of times to loop determined by how many arguments are passed to the function
for (i=0; i<Arguments.length; i++) {
// duplicate the empty holder movie clip and call it holder0, holder1, etc. and position it at depth i (stacking them on top of each other within the same level)
duplicateMovieClip("holder", "holder"+i, i);
// set the destination for the next external movie to be loaded to
dest = "holder"+i;
// load movie number "i" into dest
loadMovie(Arguments[i], dest);
}
}
// run the loader function
loader("clip1_CD.swf", "clip2_CD.swf", "clip3_CD.swf", "clip4_CD.swf", "clip5_CD.swf", "clip6_CD.swf");
To my surprise this all works resulting in 6 movie clips stacked on top of each other and each containing a small video.
However, my problem is that each of the movie clips is playing and I would like for them to be stopped. Furthermore I would like to then be able to control the playback of each of them. I thought it would be a simple matter of commands such as :-
Holder6.gotoAndStop(1)
etc. Unfortunately I cannot work out how to control the movie clips after they have been created – they simple continue to loop.
Does anyone know how I can control them? Is it that I am not targeting them properly? Please help if you can and explain it to me like I am stupid because this is all very new to me.
Thanks,
Mac.
DYNAMIC Loaded .jpg Used In Movie Clips
Is this possible.
I would like to create tweens as templates and use code to dynamically load .jpgs into the tween from a particular directory. This way all I have to do is swap the images out of the directory and not have to change the .fla each time.
Can someone direct me to where I study this.
Thanks,
Andrea
Movie Clips Loaded Randomly
Hi
My query relates to swopping one movie clip for another in a random fashion. I have a movie clip on my stage called "location" and when the movie loads I want the "location" movie to be replaced by any one of 3 slightly different movie clips called "canvas0", "canvas1", "canvas3" .
I have attached the following code to the "location" movie clip:
onClipEvent (load) {
choice = Math.round(Math.random()*3);
switch (choice) {
case 0 :
location.loadMovie("canvas0");
break;
case 1 :
location.loadMovie("canvas1");
break;
case 2 :
location.loadMovie("canvas2");
break;
}
}
I have the "canvas" movie clips in the library and their linkage is set to "Export with Actionscript". I am using Flash MX.
Does anyone have any idea on why the above doesn't work?
Thanks.
Newtoo
[CS3,AS2] Caching Loaded Movie Clips?
Hi guys,
I'm splitting my fla into a bunch of assets to be loaded in, and some of these movie clips will be loaded in tons of times, as I will have many copies of each of them. is there any way to cache the clip, so I don't actually have to keep loading the same clip over and over? or does flash cache it automatically?
Controlling Movie Clips In A Loaded SWF
I've been away from Flash for awhile.
I have a "master" swf that loads independent swf's inside of it. In the "master" swf I have controls (Stop, Play, FF, RR). These controls work for the main timeline of the loaded swf. The only problem I am having is when I press "STOP", the main timeline of the loaded swf stops, but the movie clips in the loaded swf continue to run.
Does anyone know how to stop all movie clips in a loaded swf?
Any help would be greatly appreciated.
-John
Controlling Loaded Movie Clips
I'm a bit stuck on this one:
I'm loading external movie clips which have nested movie clips inside them. I'd like to know if it's possible to send instructions to those nested movie clips.
i.e. _mainMovie.holder_mc.loaded_mc.gotoAnd Play(3);
This doesn't work and every variation I've tried doesn't seem to work, even though you can trace() these nested movie clip instances, they don't seem to respond to ActionScript.
Any help?
Can't Loaded Movie Clips Be Masks?
I just loaded another swf into a movie clip and then made it mask another movie clip on my main timeline, but for some reason i can see the loaded clip but it is not a mask, is it even possible to do this?
also the content in the other clip was generateed in AS, is that the problem?
thanks and sorry for beeing such a n00b
MX 2004 - Embedding Images/movie Clips In Textfields
Does anybody know if the new version of flash will allow use of the img HTML tag in html textfields? I.e let you put an image or movieclip inside the textfield.
If you think this is an odd request there is a good reason for it - emoticons. I read recently a rumour that img would be supported. At the moment the only way to embed emoticons in line is via very very complicated scripting or creating your own font, the latter though easier is restricting when you consider the graphical capabilities of flash outside of textfields.
cheers
Barry
Flash Squishing Images Called Into Movie Clips
Hello,
I have a flash movie and am using action script to call external images into movie clips but for some reason flash is squishing my images vertically. I have used this feature a hundred times over and never seen this problem before. I checked the size of my images vs the size of the clip i am calling them into and they are the same size.
has anyone seen this happen before and or know how to fix it?
let me know.
AddChild Moves Textbox Above Other Images/movie Clips
I have a dynamic text box inside a movie clip. The movie clip resides below a bunch of other images and movie clips on the stage, so that if the other movie clips are moved across the screen, they cover up the text box.
The problem I have is that I added a link dynamically, and now the textbox appears on top of everything else. Is there a way I can make this sit behind everything else again?
My code:
public function showContent():void {
this.gotoAndStop( "content" );
// hide various screens
hideClip( this.startmenu );
hideClip( this.downloadscreens );
showClip( this.bodytext );
setClipLanguage( this.bodytext );
this.bodytext.introCopy.htmlText += "Disc 1 is totally baller. Some other text. Etc, etc, etc. Please review the the <a href='event:Link Clicked'>usage guidelines (PDF) </a> before beginning work.";
addChild(this.bodytext.introCopy);
this.bodytext.introCopy.addEventListener(TextEvent .LINK, linkEvent);
this.bodytext.language.addEventListener( MouseEvent.CLICK, this.selectLanguage );
}
function linkEvent(event:TextEvent):void {
trace("HOORAY! I'm a PIRATE");
// Link Clicked
}
I tried to add this code:
Stage.setChildIndex(this.bodytext.introCopy, 0);
but I got an error, Stage is not a variable
Loading Random Images Into Movie Clips Using Attachmovie?
Ok so I'm totally at a loss here...
I have four empty movie clips that I want two types of pictures to load into randomly.
(example)
food1_mc place1_mc food2_mc place2_mc
now I want to randomly load images into those empty clips (pictures of food and places, imagine that). I can load in PNGs randomly but I ALSO want to have those images animate into frame each time the user visits the home section. So if I load PNGs it doesn't animate since the animation frames are passed before the PNG loads in. I also tried to throw a loader on the front but that only loads the flash file (of course) and not the PNGs. So my idea is to import all the images (there are 12 of each kind) into the library into their own movie clips (naming them food1, food2 etc etc) and then randomly AttachMovie to those empty movieclips... And then I will throw a loader on the front of that whole thing.
So I have the basic idea correct, I think, but I can't figure the code out.... Is this the most efficient and sane (at least on my end) way to do what I want?
halp?
big thankee sais in advance.
Needs Help Adding Images To Movie Clips And Referencing The Frames
i havent started with a blank, script made movie clip.
I want to add frames from action script 2, and be able to reference/show the induividual frames for a video game and not a movie. I dont realy need animation, i just need certain frames to show, that i want to load load(from a non script made movie clip with one loaded frame(bitmap data).
Dynamically Adding JPG Images As Buttons Or Movie Clips
Using an XML file, I am pulling a series of JPG images from my hard drive onto the stage. Each of these images will need to have different mouse events placed on them that will take the user to another part of the movie, or perhaps to a different scene. The attached code successfully pulls the images to the stage -- as JPG images -- and spaces them. What i need to do is make each of them a button or movie clip, each with a specific action (information which can be gleaned from the XML).
Eventually, I'll need to show images from this XML file based on user-selected criteria via some check boxes. And I'll also need to build some kind of "show next 9 images" and "show previous 9 images" functionality.
So I guess my immediate question is the first one: how the heck to you get these images on the stage and have them clickable??
Attach Code
import flash.display.MovieClip;
import flash.display.Loader;
import flash.events.*;
import flash.net.URLRequest;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.Event;
import flash.display.*;
//Load the XML data
var XMLData:XML = new XML();
var XMLPath:URLRequest = new URLRequest("models.xml");
var XMLLoader:URLLoader = new URLLoader(XMLPath);
var i:int;
var lines:int = 3;
var columns:int = 3;
var xpos:int = 193.4;
var ypos:int = 17.0;
XMLLoader.addEventListener(Event.COMPLETE,loadXML);
//load up the XML data
function loadXML(e:Event) {
XMLData = new XML(e.target.data);
for each (var item in XMLData.item) {
i = i+1;
var pic:String = "c:/temp/demo/photos_th/"+item.pic;
var request:URLRequest = new URLRequest(pic);
var loader:Loader = new Loader();
loader.load(request);
loader.x = xpos;
loader.y = ypos;
if ((i == 4) || (i == 7)) {
loader.x = 193.4;
xpos = 193.4;
}
if ((i == 4) || (i == 5) || (i == 6)) {
loader.y = 126;
}
if ((i == 7) || (i == 8) || (i == 9)) {
loader.y = 235;
}
if (i <= 9) {
//this.addChild(loader);
addChild(loader);
}
xpos = xpos+161;
}
}
stop();
Laoding External Images Into Movie Clips In Different FRAMES
I generally don't mess with the timeline, but I need to for this project. In a nutshell: user can customize a product reference sheet with her choice of crossection, footprint, etc. All those choices exist as external swfs. In order to be legible, the reference sheet must be two pages.
I know how to print multiple frames with Flash. But what I cannot yet achieve is loading external swfs into movieclips on different frames, and then print that. Here's my code from a test fla:
ActionScript Code:
//add1, add2 are buttons on stage.//printArea is a movie clip on stage. holder1 and holder2 are movie clip instances within printArea movie clip.////these two event handlers go to a frame in printArea and load in the images. They work fine.add1.onRelease=function(){ printArea.gotoAndStop(1); printArea.holder1.loadMovie("Salakk.JPG");}add2.onRelease=function(){ printArea.gotoAndStop(2); printArea.holder2.loadMovie("johnStewart_cn.jpg");}////this is the function that sends the swf to the printer.printBtn.onRelease=function(){ glPrint=new PrintJob(); glPrint.start(); glPrint.addPage(printArea, null, null, 1); glPrint.addPage(printArea, null, null, 2);}
Now, this code will print both frames as separate pages, but the loaded image in printArea.holder2 does not print! Anybody have any ideas? thanks in advance!
Targeting _level0 In Loaded Movie Clips
I am loading some variables into _level0 of a movie clip that is loaded into a symbol. Can I target _level0 of this loaded movie clip, i.e. _root.content.sights._level0, to access these loaded variables' values?
Making Sure Load Movie Clips Are Loaded
I have a flash movie where I load several external movie clips, each clip goes in an empty movie instance in a different frame label. The problem is that all the clips don't load when I first view the movie, but load OK after I refresh the browser. How can I make sure all loadmovie clips get loaded?
Hand Cursor On Many Loaded Movie Clips
I'm trying to use externally loaded movie clips as buttons. (Somebody asked, and I thought it was exciting finding out how to...)
But: I don't get a hand cursor when mousing over the buttons. I only succeeded in creating a hand cursor over the first loaded movie clip, and it doesn't matter which movie clip I specify in the file to be the one with the hand cursor: this is the one all the time.
Have the rightmost movie clip as a listener.
I enclose my movie and the two external swf's in a zip-file, if anybody would be so kind
(I couldn't even find out how to get the useHandCursor right, so I might be calling it incorrectly...)
Controlling Movies Loaded Into Movie Clips
i am loading movies into movie clips and do not want them to play straight away. so i've put stop() actions in the first frames of each move i'm loading in. how do i target these movies with play() once they are loaded into the movie clips?
thanks
||| O ^ | + O ¬
*.swf Files Loaded Into Movie Clips, Not Working, Why?
i have a main timeline with working navigation.
i loaded another swf file into a movieclip, that swf file has navigation aswell...
the problem?
when i try to navigate through the loaded swf it either doesn't play properly or the main timeline disappears, when im not even loadin levels!. im using only targets.
what is wrong?
need more info? let me know.
Thank you.
Filosofer
How To Control Externally Loaded Movie Clips?
Is it possible for a button situated in "blankOne.swf" to control the actions of a movie clip which has been loaded into "blankOne.swf" via loadMovie();???
Further explanation:
I have created a sort of template.swf which only includes site navigation buttons and empty space for the external movies to load into. From these navigation buttons I am trying to trigger events in movie clips which have been loaded using loadMovie(); So far, no matter how I script the path I can't get it to work. Is what I'm trying to do even possible??
Thanks in advance to anyone who can help
Finding The Address Of Clips In A Loaded Movie
hey there... I am having some troubles with finding the address of some clips in a loaded movie.
Basically I am loading a number of movies into a movie clip on my main timeline, then I want to be able to access the clips at runtime, to play them at different stages of the presentation...
So,
I have my main swf, which at runtime loads a number of secondary swfs (referenced by an xml doc) and in each of those secondary swfs are 3-5 movie clips which I want to be able to manipulate...
How do I do this?
anyone?
Checking For JPG Files Loaded As Movie Clips ?
Hi,
I need to check if a JPG file is loaded into a blank movie clip. I am using the loadmovie comment:
loadMovie("media/jazz/b9/image"+pic+".jpg", "_root.mc_main.mc_jazz.SubNav.photo.square");
It sounds petty easy, you will think... Let me explain.
I need to create an If() statement that check is a JPG file is fully loaded
am I on the right track using this?
if ("_root.mc_main.mc_jazz.SubNav.photo.square.image" +pic+".jpg"_framesloaded >=_totalframes) {
trace("waiting for the text to load photo.");
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 1, _alpha, 0);
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 2, _alpha, 0);
} else {
trace("finished loading photo.");
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 1, _alpha, 100);
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 2, _alpha, 100);
}
here a link to the project I am working on:
http://www.nelsonhstudios.com/Clients/EDP/
From there: go in Jazz and then click on musicians.
Thanks for the help.
Checking For JPG Files That Are Loaded As Movie Clips?
Hi,
I need to check if a JPG file is loaded into a blank movie clip. I am using the loadmovie comment:
loadMovie("media/jazz/b9/image"+pic+".jpg", "_root.mc_main.mc_jazz.SubNav.photo.square");
It sounds petty easy, you will think... Let me explain.
I need to create an If() statement that check is a JPG file is fully loaded
am I on the right track using this?
if ("_root.mc_main.mc_jazz.SubNav.photo.square.image" +pic+".jpg"_framesloaded >=_totalframes) {
trace("waiting for the text to load photo.");
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 1, _alpha, 0);
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 2, _alpha, 0);
} else {
trace("finished loading photo.");
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 1, _alpha, 100);
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 2, _alpha, 100);
}
here a link to the project I am working on:
http://www.nelsonhstudios.com/Clients/EDP/
From there: go in Jazz and then click on musicians.
Thanks for the help.
Checking For JPG Files That Are Loaded As Movie Clips?
Hi,
I need to check if a JPG file is loaded into a blank movie clip. I am using the loadmovie comment:
loadMovie("media/jazz/b9/image"+pic+".jpg", "_root.mc_main.mc_jazz.SubNav.photo.square");
It sounds petty easy, you will think... Let me explain.
I need to create an If() statement that check is a JPG file is fully loaded
am I on the right track using this?
if ("_root.mc_main.mc_jazz.SubNav.photo.square.image" +pic+".jpg"_framesloaded >=_totalframes) {
trace("waiting for the text to load photo.");
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 1, _alpha, 0);
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 2, _alpha, 0);
} else {
trace("finished loading photo.");
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 1, _alpha, 100);
setProperty(_root.mc_main.mc_jazz.SubNav.photo.but 2, _alpha, 100);
}
here a link to the project I am working on:
http://www.nelsonhstudios.com/Clients/EDP/
From there: go in Jazz and then click on musicians.
Thanks for the help.
|