ActionScript 3.0 :: Loading Image Inside Of Movieclip?

Nov 8, 2009

how would I LOAD an image.. into a movieclip.. then resize the movieclip to the size of the image..

now I know how to put the image inside of the movieclip with addChild(), but then when I try to resize the movieclip to the size of the IMAGE, it changes the size of the image inside the movieclip.. now I know that when a movieclip scales so does everything else.. so my question is.. how to go about modifying this to make it work no matter what

basically I have a editor so to speak and when you drag the blips it will resize it.. but the problem is actually LOADING the image into the movieclip because once it is same width/height as the movieclip (and shows that way on the screen) my script will handle it perfectly. is there a trick to this.. here is the code I've got so far..

Code:
function dispatch(e:Event):void {
this.removeChildAt(2);
var l:LoaderInfo = imageLoader.contentLoaderInfo;

[Code]....

the loader can change so I remove it from the movieclip when the dispatch function gets called, imageLoader is the loader which loads the image.. sizes just returns either max sized resized proportions or regular height of the image.. note "this" or rather the element I'm using is by default 100x100.

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Loading A Swf Into A Movieclip Inside Another Movieclip?

Jun 24, 2008

i am having a main.swf which has a movieclip in the form of a window. it's instance name is window_mc. this window has an empty movieclip called load_mc and i am trying to load another swf called login.swf into window_mc.load_mc using

window_mc.load_mc.loadMovie("login.swf");

both main and login swfs are having resolution 1000x780.. but wen it is loaded as said above, the texts inside the loaded swf looks very large. the resolution looks as if they are different.. i haven't tried loading movieclips much. but wen i load a swf into an empty movieclip, it wrks perfectly fine...

View 9 Replies

ActionScript 3.0 :: Loading A Swf Into A Movieclip Inside Another Swf

Jul 23, 2010

I am having a problem loading a swf into a movieclip inside another swf. I keep getting this error message:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at contact_fla::MainTimeline/frame1()

after googling the error, I have come to suspect that I am trying to load the swf before the stage is ready for it. Although, I load another swf and it loads fine. How can I verify which part of my movie is causing the problem?

View 3 Replies

ActionScript 2.0 :: Loading Xml Inside A Movieclip

Aug 29, 2007

loading an xml file into the main main root works fine. but when i place the load xml function inside of a movie clip, it is no longer functional.

View 5 Replies

ActionScript 2.0 :: Loading External SWF Inside Of MovieClip

Feb 22, 2012

I'm trying to load an external swf inside of my movie clip.
meter.loadMovie("external.swf");
I managed to get the above to work but as soon as I press a button in the external movie it reacts with my main movie! So a button in the external movie that makes the timeline go to frame 2 makes the main flash file to goto frame 2. Also, can you load external swf files that use external folders for content? Basically I have an interactive diabetes meter and it's all controlled via scripting ( I didn't create it ) but it has the main swf file which you load. However it references other folders and scripting files.

View 2 Replies

ActionScript 2.0 :: Loading Outside Variable Inside Movieclip?

Apr 18, 2004

I have a movie clip that needs to load an outside Variable and I know how to do it if the Variable is in the main time line.

Main TimeLine:
timedelay = 5;
MovieClip

[code]......

View 1 Replies

ActionScript 2.0 :: Loading Text Variables Inside Movieclip?

Sep 10, 2008

I want load text variables to the movieclip inside.heres the script.

Code:
on (release) {
_root.txtBox.text = "Messages"; \outside movieclip WORKS FINE

[code].....

View 1 Replies

ActionScript 3.0 :: ZoomIn Effect Of Image, Not Actually Inside The MovieClip?

Dec 10, 2009

Suppose position of MovieClip is x=400,y=600 height=550,width=100.
 
My problem was that the When I apply the zoomIn effect of image,It is not actually inside the MovieClip.Image is coming out from the MovieClip during the zoomIn effect.
 
I want to apply a zoomIn effect for the image in the MovieClip only.

View 8 Replies

ActionScript 3.0 :: Retrieving Image Name From Xml Then Will Be Echoed Inside The Movieclip

Nov 15, 2011

I just want to ask sometihng on how to show the image inside the movieclip by pulling the image name inside the xml file. this is my xml file.

[Code]....

View 3 Replies

ActionScript 3.0 :: Loading External Swf Files With Buttons From Inside A Movieclip?

Mar 3, 2010

In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame. On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
 
Do I add event listeners on the last frame of mc_1 for each button? how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
 
So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.

View 4 Replies

ActionScript 3.0 :: Loading A MovieClip From The Library And Then Changing Text Inside?

Dec 5, 2011

I have a movieClip in the library with the linkage Class name as "LinkClass". I can make it appear on the stage, but there's a dynamic text box inside that is called "linkText" that I can't seem to get working. Here's the code:

myLink = new LinkClass();
myLink.name = "linkButton";
box.boxMC.linksMC.addChild(myLink);

[code]......

View 10 Replies

Professional :: Animate Image Inside MovieClip Then Duplicate And Swap

Oct 31, 2011

I have 170 images that I need to place on the same place on the left side of the stage and and have them move across the stage one at a time, increase in size and then fade out after 10 sec. The sequence then continues for all 169 images. My initial thoughts are to animate the first image inside a movie clip, duplicate it and swap the image. When I tried this it worked fine until the image had shape tweened to the larger size (at this point the image displays for 10 sec and fades out). At the key frame at this point the image changed back to the original one. What do I need to do to make the new image visible throughout the whole movie clip when I swap the image like this? Is there a better way to produce this type of animation? I am using Flash Professional 8 and quite new to the world of Flash and Action Script.

View 14 Replies

ActionScript 3.0 :: Give ZoomIn Effect In An Image Inside MovieClip.?

Dec 10, 2009

Suppose position of MovieClip is
x=400,y=600 height=550,width=100.

My problem was that the When I apply the zoomIn effect of image,It is not actually inside the MovieClip.Image is coming out from the MovieClip during the zoomIn effect.

I want to apply a zoomIn effect for the image in the MovieClip only.

View 3 Replies

ActionScript 3.0 :: Inside Each Movieclip Is An Image And Then A Layer Above It Called Cover_mc?

Apr 16, 2011

I have 4 Movieclips on stage, each called btn1, btn2, btn3 and btn4. Inside each movieclip is an image and then a layer above it called cover_mc.The piece of code i have here, which is located on the main timeline, should be registering a MOUSE_OVER command and then fading out the cover_mc movieclip from within that particular Movieclip im hovering over.

Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;

[code].....

View 3 Replies

ActionScript 3.0 :: Flash Button Inside MovieClip Inside MovieClip Doesn't Dispatch Event

Jan 25, 2012

I have a Button that is inside MovieClip1 which is inside MovieClip2; yet when i click the Button it doesn't dispatch Event.

View 5 Replies

Actionscript 3.0 :: Loading Xml Image Into A Movieclip?

Sep 28, 2009

I am using an xml list to hold some data+image for different items. for each item im trying to display the text/images in a movieclip.So im taking the url thats store in the xml file and creating a url loader to load the url. which works fine. but how do i then load that image into a movie clip.Heres the code:

var imgLoader:URLLoader = new URLLoader();
imgLoader.addEventListener(Event.COMPLETE, insertLogo);
// do a for loop to get the xml data for the right item.

[code]....

View 1 Replies

ActionScript 2.0 :: Loading Image In MovieClip?

Apr 1, 2003

I want to load an image onto a Movie Clip when I press a button. So far, for the button on the stage I have:

[AS]
on (release) {
loadMovie("pics/1.gif", _root.photo);
}
[/AS]

I've created a movie clip on the stage w/ the instance name photo. My images are in the folder pics relative to the flash file. When I run the movie and click on the button, nothing happens.

View 6 Replies

ActionScript 3.0 :: Loading Image In Existing MovieClip?

Nov 27, 2009

I have an existing MovieClip called mc1 on the Stage. That MovieClip has 2 keyframes, the first one has an image in it, and the second one is an empty keyframe.After compiling, I want to load an image (image1) from the library into the the firstkeyframe, and replace the existing image.

I know I need to right click on the image in the library, export it, give it a class name, and I need to assign an url to it which would be 'image1' in this case.I was thinking of this, but I cannot get the url right, and I dont know how to refer to the firstkeyframe after I've loaded it...

var Imagecontainer:Loader = new Loader();
var image:URLRequest = new URLRequest('image1');
Imagecontainer.load(image);
mc1.addChild(Imagecontainer);

View 3 Replies

ActionScript 3.0 :: Scaling A MovieClip After Loading Image Into It?

Apr 23, 2009

I have a doubt regarding scaling a movieclip. I tried this method where I make a movieclip dynamically, add an image to it which I load from my desktop. The image appears fine. But when I scale the movieclip using the mc.scaleX and mc.scaleY properties the mc woudnt budge. There must be some other wat we can accomplish that. Can someone put in some thoughts on it. here's the code..

[Code].....

In the code I have not used the scaling codes since it doesnt work. And when I add the two line code, the image disappears, but the mc is on the stage which is clickable. maybe I should place my mc inside a container?

View 2 Replies

ActionScript 3.0 :: Attach Movieclip To A Image That's Loading From XML File

Nov 22, 2009

how to load photos from a XML file into flash. I have a movieclip (called PhotoMC) that has two layers, bottom layer is a square(is a graphic). Top layer is a blank MovieClip where I would like to place the image loaded from XML. I'm trying to have the movie clip(PhotoMC) load for each jpg in my xml. So basically a movieClip will be attached to the jpeg.

View 1 Replies

Professional :: External Image Loading Into MovieClip On Stage

Oct 18, 2010

I am trying to load an external .swf (actually it is only an image that I published as a swf file, not a complicated movie) but I get errors. I am trying to load the .swf into a movieclip and the movieclip appears on the stage. I have put the code in frame 1 where the image should appear (in the movieclip). The code that I used is below and works fine with a .jpg and when I load it directly on the stage, that is to say, when I put the code in a frame on the stage. Why does it not 'work' right now?

I have added 'parent' in 'parent.event.target.content.y = 200;' in the first frame of the movieclip timeline, to make sure that it will appear on the (main)stage. The error that i get is this one:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at galerie2010_fla::mcBallon1_11/frame1()

This is the code in frame 1 in mcBallon1:
var imageRequest1a:URLRequest = new URLRequest("images/SWFoverig/ballon1_702x368.swf");
var imageLoader1a:Loader = new Loader();
imageLoader1a.load(imageRequest1a);
addChild(imageLoader1a);
imageLoader1a.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete1a);
function onComplete1a(event:Event):void{
parent.event.target.content.y = 200;
parent.event.target.content.x = 205;}

View 2 Replies

ActionScript 2.0 :: Loading Variables In TextBox / URL Of Image Into MovieClip

Dec 21, 2002

I have a textfile with:
1. Some text to be loaded into a textbox
2. an url of an image I want to load into a movieclip
Code:
loadVariables("mytextfile.txt", "_root");
urlpic = _root.urlintext;
loadMovie(urlpic, "_root.pic");
This doesn't work, and neither does: url1 = _root.url1.text;

View 12 Replies

ActionScript 2.0 :: Loading Image Into MovieClip Then Into BitmapData (Renamed)

Nov 6, 2006

I am trying to load an image into a movieclip and then draw the contents of the movieclip to a bitmapData object.

Below is some sample code.
target.jpg_mc.loadMovie(url);
target.createEmptyMovieClip("loader_mc", 100);
target.loader_mc.bmc = target.jpg_mc; // movieclip where to load original image
target.loader_mc.tmc = target.bmp_mc; // movieclip with smoothed image
target.loader_mc.onEnterFrame = function(){
[Code] .....

For some reason it always draws a white box rather than the image. Has anyone ever seen this happen with the bitmapData class?

View 4 Replies

ActionScript 2.0 :: Get A Movieclip To Reposition Itself Prior To Loading An Image?

Jul 12, 2007

using the following code i am trying to get a movieclip to reposition itself prior to loading an image. Then once the new image is loaded - the other movieclip will reposition itself. Currently, the functions are cancelling each other out - b/c the one function is within an onEnterFrame - take a look:

Code:
holderHitMC.onRelease = function() {
holderMask.newY = -854;
if (holderMask._y == -854) {

[Code]...

As you can see - i have a button with an onRelease command telling the movieclip to reposition - then onEnterFrame once the file is fully loaded the movieclip should return. The problem with this is that it does not allow the movieclip to move for the onRelease b/c the onEnterFrame is saying to go to the other position. If i add the delete this.onEnterFrame the movieclip - on future loads will reposition for the onRelease fuction but will not return.

View 6 Replies

ActionScript 2.0 :: Loading Image To Movieclip - Security Settings?

Apr 1, 2008

I'm loading jpg to videoclip and it works on Flash IDE preview, but not in published .swf (IE)(It doesnt load images)How to make it work?I have tried adding

System.security.allowInsecureDomain("*");
System.security.allowDomain("*");

But no difference..*edit: I'm viewing the published swf in network drive, the images would be loaded from intranet http?

View 1 Replies

ActionScript 3.0 :: Loading Image From Array Into Empty Movieclip?

Mar 6, 2011

I'm converting Kirupa tutorial for AS2/XML gallery to a AS3 image gallery that works with AMFPHP.I'm running into a output error:TypeError: Error #1010 After some searching I found out that the script says that there's a undefined propperty in the script below. It should load an image from the Array "Image" in a empty movieclip wich excists on stage called "picture" ["picture"+0] is also used in other parts but then as ["picture"+p]. P=0 with an increment based on button clicks (previous and next)

function firstImage() {
if (this.loaded == this.filesize) {
picture.alpha = 0;
var loader:Loader = new Loader();

[code]....

View 1 Replies

ActionScript 3.0 :: Loading Multiple Image In Single Sprite/MovieClip?

Jul 26, 2009

I am having a killing problem in loading multiple images in single movie clip/sprite using a separate class. Here is the ImageLoader.as class

[Code].....

View 1 Replies

ActionScript 2.0 :: Loading Random Image Into MovieClip (Scale 100 Percent)

Oct 27, 2004

I am trying to load a random image into a movie clip that will scale 100%. Then have the content MC noScale and stay the same. If I insert a picture into the bg movieclip, it scales and shows up no problem. Soon as I try to load a random image into the bg movieClip the picture just does not show up!! But what is even weider, is that I have it set up that if the picture is 100% loaded for another MC to play, which it does! So the picture is there, but it's invisible? And no the picture is not progressive.

Code:
Stage.scaleMode = "noScale";
Stage.align = "LT";
bg.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
[Code] .....

View 1 Replies

IDE :: Loading External Text Into A Dynamic Text Box Inside A Movieclip?

Feb 17, 2010

I have a scrollbar that uses a movieclip-instance name "text" to display dynamic text.On the main timeline I used the following code:

myLoadVars = new LoadVars();
myLoadVars.onLoad = function() {
dynamictextcontent.htmlText = myLoadVars.dynamictextvariable_html;

[code].....

View 1 Replies

AS3 :: Image - Add A Child Inside A Newly Created Instance, Inside Of A Loop?

Feb 2, 2005

I am trying to create a gallery where each thumb is housed inside of it's own movie clip that will have more data, but it keeps failing because it won't let me refer to the newly created instance of the movie clip. Below is what I am trying to do.

var xml:XML;
var xmlReq:URLRequest = new URLRequest("xml.xml");
var xmlLoader:URLLoader = new URLLoader();

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved