Dynamically Loading A Jpeg In To A Movie Clip And Then....
First of all I am having problems loading a external jpeg dynamically in to a movie clip without killing the movie clip. Is it even possible to load a dynamic image to a movie clip and maintain the control over the movie clip to animate and do all the things you can do to a movie clip. Thanks in advanced for any replies.
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-20-2007, 04:34 AM
View Complete Forum Thread with Replies
Sponsored Links:
Scaling Problem While Loading External Jpeg's In The Movie Clip
Hi,
I am using loadMovie function to load the external jpeg files in the Movie Clip.
The Movie Clip (in which I am loading the external jpeg files) varies in size depending on the users screen resolution.
The problem I am facing while scaling the images in the Movie Clip. When I scale the images to fit it properly in Movie Clip, it gets distorted, as the image’s height and width is greater than the Movie Clip’s height and width.
Is there any solution to overcome this problem?
Thanks for any help!
Abhijit
View Replies !
View Related
Dynamically Loading Text Into A Movie Clip
Ok, I've been fighting with this for a while, and finally found something suitable but I would still like some help/clarification.
I'm trying to use a button to load a text frame that resides in a seperate movie clip other than the _root.
Right now I've got a dynamic text box called test_text in a movie clip called test_mc. test_mc resides on the _root. I want to load test_text using the button, test_button. test_button resides on the _root.
right now, the code on the button looks like this
Code:
on(release) {loadVariables("myText.txt", _root.test_mc.test_text);}
i have a stop(); on the frame, but that shouldn't effect the loading.
the .fla and .txt files are attached
if someone could gimme a hand i'd appreciate it
View Replies !
View Related
Loading Images Into Movie Clip Dynamically
I am trying to create thumbnails and when I try to load the image onto the dynamic movie clip...it suddenly becomes non-clickable.
if I create a movieClip with borders and color, it is fine.it just messes up when I load images onto the dynamically created movie clip.
It is baffling. any help would be appreciated.
here's the code for it:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
numImages = this.firstChild.childNodes.length;
d1 = 1;spacing = 70;
trace(numImages);
x = 250;d2 = 1;
for (i=0; i<numImages; i++) {
_root.createEmptyMovieClip("btn"+i,100+i);
_root["btn"+i].lineStyle(2, 0x000000, 100);
_root["btn"+i].beginFill(0xFF0000, 100);
_root["btn"+i].lineTo(25, -10);
_root["btn"+i].lineTo(25, 10);
_root["btn"+i].lineTo(-25, 10);
_root["btn"+i].endFill(-25, -10);
_root["btn"+i]._x = x + i*spacing;
_root["btn"+i]._y = 420;
trace(this.firstChild.childNodes[i].attributes.thmb);
//the line below is the one that messes up things
loadMovie(this.firstChild.childNodes[i].attributes.thmb,_root["btn"+i]);
}
btn1.onRelease = function(){
trace("Inside btn1");
}
btn2.onRelease = function(){
trace("Inside btn2");
}
btn3.onRelease = function(){
trace("Inside btn3");
}
btn4.onRelease = function(){
trace("Inside btn4");
}
btn5.onRelease = function(){
trace("Inside btn5");
}
btn6.onRelease = function(){
trace("Inside btn6");
}
btn7.onRelease = function(){
trace("Inside btn7");
}
btn8.onRelease = function(){
trace("Inside btn8");
}
trace(this.firstChild.childNodes[1].attributes.main);
//loadMovie(this.firstChild.childNodes[1].attributes.main);
};
myPhoto.load("xmlphoto.xml");
View Replies !
View Related
Loading Jpeg's Dynamically
Hi
I am having problems getting my images for my portfolio to load into my site, here's the AS I'm using.
on(release){
_level0.DropZone_mc.loadMovie("http://www.visionsofthem.com/portfolio/cba.jpg");
}
I have made sure the images are not progressive, and the DropZone is has an instance name, yet the images do not load
Any sugesstions ??
thanks in advance
View Replies !
View Related
Dynamically Loading An Image To A Movie Clip After Upload...
Hello!
I posted on the Actionscript 3 forums yesterday regarding a project that I am working on. I'm glad to say that a portion of what we are trying to accomplish is working, however we are having some issues none the less.
The overall scope is as follows:
1. Upload an Image to the fileserver
2. Place that Image on Stage in a Transformable Movie Clip
3. Export a 'snapshot' of the image to the file server
We now have the upload functionality working as intended. It is uploading to the file server. We have some work to do to ensure that file names aren't overwritten, that each has it's own ID, but we can mess with that later.
At this time, we need to get the Flash application to load the just uploaded image into a new instance of a movie clip. The movie clip that is on stage is a placeholder and is transformable, scaleable, moveable, etc.
Let's say that the placeholder movie clip is mcImagePlaceholder and it contains a image file "fish.jpg".
After upload, we need "fish.jpg" inside mcImagePlaceholder to be replaced by the new image. Using the FileReference class, we have already stored the file name in a variable "fileName".
How involved is the loading going to need to be? The mcImagePlaceholder aleady contains an image "fish.jpg" - can we just replace "fish.jpg"?
View Replies !
View Related
Dynamically Saving/loading Movie Clip Values
Hi folks
I could use some advice, I've been using Flash for ages but haven't a clue about backend scripting.
I've got a flash app where you can add movieclips to the stage and drag them around etc...
http://www.staff.ljmu.ac.uk/mkgngran/index.html
...what I'd like is for the user to dynamically save the _x, _y and _rotation values so they can be viewed by other people.
What would be the best way to do this - write to an XML file or to a MySQL database? I've looked at some tutorials but its beyond my capabilities to be honest. Any pointers would be appreciated.
View Replies !
View Related
Loading A JPEG Dynamically...problems.
Hello,
Let me start off by saying i am a beginner to actionscript, although i have a decent amount of experience in programming.
I am currently using Flash MX6.
I have reviewed all the help files available in flash and read most of the recent topics on this forum, but i am still stuck with a problem. This is probably due to my inexperience with actionscript, so i propose this question to the Forum...
(This should be simple enough for all you Hardcore action scripters!
My aim is to load a list of JPEGS at run time and display them on a viewer(Created by Flash) one by one.
To make matters simple ill cut down to the problem...
When i try to load the variable list with the names of the jpegs from a text file and then ask flash to display them, this does not work.
For example lets just load one piture name variable...
loadVariablesNum("Index.txt", 0);
//This loads a variable loadname=picture1.jpg
Viewer.loadMovie(loadname);
//This should display the jpeg "picture1.jpg" in the object "Viewer"
So basically by assiging the contents of the text file to the variable "loadname" i should then be able to use this variable to call the movie load file.
This does not work...
I have tried several things...
I tried inserting a loadname="picture1.jpg"; in the actionscript before the load, and obviously this did work. I also tried displaying the contents of the variable "loadname" in a dynamic text field, and it displayed it correctly.
This means that the variable is loading from the text file and that the jpeg should be displayed if the variable was being handed correctly.
Doing a trace of the variable 'loadname' in question on the text file, gives me 'Undefined', but still this same variable works with the dynamic text and is displayed???
SO WHY DOES THE .loadMovie NOT RECOGNISE MY VARIABLE loadname EVEN WHEN THE DYNAMIC TEXT FIELD DOES
Thanks for your time, i tried not to be long winded, but you have to explain these things correctly.
Cheers,
Mek
View Replies !
View Related
Dynamically Loading JPEG Files
I have created a project that loads thumbnail JPEGs into three of four scenes. The thumbnails are MCs that act as buttons which dynamically load text and a larger JPEG image (like a catalog would do). The first scene with thumbnails loads the larger JPEG files correctly, but the subsequent files do not. I tried using the same MC instance name and code for all three scenes.
_root.image.loadMovie("JPEGname.jpg");
What am I missing?
Thanks
View Replies !
View Related
Dynamically Loading JPEG Files
I have created a project that loads thumbnail JPEGs into three of four scenes. The thumbnails are MCs that act as buttons which dynamically load text and a larger JPEG image (like a catalog would do). The first scene with thumbnails loads the larger JPEG files correctly, but the subsequent files do not. I tried using the same MC instance name and code for all three scenes.
_root.image.loadMovie("JPEGname.jpg");
What am I missing?
Thanks
View Replies !
View Related
Loading External JPEG And SWF To Library Dynamically
Hi!
Is there a way to dynamically load external picture to library? The problem is, every time I load a picture with loadMovie(), I have to wait till Flash loads it (size is 100 KB - slow on 56k connection). I need some way to load it only once, put it into library, and have it available for reuse later.
It's really painful, since I have image gallery with more than 40 pictures, every time I open the gallery, it loads every single of 40 pictures again.
So I need some way to cache this pictures inside Flash...
Thanks!
View Replies !
View Related
Loading External Graphic (jpeg) Using Text File Dynamically
Hello all experts , i need your help ~!
Can anyone please help me by teaching me how to load an external jpeg file which can be change dynamically from a text file?
it would be best if you could provide some tutorial or posting some examples.
I have being stuck for 2 days and have tried out many ways but still cant work. Below is my code which i have tried out! Thanks for helping me . : )
myVars = new LoadVars();
myVars.load("text.txt");
myVars.onLoad = function(success)
{
if (success)
{
loadMovieNum("myVars.image", 1);
}
}
View Replies !
View Related
Loading Pictures Dynamically To A Dynamically Loaded Clip
Here's the issue. I'm creating a video player and EVERYTHING is working swimmingly except for one thing. On my list of available videos (which is XML driven) everything reads in correctly and the movie clips are added correctly, but I can't get the thumbnails to add to the stage. Someone help!! Here's the code I'm using:
EDIT: Oh yeah, the thumbs are located in a separate directory and the location is indicated in the xml file. the "vidList" variable is my XML list.
PHP Code:
function loadPics():void //this is the first function called...{ for(var i:uint = 0; i < vidList.length(); i++) { var picLoader:Loader = new Loader(); picLoader.addEventListener(Event.COMPLETE, onPicLoaded); picLoader.load(new URLRequest(vidList[i].thumb)); trace(vidList[i].thumb); picLoader.width = 72; picLoader.height = 54; picLoader.x = 0; picLoader.y = 0; picLoader.name = vidList[i].title; } populateList();}function onPicLoaded(e:Event):void //this should be called after each pic is loaded, but the trace statements have yet to appear.{ trace("________________________"); trace(e.currentTarget.name); trace("________________________");}function populateList():void //everything in here works fine{ for(var i:uint = 0; i < vidList.length();i++) { var lItem:ListItem = new ListItem(); lItem.title.text = vidList[i].title; lItem.caption.text = vidList[i].caption; lItem.x = 5; lItem.y = 7+(79*i) lItem.filters = [dsf, bf]; lItem.name = vidList[i].title; list.addChild(lItem); lItem.addEventListener(MouseEvent.CLICK, clickVideo); }}
Can anyone give me any kind of suggestion on how to do this?
Basically, after all the foundation stuff for the video player is done, it calls the loadPics function. That is supposed to load each pic and then upon the pic being loaded, it was going to call the onPicLoaded function and I was going to (somehow) pass them to some type of array. Then, in my populateList function I would just use "i" to put the correct pic with the correct video.
Please help! I can give you more if you need it. I just don't know what else to post.
View Replies !
View Related
Movie Clip To Jpeg
Hello.
My newbie questions are can a movie clip be converted to a JPEG in Flash and how is this done?
The user generates the JPEG in the action on click of the button.
Thanks
View Replies !
View Related
Unloading A JPEG From A Movie Clip
My flash movie is repopulated with XML data each time the submit button is clicked. I got it to load a JPEG properly into a movie clip, but when it is repopulated with a smaller JPEG, I can still see the first JPEG behind the second one. Is there a way to remove the old one before adding a new one to a movie clip?
Here, among other things, is what I tried:
Attach Code
var request:URLRequest = new URLRequest(imageArray[counter]);
var loader:Loader = new Loader();
if (photo.child == true) { photo.removeChild(); }
loader.load(request);
photo.addChild(loader);
View Replies !
View Related
How To Center A Loaded Jpeg In A Movie Clip?
Hello fk.
I want to load jpegs in using loadMovie. I have a container or "empty" movie clip that I want to load these jpegs into. The catch is that I want them to be centered in that empty movie clip. Can this be done?
Also, I would like the code to be adaptable. For example. If I make my container movie clip a certain size, say 450 x 450 using an obect like a square at alpha 0, can the code carry over to a container that is 400 x 600. I just don't want to go back and tweek code if I change my design. I wish I new more about functions and the like but I don't. Any insight appreciated.
View Replies !
View Related
Save Movie Clip In Frame As Jpeg
We Are Developing A web Application as the following :
the Client Can select A template then Write words on over it and Save the Template as Jpeg format ,we did the first part ,how we can save the movie Clip as JPEG format ,I looked in the Bitmap class and i did not found any Solution,also I used the PHP to send Data to It From Flash but it is very Slow Proccess is there any way to do this from Flash
Edited: 12/08/2007 at 10:32:20 AM by hanyegypt
View Replies !
View Related
Resizing Jpeg Inside A Movie Clip
I have a movie clip on my stage names "t".
Inside "t" there is a movie clip named "pic".
Both t and pic are 80x80 px.
Here is what I am doing in my action script:
var t = tn_group.tn.duplicateMovieClip("tn"+i, i);
t.pic.loadMovie(folder+photo_thumbnail);
if (t.pic._width gt t.pic._height) {
ScaleRatio = 80/t.pic._width;
} else {
ScaleRatio = 80/t.pic._height;
}
t.pic._xscale = ScaleRatio*100;
t.pic._yscale = ScaleRatio*100;
The problem is, the t.pic._height & _width always are 80, and not what my jpegs are.
How do I get the actual size of my jpeg? I've tried t._height & _width, and lots of other contortions and nothing seems to return the actual size of my jpeg.
Any one know what I'm missing?
Brent Text
View Replies !
View Related
Output Flash Movie Clip As A Jpeg?
I'd like to create a swf where the user can arrange some small movie clips to create a composite picture and then I'd like to be able to allow them to save or send that picture to others in an email or at least output it in a format they can show others. In other words, I'd like them to be able to save the picture they created and use it elsewhere.
I realize this sounds complicated and will need to use various technologies, but dies anyone have a clue?
Thanks,
R
View Replies !
View Related
Dynamic JPEG In Movie Clip, Can't Adjust Position
Hey Folks!
I've been up all night trying to figure out what I think is a very simple problem. I have a scrolling portfolio (made up of multiple thumbnail buttons #1-42) with each picture loading a dynamic .jpg using a movie clip called pix. This is the code I have for each button:
on (release) {
_root.pix.loadMovie("portfolio/1.jpg", "get");
}
Everything works beautifully, FINALLY, BUT, now, the problem is, each photograph is a different width and the movie clip position is the same for each, leaving most of them off-center(there are 3 different sizes). I tried making multiple movie clips, one for each size on different layers of the timeline, but then the photos stack on top of each other. I would like to be able to adjust the coordinates of the movie pix, so that I can attach these independently to each button and customize the _x & _y axis for perfect centering.
True, I know little actionscripting, but in 10 hours, you'd think I would have found something that worked. Is this just so simple I am overlooking it?
Thanks!
Jen
View Replies !
View Related
OnPress On A Movie Clip That's Loaded A Jpeg - Flash MX..
Greetings,
I am trying to create a drag and drop interaction using jpegs. The problem is after loading a jpeg into the movie clip the onPress event handler is no longer active. I've tried the onEnterFrame trick, but that's not working either. Here is one more catch, I am dynamically duplicating these movie clips inside a for loop. So, there could be between 1 and 5 movie clips.
Please point me to some help I'm really struggling here...
for (var i=0;i<_global.dtrs_obj_array.length;i++) {
// duplicated movie clip for distracter
this.dtr.duplicateMovieClip("dtr" + i +"_mc",i);
//set it's instance name in the global dtrs_obj_array
// reference to the duplicated mc
thisDtr = this["dtr" + i +"_mc"];
_global.dtrs_obj_array[i].name = thisDtr; //._name;
// load jpeg into movie clip
_global.dtrs_obj_array[i].name.loadMovie("food.jpg");
// configure correct string variable sequence
if (_global.dtrs_obj_array[i].targ != "null") {
_global.correct_str += ":" + _global.dtrs_obj_array[i].name;
}
// position duplicated movie clips
_global.dtrs_obj_array[i].name._x = 100;
if (i == 0) {
_global.dtrs_obj_array[i].name._y = 65;
} else {
_global.dtrs_obj_array[i].name._y = _global.dtrs_obj_array[i-1].name._y + _global.dtrs_obj_array[i-1].name._height +10;
}
// distracter starting positions
_global.dtrs_obj_array[i].startx = _global.dtrs_obj_array[i].name._x;
_global.dtrs_obj_array[i].starty = _global.dtrs_obj_array[i].name._y;
// event handler for dragging the distracters
_global.dtrs_obj_array[i].name.onPress = function() {
/*
using properties from the Stage object we stop
the distracter from being dragged off the stage
*/
startDrag(this,false,50,50,Stage.width-50,Stage.height-50);
orig_x = this._x;
orig_y = this._y;
}
// event handler for dropping the distracters
_global.dtrs_obj_array[i].name.onRelease = function() {
stopDrag();
this.swapDepths(shoppingcartbasket); // this target reference needs to be dynamic
//if (this.hitTest(shoppingcartbasket)) {
if (eval(this._droptarget) == shoppingcartbasket) {
_global.guessed_str += ":" + this;
this._x = shoppingcartbasket._x //+ tgt._width/2;
this._y = shoppingcartbasket._y //+ tgt._height/2;
} else {
this._x = orig_x;
this._y = orig_y;
}
}
} // end for loop stepping through array of distracter objects
Thanks!!!
thotskee
View Replies !
View Related
Finding The Width Of A JPEG Loaded Into A Movie Clip
I will be loading a page of bio information. Next to the person's photo (photos will vary in width) I want to put a column of buttons about 20 pixels to the right of the photo. So after I load the photo into an empty movie clip, I'm trying to get the width of the photo in order to figure out the x position of the buttons next to it. Here is what I have:
myImage = "images/" + _level0.images[link];
loadMovie(myImage,image_mc);
// JPEG loads okay into image_mc //
trace("image_mc._x = " + image_mc._x);
// I get "Image_mc._x = 393" as expected //
trace("myImage._width = " + myImage._width);
// I get "image_mc._width = undefined" //
trace("image_mc._width = " + image_mc._width);
// I get "image_mc._width = 0" //
How do I find the width of the loaded JPEG?
View Replies !
View Related
Swapping The Jpeg Loaded Into A Movie Clip With The One In A Button
Hey.
I have three buttons, which when clicked load an external file into a movie clip called container. The first jpeg (1.jpg) is loaded into the container when the movie loads and the thumbnail buttons have the files t2.jpg, t3.jpg and t4.jpg loaded. When these are clicked they load 2,3 and 4.jpg respectively into the container.
The problem is that I can only have 3 buttons but need to display 4 images. So I want the image that is loaded into the container to swap with the one that is in the button. I can't find any code, either on this forum or on the web, that retrieves the name of a file that is loaded into a movie clip. This is what I need.
Because all the images are named 1,2,3 or 4.jpg and the thumbnails for the buttons are t1,t2,t3 or t4.jpg I should be able to easily write the additional code to change what happens when the button is clicked, because when the picture on the button has changed to what was loaded into the container, the on(Release) code will need to change too.
I hope this makes sense to someone, I know it is a very long post but thought it best to give more detail rather than less.
Thanks
View Replies !
View Related
Populating An Empty Movie Clip W/jpeg Via Cold Fusion..
Ok, Im trying to set up a flash movie with empty movie clips that are populated by Cold Fusion. I understand the basic setup for the communication to take place and how to build the database. I have been writing a event handler like this
function kobeleft_onload() {
populate.getLeft();
}
Heres the properties of the code:
kobeleft= empty movie clip
// SETUP CONNECTION
NetServices.setDefaultGatewayURL("http://localhost:8500/Lakers");
gatewayConn = NetServices.createGatewayConnection();
// SETUP SERVICES
populate = gatewayConn.getService("Lakers.qry_info"());
getLeft= name of the cold fusion function that gets image from database...
<cfcomponent>
<cffunction name="getLeft" access="remote" returntype="query" >
<cfquery name="leftpic" datasource="Lakers">
</cfquery>
<cfreturn getLeft>
</cffunction>
I dont know if any of this helps, But I know that Im probably missing something for getting the results back from Cold Fucion and into Flash...If you have a simple example or know where to find a very simple way to do this I would appreciate it very much.
Thanks
View Replies !
View Related
Jpeg Loading, Out Of Site... To Use Later In Movie
I am creating a site that is one flash movie... to prevent long download times and to avoid having to make the user sit through a "progress bar" style loader 30 times while surfing the site... I am searching for a solution that will allow me to begin loading a series of jpegs as soon as the sites intro loads and begins playing. This way while they are enjoying the intro, or reading main level content... the pictures for the other sections of the site are loading behind the scenes.
Any Ideas???
View Replies !
View Related
Problem Loading Jpeg In To Flash Movie
simple script yo load jpeg in to swf using variables
i want to use text in put to the tex1.txt as a variable to load jpeg.
i gave extention .jpg in to txt2 and convert it to pic2 variable.
then i tried to use loadmovie to load the variable but it didnt work...
pls some one help me on this matter....
on (release)
{
pic1 = text1
text2= pic1+".jpg"
pic2 = text2
loadMovie(pic2, 1);
}
View Replies !
View Related
Loading Movie After Loading Jpeg
So i have a movie that loads a jpeg dynamically, and when i press a play button, i want it to load a movie into the same place. The problem seems to be that after loading the jpeg, i cannot control the movie anymore. Specifically, the jpeg is loaded into _level0.mov1.LoadMovHere
I have 2 frames on mov1. Frame 1 loads the jpeg and has a stop. Frame 2 loads the swf, has a trace (for debugging), and a stop. I have tried everything to get this to gotoAndPLay(2), what am i missing?
any help is appreciated, thanks.
View Replies !
View Related
JPEG Loading... How Do I Wait Until The Jpeg Has Loaded
Hi everyone!
this is the code that I currently use. I want to be able to wiat until the jpeg is loaded before going trought the loop again.....
any ideas? I have tried to use the getBytesLoaded and getBytesTotal but they always show up as 0. Very annoying.
Code:
var currentX = 0
for (k=0;k<galleryVar.items;k++){
_root.thumbslider.createEmptyMovieClip("thumb" + k,(50 + k));
eval("_root.thumbslider.thumb" + k)._x=currentX;
loadMovie(_root.categoryList+"/thumbnails/"+_root.imageArray[k]+".jpg",eval("_root.thumbslider.thumb" + k));
currentX = currentX + eval("_root.thumbslider.thumb" + k)._width;
trace("Pic" + k + " " + currentX);
}
the "currentX" (2nd line from the bottom) doesn't get a value because the jpeg doesn't get loaded quickly enough. How can I wait for the jpeg to load before going through the loop again.
I don't want to use frames becasue I am creating everything dynamically!
Am i making sense?
Hope someone can help me!
Thanks
A
View Replies !
View Related
Loading External Movie Clip With A Button Inside Another Movie Clip Help
Hi,
I am working on a scrolling thumbnail movie clip, that when you click on the thumbnail button inside the movie clip it will load an external movie clip. I have an empty movie clip on the main stage, and have been trying all sorts of code, but for some reason it doesn't like that I am inside a movie clip using buttons. It can't seem to find the external swf.
I have tried:
on (release) {
loadMovie (ithink.swf, "loader");
and
on (release) }
if (firstTime == true) {
loadMovie("ithink.swf", _root.loader);
firstTime = false;
} else {
_root.clicked = "ithink.swf";
_root.loader.gotoAndPlay("goback");
}
}
and so far nothing, for some reaosn when I click on a button outside of the movie clip with the above code it loads... and than the other works too, but if I click on the buttons inside the scolling movie clip first they won't work.
Any suggests or ideas!!?
I would really appreciate it... I am beyond frusterated!!
View Replies !
View Related
Loading Dynamic Textbox While Dynamically Loading Movie
Hi All,
So, I've got a movie on the stage (but offstage) called: Card. Inside this MC is a dynamic textbox called: CardName. I'm using a for loop to create a column of cards w/ their corresponding textboxes.
Here's the code:
for (var j = 1; j<=6; ++j)
{
var name = "Card_"+j;
var y = (j-1)*game.spacingY + game.originY;
game.path.attachMovie("Card", name, ++game.depth);
game.path[name]._x = x;
game.path[name]._y = y;
game.path[name]._width = game.cardSizeX;
game.path[name]._height = game.cardSizeY;
game.path[name].CardName.text = "card #" + j;
}
The cards and the textboxes inside the card MCs load fine but the actual textboxes don't change from the default text I've hard-coded in. How can I reach the dynamic textbox inside the card Movie Clip to manipulate the text.
Thanks.
View Replies !
View Related
Getting One Movie Clip To Follow Another DYNAMICALLY
Ok, I'm trying to create some circles (or balls, whatever) that connect to a line and "stick" to the line, no matter where the line might move...like a strand of pearls. So, if the first "ball" moves up, the entire line of balls will follow suit.
Sort of like a mouse trailer, but not on a mouse. Just a free-standing Movie Clip that I can use again and again.
I'm using MX.
Thoughts?
Thanks!
View Replies !
View Related
LoadMovie To A Dynamically Placed Movie Clip
I understand that I might be doing something that is not possible. I am attaching an external JPG file to a movie clip that was programmatically generated and placed. In any case I want to run it by some of you out there.
PHP Code:
function productLayout() {
x = 0;
y = 325;
xSpacing = 110;
ySpacing = 75;
totalProducts = totalModels
for (i=1; i<=totalProducts; i++) {
_root.attachMovie (listBox, "productHolder"+i, i+40);
var productBox = "productHolder" + i;
trace(productBox);
_root.productBox = eval(productBox);
_root.productBox._x = x;
_root.productBox._y = y;
_root.productBox.loadMovie(this["pictureUrl" + i]);
++i;
if (i>totalProducts){
break;
}
_root.attachMovie (listBox, "productHolder"+i, i+50);
var productBox = "productHolder" + i;
trace(productBox);
_root.productBox = eval(productBox);
_root.productBox._x = x;
_root.productBox._y = y+ySpacing;
_root.productBox.loadMovie(this["pictureUrl" + i]);
++i;
if (i>totalProducts){
break;
}
_root.attachMovie (listBox, "productHolder"+i, i+60);
var productBox = "productHolder" + i;
trace(productBox);
_root.productBox = eval(productBox);
_root.productBox._x = x;
_root.productBox._y = y+(ySpacing*2);
_root.productBox.loadMovie(this["pictureUrl" + i]);
++i;
if (i>totalProducts){
break;
}
x=x+xSpacing
}
}
Thanks,
Flashtech2K
View Replies !
View Related
Dynamically Load Movie Clip
i have a png file of an image (in flash i have made it a movie clip called "leaves"), and what i am trying to achieve is that the image appears in random coordinates and at random rotations in the flash movie, essentially appearing and eventually covering the background. if you are familiar with photoshop, i am essentially using the leaf "stamp" brush to make the bacground, and i want it too look like i am drawing it with flash.
does that make sense? what would be the easiest way to achieve this? thanks,
chris
View Replies !
View Related
Dynamically Stop A Movie Clip
hello,
Newbie here and had a hopefully easy question. I'm, currently trying to stop a movieClip dynamically but not sure what way to take. Presently I've loaded seperate movieClips all have there own instance names. Here's a sample of my code:
function moviePicker(num)
{
switch(num)
{
case 1:
linkage = "home";
break;
case 2:
linkage = "local";
break;
case 3:
linkage = "search";
break;
case 4:
linkage = "more";
break;
case 5:
linkage = "driving";
break;
default:
trace("not picked");
break;
}
holder_mc.attachMovie(linkage, linkage+"_mc", this.getNextHighestDepth());
}
I'm also using the Key class to load the movie which is:
var keyListener_obj:Object = new Object();
keyListener_obj.onKeyDown = function()
{
switch (Key.getCode())
{
case Key.SPACE :
startStopMovie();
break;
case Key.LEFT :
leftArrow();
break;
case Key.RIGHT :
rightArrow();
break;
}
}
Key.addListener(keyListener_obj);
The "space" command calls to a function called startStopMovie(); which is:
function startStopMovie()
{
demoMovie = sections[0] + "_mc";
if(!stopping)
{
trace("is stopped "+ stopping);
holder_mc[demoMovie].stop();
stopping = true;
}else{
trace("is playing "+ stopping);
holder_mc[demoMovie].play();
stopping = false;
}
}
which stops the first movie clip fine and I'm passing an array for "sections[0]" as:
var sections:Array = new Array("home", "local", "search", "more", "driving");
Is there a way to dynamically pass a number for that sections array when pressing the left or right key.
Here's the code in all it's glory - Thanks for any help!!!!
stop();
_quality = "BEST";
//////////////////////////////////////////////////
//declare variables
_global.demo = this;
var stopping:Boolean = false;
var section:String = home;
var linkage:String;
var newID:String;
var whereAmI:Number = 1;
var sections:Array = new Array("home", "local", "search", "more", "driving");
/////////////////////////////////////////////////
//Initialize
function init()
{
demo.createEmptyMovieClip("holder_mc", demo.getNextHighestDepth());
holder_mc._x = 0;
holder_mc._y = 0;
moviePicker(1);
}
/////////////////////////////////////////////////
//show movie
function moviePicker(num)
{
switch(num)
{
case 1:
linkage = "home";
break;
case 2:
linkage = "local";
break;
case 3:
linkage = "search";
break;
case 4:
linkage = "more";
break;
case 5:
linkage = "driving";
break;
default:
trace("not picked");
break;
}
holder_mc.attachMovie(linkage, linkage+"_mc", this.getNextHighestDepth());
}
/////////////////////////////////////////////////
//stop/play movie
function startStopMovie()
{
demoMovie = sections[0] + "_mc";
if(!stopping)
{
trace("is stopped "+ stopping);
holder_mc[demoMovie].stop();
stopping = true;
}else{
trace("is playing "+ stopping);
holder_mc[demoMovie].play();
stopping = false;
}
}
/////////////////////////////////////////////////
//Left Arrow
function leftArrow()
{
if(whereAmI > 1)
{
whereAmI--;
moviePicker(whereAmI);
}
}
/////////////////////////////////////////////////
//Right Arrow
function rightArrow()
{
if(whereAmI < 5)
{
whereAmI++;
moviePicker(whereAmI);
}
}
//////////////////////////////////////////////////
//keyboard
var keyListener_obj:Object = new Object();
keyListener_obj.onKeyDown = function()
{
switch (Key.getCode())
{
case Key.SPACE :
startStopMovie();
break;
case Key.LEFT :
leftArrow();
break;
case Key.RIGHT :
rightArrow();
break;
}
}
Key.addListener(keyListener_obj);
//////////////////////////////////////////////////
//initialize
init();
trace("sections: "+sections[0]);
View Replies !
View Related
Desaturate Movie Clip Dynamically?
I was wondering if it were possible to desaturate a .jpg thats loaded into a movie clip dynamically?
I'd like the image to come to full color when the mouse rolls over it... and return onRollOut...
Oviously I know how to do this with multiple images, I'd just prefer to avoid it since everything's being pulled in from xml...
I played around with color matrix filters and was able to change the image to black and white, but unable to use this to get the results I wanted...
Any suggestions?
View Replies !
View Related
Help For Removing Movie Clip Dynamically
Hello Everyone,
I please need your help in removing Movie Clips Dynamically with the code, as I am making a simple brick breaker game I figured out the adding of the bricks dynamically but I cant make them to remove when the ball hits the bricks. The following way I have made the bricks
Code:
function makeLvl() {
var arrayLength:Number = lvlArray[currentLvl-1].length;
for (var i:Number = 0; i<arrayLength; i++) {
if (lvlArray[currentLvl-1][i] == 1) {
this.attachMovie("brick", "brick"+i, i, {_x:30+(i-brickRow*6)*80, _y:40+brickRow*20});
for (var c:Number = 1; c<=10; c++) {
if (i == c*6-1) {
brickRow++;
}
}
}
}
This way I am trying to remove it but no luck with it
Code:
if(ball1_mc.hitTest(brick1_mc)){
brick1_mc.removeMovieClip();
ballYSpeed*=-1;
}
Thanks alot for your help sorry if I made any mistakes in posting as I m a newbie to this site and to flash.
View Replies !
View Related
Attaching A Movie Clip To Another -- Dynamically?
I have a situation where I have a parent object that I want to act as a container for any number of dynamically generated child objects. Using the attachMovie() command however, it seems to require a linkage ID, which I will not have since I am creating new child objects on the fly, each with their own properties that I want to be persistent inside the parent container.
In pseudo-code, what I'd like to do is:
when user clicks a button {
create new child object, named child1, child2, etc
}
user can drag any child object
when user drags any child onto the parent {
child is attached, so that it "sticks" to the parent container, and any properties of the parent are inherited by the children.
}
Any thoughts?
View Replies !
View Related
Targeting A Movie Clip That Was Created Dynamically
Hi All,
I'm could really use some help with this. I'm using duplicate movie clips to load variables from an .asp file on the server. The problem I'm having is getting the return variables into the movieclip that made the call.
The following script creates the duplicate movieclip and passes it some variables. It is in a movieclip named Governor.
Set Variable: "RandomNum" = Random(50)
Set Variable: "NewClip" = "CR" & RandomNum
Duplicate Movie Clip ("_level0/ContactRemote", NewClip, RandomNum)
Set Variable: "_level0/" & NewClip & "/:CalledFunction" = ../:CalledFunction
Set Variable: "_level0/" & NewClip & "/:ReturnFunction" = ../:ReturnFunction
Set Variable: "_level0/" & NewClip & "/:Parms" = ../:Parms
Set Variable: "_level0/" & NewClip & "/:TargetServerURL" = ../:TargetServerURL
Set Variable: "_level0/" & NewClip & "/:ClipDepth" = RandomNum
Set Variable: "_level0/" & NewClip & "/:ClipName" = NewClip
Call ("_level0/" & NewClip & ":CallServer")
Go to and Stop (1)
Next, in the newly created movie clip I do this:
Load Variables (TargetServerURL, "_level0/" & ClipName, vars=POST)
Get URL ("javascript:" & ReturnFunction & "('" & retval & "')")
Remove Movie Clip ("_level0/" & ClipName)
Stop
The problem seems to be the target in the Load Variables action, but I've tried several different ways of specifying it but the only one that works is using level 0 and fetching the variable from there.
Any help is greatly appreciated!
View Replies !
View Related
How To Change Instance Name Of Movie Clip Dynamically?
Dear,
Is there any way to change instance name of movie clip dynamically?
Suppose, there are...
Button A named 'a1'
Button B named 'b1'
Button C named 'c1'
Movie Clip named 'm1' with instance name 'm1'. (this constains button 'c1').
if I press Button A then, I want to show movie clip 'm1' with instance name 'm1'
And if I press Button B then, I want to show movie clip 'm1' with instance name 'm2'
To make a long story short, I want to change instance name of movie clip dynamically.
Is this possible?
Thanks in advance,
Yung
View Replies !
View Related
Duplicating Dynamically Generated Movie Clip
Maybe I've been staring at the computer too long, but I'm having a really tough time with something that I thought would be fairly easy.
I generate a movieClip with createEmptyMovieClip, and then use the drawing API to make a little frame, with additional movie-clips added to this one as buttons.
And then I try to duplicate this movieClip, and it creates a new movieClip, but the new clip is completely empty. The code I'm using to duplicate the movieClip is this:
field0.duplicateMovieClip("field1", 2);
Is there something I need to be doing differently to copy all clips within this movie clip? Thanks
-#
View Replies !
View Related
PHP Script From A Dynamically Loaded Movie Clip
Yeah I am confused by the title too.. so anyway here it goes:
I have an email form contained in a movie 'contact.swf' that I am loading into my main movie via empty "container9", 9.
Everything seems to work fine but does not send my message. The script looks something like this:
on (release) {
if (name eq "" or subject eq "" or message eq "" or email eq "") {
stop ();
} else {
loadVariablesNum ("form.php", 0, "POST");
gotoAndStop (2);
}
}
I have changed the script: loadVariablesNum ("form.php", 9, "POST");
thinking it had something to do with the dynamically loaded movie clip residing on a different level than my root movie but to no avail. It seems like my loadVariables script is not being executed properly and it cannot call to my php file on the server. It is not a problem with my server because the 'contact.swf' movie works perfect when its not being loaded into another movie. Thanks in advance for the help. Matt.
View Replies !
View Related
Dynamically Creating Instance Name Of Movie Clip
Hi everyone
a shove inthe right direction very much needed.
I have a movie clip (Lets call it mc01.swf) that I am loadin on my main movie.
this movioe clip is loaded inside an empty container in my main movie. the contaner mc han instant name "contmc"
I want to stop the loaded Mc i.e mc01.swf whcih is loading inside the empty container.
any idea how i can target the time line of teh loaded movieclip??
thanks for your help
P.S. im using flash MX
View Replies !
View Related
Duplicating A Dynamically Load Movie Clip
Hello everyone,
For an idea I am playing with, I am attaching a movie clip to the stage, and then dynamically loading a JPG image into a movie clip inside of the attached movie clip. Unfortunately, when I make a duplicate of this movie clip, the JPG image is not duplicated.
The code is something like this:
code:
attachMovie("block","block1",10)
block1.load_mc.loadMovie("picture.jpg")
duplicateMovieClip("block1","block2", 11)
My question: Is there anyway I can load the JPG image into my movie once, and then duplicate it without losing the dynamically loaded JPG? The current solution I am using reloads the JPG each time I make a duplicate, which is very annoying and takes a lot of memory. (It killed the Window 98 machine I was working on today...)
-pXw
View Replies !
View Related
Animating A Dynamically Generated Movie Clip?
Hi. I've been reading alot about Flash MX drawing API's and I think that it's very interesting how you can draw the contents of these dynamicly genreated movieclips using actionscript. My question is whether there is a way to do any moving or animation of the contents of these clips without actually altering the movieclip itself, obviously it would have to be done with actionscipt. For example. I code a new movieclip to be generated and I draw a rectangle in it, and on a button press I want that dynamically generated rectangle to change size over a certain number of frames. Is that even possible to code without actually creating the movie clip and then animating the size change. I'd really appreciate the help, I've been hard pressed to find any info on this subject. If you know of any places with information, links would be good as well. Thanks again.
-Dranore
View Replies !
View Related
Dynamically Creating Movie Clip Names - Help
for (i = 1; i < 5; i++){
_root.createEmptyMovieClip("Thumb_" + i, i);
Thumb._x = 10 + x;
Thumb._y = 10 + y;
Thumb_[i].loadMovie("thumb_" + [i] + ".jpg");
x+=10;
y+=10;
}
^ obviously flawed
I need for the code to load "i" number of images onto the movie.
I'm trying to make this as simple as possible. So instead of hard coding it, I made it into a loop.
but it won't work, partly because I messed up the syntax. partly because I don't know what I'm doing
View Replies !
View Related
OnClipEvent For Dynamically Created Movie Clip?
I've just dynamically created a movie clip containing a simple square by inserting the following code into the first frame of a new project:
this.createEmptyMovieClip('square',0);
with(_root.square)
{
moveTo(0,0);
beginFill(0x000088)
lineTo(100,0);
lineTo(100,100);
lineTo(0,100);
endFill();
}
Now I want to be able to animate this square. I want to use the OnClipEvent(EnterFrame) and change the _x value of this square. But Flash keeps telling me that the OnClipEvent can only be applied to a movie clip object. So how can I do this purely from code? I don't want to have to create the square at design time.
Also, how can I animate the square without having to use the OnClipEvent(EnterFrame)? I tried using a For..Next loop but it just animated so fast that I only see the last position of the square. How can I do this so that I can actually see it animating? Again, I want to do this purely in code.
Thanks,
May
View Replies !
View Related
|