ActionScript 2.0 :: LoadMovie With An Image Using A String?
Jun 24, 2004What I am trying to do is simply load the images location using a string.Here is my Code.
Code:
//Load Images
image1 = "image.jpeg"
[code].....
What I am trying to do is simply load the images location using a string.Here is my Code.
Code:
//Load Images
image1 = "image.jpeg"
[code].....
I'm loading a .png image with loadMovie() and I need to center the image (for later dragging). I know flash has some issues with loading stuff, but I really need to get the movieclip's width. If someone knows how to get over this and get the movieclip's width
This is a part of a more complex app, so that's why I won't paste any code.
I've been given a bit of a dog to work on. I'm upgrading a flash presentation that runs via an xml feed. I've added several dynamic flash graph generators external swfs through this data feed but can't seem to pass a query string to the flash presentation via this xml feed. This query string provides an alternate XML datasource for the graph generator.s
I would really like to be able to pass this query string as the current flash graph generators are running off a hardcoded xml filename and I would like to offer some flexibility. I've investigated further and the main presentation loads these extra "slides" with the loadMovie AS which should accept query strings but NOT locally. Is there a workaround to make loadMovie work with query strings locally? I can't run the presenation on a server!!
For example. This XML works locally with the flash presentation;
<slide>
<name>Chart 1</name>
<bullet>chart01.swf</bullet>
</slide>
[Code].....
I have a very general requirement that seemed very simple: Step 1: Load a new external JPEG image into a MC with a string var encoding a string caption in the URL link (VALUE="../fadeTest.swf?someTextVar=TestCaption") within the EMBED / OBJECT sections. I know how to do this and it semed to work fine. STEP2: When the JPEG is loaded I would like the substituted Text to Fade In over the JPEG. The JPEG should also fade in before the Text. The fade rate should be programmable.
[Code]....
I have this for loop where I am circling through an array. I have swf's for each of the numbers like dropTarget_1.swf, etc. For whatever reason I can't seen to get this loaded into my holder.
When I hard code it then it works.
[Code]....
I'm trying to load an image and center it within a movie clip already on the stage.
function loadImage(){ image_mc.loadMovie("fullImage/"+imageNum+".jpg"); image_mc._x= Stage.width/2 - image_mc._width; image_mc._y= Stage.height/2 - image_mc._width;}
I know it's something simple and there are forums dedicated to this topic but I can't seem to view the code examples that the helpers are using.
Ok I have so many images for every html page. So what I want to do, instead of typing
pic.loadMovie("image1.jpg","_level2");
pic.loadMovie("image2.jpg","_level2");
I just want to call a variable like
PHP Code:
pic.loadMovie("loadImage","_level2");
Is it possible so that in HTML, ill just replace loadIMage with the real image1.jpg???
I am using loadMovie to load an image that a user has uploaded. If I have the loadMovie target as a movie clip of size 300x300 and the user loads an image of size 600x600 it does not restrict and scale that image down to fit within the 300x300 box.
Is there anyway to restrict this? Like setting the properties of the uploaded image to fit within the movieclip?
Another issue is that I am using the following code to edit the size of the preview pane (according to a users input):
ActionScript Code:
setProperty(_root.dimension_preview, _width, Number(_global.dimension_width));
setProperty(_root.dimension_preview, _height, Number(_global.dimension_height));
Now when I load an image into this it actually magnifies it by the amount the user entered, is there anyway to prevent it doing this?
If it is easier, I can upload the bits and pieces.
I have a movie clip called "play_btn". The timeline has 2 labels, "paused" & "playing" ... paused contains a movie clip called "playButton" and playing contains a movie clip called "pauseButton". playButton & pauseButton contain images of a pause button and a play button.I am trying to replace the playButton image using:
loadMovie("play.png", play_btn.playButton);
This works when the swf is first loaded but then if I do:
playBTN.gotoAndStop("paused");
playBTN.gotoAndStop("playing");
The original play image is back.Why, surely loadMovie should be overwriting the original image?
I'm creating a DVD with an image gallery, everything local. But the thing is my loaded images appears within flash, and not outside when I execute the swf. The path of the image is inside an array (from an xml file). If I write the path of my trace(array[x][x]), the image outside flash is shown. But when I write:
loadMovie(array[x][x].toString()) or loadMovie(array[x][x])
It doesn't...
I did a trace of array[x][x] and it shows me the exact path to the image..
Code:
_root.obra_mc.containerImg_mc.loadMovie("images/Patrimonio/Ceramica/"+(obras[0][1]).toString());
This is probably a beaten subject but even after reading many post a couldn't understand how to go about it.After doing the following:
PHP Code:
this.crateEmptyMovieClip("myMC",this.getNextHighestDepth());myMC.loadMovie("image.jpg");
-would it be possible to set the _x and _y of image.jpg relative to myMC?You see moving myMC and then loading the picture into it will not me because myMC is to be scaled and manipulated, so its axis must be in the center of the loaded image.
Does anyone know how this is made ? "LoadMovie Image Transition Effect"[URL]
View 1 RepliesI've got an image being changed based on a variable, and although the variable part and the actual image change is correct, the new image is coming up to the right and down from where the holder image was.
View 6 Repliesi am trying to write an image gallery using the loadMovie comand, loading jpegs into a blank movie clip the thing is, all the tutorials seem based around issuing the loadMovie command as you press a button to actually view that particular picture what I am trying to achieve is to have maybe the 1st and 2nd image of the gallery included in the flash movie and these load up and show instantly but whilst the viewer is looking at these the swf is busy preloading all the other images in the background. The idea being that images are loaded faster than the navigation that takes place so when the user clicks on the 3rd image it is already loaded and displays instantly and so on and so forth question is, how do i achieve this ? Do i still use loadMovie but have one script at the 1st frame that loads say all 20 images each into a different empty movie clip ?
View 7 RepliesI use attachMovie() to create a new instance of a movieclip, then I use loadMovie() to load an external PNG image into the new movieclip. That is working fine.
I want to be able to detect when the image has finished loading into the movie clip container. I need to detect this because I want to check the image width and height.
If I check the width and height right after I call loadMovie() it is returning the default placeholder size, instead of the new loaded image size. It obviously has not finished loading when I check it there.
I use attachMovie() to create a new instance of a movieclip, then I use loadMovie() to load an external PNG image into the new movieclip. That is working fine.I want to be able to detect when the image has finished loading into the movie clip container. I need to detect this because I want to check the image width and height.If I check the width and height right after I call loadMovie() it is returning the default placeholder size, instead of the new loaded image size. It obviously has not finished loading when I check it there.I am using ActionScript 2.0 but I can use 3.0.
View 1 RepliesI use attachMovie() to create a new instance of a movieclip, then I use loadMovie() to load an external PNG image into the new movieclip. That is working fine.
I want to be able to detect when the image has finished loading into the movie clip container. I need to detect this because I want to check the image width and height.
If I check the width and height right after I call loadMovie() it is returning the default placeholder size, instead of the new loaded image size. It obviously has not finished loading when I check it there.
Description: HTML page containing MC1 and MC2. MC1 has container MC-C inside and MC2 has button with AS ... loadMovie ("MC3.swf", _root.MC1.MC-C") Problem: when I hit the button nothing happens When I assigned this script to a button inside MC1 (excludeing "MC1." from target value) than it works. Would anyone know how should my target value look like to achieve desired load into container within MC1?? conditions: (MCs 1,2,3 are in same folder, with correct instance names, have tryed few variations but no success)
Q2: Kirupa's Image Pan - is there any way how to integrate whole thing inside another MC without messing it up like me?? Cause I have noticed that it is fixed to "stage.width" and stage of the MC I wanted to plece it is a bit different.
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.
View 2 RepliesCode:
function f_choosePhoto(photoNum)
{
var photos:Array = ["photo0","photo1","photo2"];
[Code].....
I've cobbled the AS together from a couple of seperate tutorials, and if I replace "new this[path](560, 380);" with "new photo1(560, 380);" it works.
Flash will be receiving a string from the web, either Javascript or query string from the URL(which I'm comfortable with). GOAL: Use that string as a byte array and convert it to bitmap data and display on the screen.
MY PERCEPTION: Use ByteArray and readBytes (I've worked with neither before) to parse the string. Then convert that into Bitmap Data and draw the bitmap on the stage.
i'm trying to modify a image, which is casted from a String:[code]In the inactiveElements Array are a bunch of ImageIds (way_0, way_1,..) and i'm trying to set the alpha-value of each Image.[code]with the trace i got the right String of ImageId but the cast to Image fails.[code]
View 1 RepliesI'm loading images from an XML file and I know what the image name is, however this is in a string variable. How can I get the dimensions of the image from this?
View 1 Replies*solved using htmlText with a textField* quick question hoping someone may have an idea on how to achieve this. I have this variable var userPicLoc:String = [URL] I would like to display this using AS3 in a movieclip used as a user pic when a user logs in. I do not want to load an actual image, but want to use the actual URL as the source for what is displayed. In Flex, you are able to create a Label and make its Source a variable containing a URL String like the one above. It looks something like this:
[Code]...
Flash will be receiving a string from the web, either Javascript or query string from the URL(which I'm comfortable with). GOAL: Use that string as a byte array and convert it to bitmap data and display on the screen.MY PERCEPTION: Use ByteArray and readBytes (I've worked with neither before) to parse the string. Then convert that into Bitmap Data and draw the bitmap on the stage.
View 4 RepliesI have a nested array that contains an image and a string like this;
[{image:"images/image1", text:"one",}, {image:"images/image2", text:"two",},
Is there a way that I can have a sound (mp3) in each part as well?
I have hundreds of images that need to play a unique sound when clicked. In order to simplify the building of this flash file I need to streamline it in a way that will allow me to change only one word. Below is some example code.
import flash.events.MouseEvent;
stop()
var word:String = "family"
[code].......
I try to embed images in a mx:tree:
<mx:Tree labelField="name" id="tree"
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')">
</mx:Tree>
This works fine, but I will embed the images with a String variable.
[Code]...
I'd like to dynamically load a image into my script. Ie/ myMovie.swf?image=myimage.jpg If no image gets passed - the script should use the default.jpg instead and load normally. This is what I've tried so far....
var CoverName = stage.loaderInfo.parameters["CoverName"];
if (CoverName == null) {
CoverName = "images/default.png";
}
The solution should be straight forward but I cannot find it, my problem it's that I'm reading a xml, and one of the properties inside the xml it's a Bitmap path(string), when I`m reading this xml I would like to convert this string to a Bitmap Obj so I can use through my MXMLs.
View 4 Replies