Having An Image Download From An Exe Within A Detailed Action Script
Hi,I am working on a project that has most of the action script in place with one minor snag. When the user selects an image from a thumbnail from the bottom of the page, the image and text appear, but when you click to download the file, the action doesn't work.The script in question:on (press) {fscommand ("Exec", "b-CIX-100-with-phone_Mar-07.EXE");}on (release) {this._parent.pictureLoader.loadMovie ("BigImages/b-CIX-100-with-phone_Mar-07.png");this._parent.chsen_movie.chosen.text = "CIX100 with phone — please click here to download image";_root.loadimage = "JPGs-CIX-100-with-phone_Mar-07.jpg";trace (_root.loadimage);}Any guidance would be helpful.k.
Adobe > Flash General Discussion
Posted on: 11/16/2007 04:43:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
3D Object Rotate + Drag Detailed Image (Tutorial?)
Hi,
I want to learn how to create a 360 view of a shoe that you can drag the mouse left and right and the shoe rotates left and right. I would want to use a sequence of photos of the shoe rotating to do this. It's supposed to be easy to do, but I haven't found much of anything online about how to do this.
here is an example: http://www.yofla.com/flash/3d-rotate/examples.php?exampleId=8
The other thing would be dragging a detailed image around in the window.
this is similar, but i want to drag the actual image: http://flashwanted.com/cl/samples/37915/index.html
if you go to this site and click down on a gym shoe image (it'll take a little to navigate there) they have the detail shoe image the way i would like to be able to do it. http://www.adidas.com/campaigns/women/content/stella/
in general does anyone know a good book or video tutorial to learn cool animation effects like this stuff?? even like nike or adidas stuff. most the books out there are really too basic. and i feel like i'm hitting a wall on where to learn this stuff from.
thanks.
best.
andy
Walking A Character.. Detailed Walking.. Very Detailed.. Lol.. Help?
ok, a great question.. i can get a character to move.. i.e. onKeyDown Left move Moviename _x-5 or whatevar aite.. ok, now how can i make that to where it changes the movie too?
Say on keypress right the character turns right, and then walks.. but if the person releases the key then the character stops walking but stays facing right? or up, and down, ect.. Thanxz for any help guys!
P.S. Just like on http://www.goldyard.net
Those exact commands.. Thanxz again guy's!!!!!
-c.k.
DOWNLOAD MP3 Action ?
Hey - I am making a site for a band. I want to make it possible to download MP3 files from the site.
In "normal" HTML you can link to a file and the user get to choose between "download or open" when they click the link- I can´t figure out how to do this in Flash MX. I could mix Flash with Dreamweaver but I want to avoid that.
Any help would be great. Thank you !
From Jesper
Need Detailed Help
I am very new to Flash and have downloaded the Flash MX 2004 Pro version to play with before I decide to buy. I am building a site for my friend's softball team. On the intro page I want a Flash movie of animated flames and a softball coming at the user out of the flames. Once the softball has stopped, then the user can click on it and be taken to the index page. Going through the book ("Sams Teach Yourself Macromedia Flash MX 2004 in 24 Hours"), I cannot seem to figure out how to accomplish this. I have an animated fire.gif and a softball image. Can someone walk me through getting this accomplished? You will have to be very explicit with what needs to be done and in what sequence. Any help would be greatly appreciated. Thanks.
Action To Download An Mp3 - Rather Than Have To Place It In A Zip File
If i want my button to download an mp3 (rather than have it open in quicktime or windows media player) when i click on my button in flash, is there a way to do this? I realise that i can place my mp3 inside a zip and have that download - that i can do - is there any way to dispense with the zip?
Thank you.
Navigation For Detailed Map
HI all
Ive been looking for something like this
http://www.suzuki.dk/module_pages/mo...C-95A1A7D607A7
A way to see a detailed map
Can somebody help where to find a Tutorial / fla
Have a nice day
:-)
More Detailed Hit Test?
I am trying to modify a simple sketchpad application, to make drawn objects draggable. Each object is drawn using the drawing API on a separate movie clip.
For reasons that are not clear to me, each empty movie clip seems to be the entire size of the stage. So if I use hitTest(_xmouse, _ymouse, true), I get an hit no matter where the mouse is. On the other hand, using hitTest with "true" flag tests the bounding box, which is also not what I want.
For instance, the diagonal line:
Code:
_root.createEmptyMovieClip("newitem", 100);
...
newitem.moveTo(0,0);
newitem.lineTo(50,50);
is selected for dragging if I click anywhere in the square with opposite corners (0,0) and (50,50). I would like a hitTest that checks whether I'm actually hitting a pixel with something drawn there.
Since each movie clip has only one color, I thought to test the color at the point (_xmouse, _ymouse), and compare it to the clip's color. However, I can't seem to find a function that returns the color at a given point, either on the stage or within a given movie clip.
Does such a function exist?
Or, any suggestions on another way to do a hit-test only for regions with something actually drawn there?
Detailed Drawing
Had a question. I know their are 1,000 tutorials out there about how to make a drawing effect with Flash. My case is a bit different. I have an Illustrator file that has a stoke that look like a tree (used a brush in Illustrator). The stokes overlap in the top of the tree maybe 150 times, so it look like a scribbling effect. When I import the Illustrator file, it seems to create a fill, instead of the stroke. If it was a stroke I could do the old delete each anchor point frame by frame and reverse them. But this doesn't seem to be the case.
We are trying to replicate a sort of flip book animation of a drawing done in Illustrator. Any ideas?
Detailed HitTest
Hello
I was wondering if theres a way to do a detailed hittest..
Say i have a movie clip which is not Square, or has a bunch of dots in it , and i really wanna check if its overlapping , and not just the movie clip box thingy overlapping..
(having each segment of the big movieclip separate and testing for each one is out of the question)
How would i do that?
Thanks
//VoS
Detailed HitTest
Hello
I was wondering if theres a way to do a detailed hittest..
Say i have a movie clip which is not Square, or has a bunch of dots in it , and i really wanna check if its overlapping , and not just the movie clip box thingy overlapping..
(having each segment of the big movieclip separate and testing for each one is out of the question)
How would i do that?
Thanks
//VoS
More Detailed Breakdown
so when i publish and request a size report i see a pretty detailed breakdown of geometries and code within movieclips... but i find the summary of AS2 classes way too general and not useful at all:
ActionScript Code:
ActionScript Bytes Location
------------------ --------
54873 ActionScript 2.0 Classes
i have probably 30+ classes being used so i'm getting no valuable info with this lump number. short of compiling separate swfs with smaller numbers of classes, is there any way to get a more detailed report?
thanks in advance
pax
jonah
Button Action To Download/ View A File?
hi, on my portfolio i have two cv buttons, one to view it in browser, one to download it (.doc). i guess for it to be viewable i have to put it in a html page some how, should i just copy and paste it or can i embed the actual .doc? if so how? also, what do i need to put on my other butoon to allow the user to download the file??
thx alot
lev
IF Statement Ignored - More Detailed Question...
I can't seem to find my other post, but here's a more detailed explanation of exactly the problem I'm having:
I have a very simple flash program right now. Let me explain exactly what's going on and then I'll explain my problem.
I have two scenes: preloader and Scene 1.
In Preloader (it's not really a preloader, just loading some information for future use), frame 1, I have the following actionscript:
car = new Array();
car[0] = 0;
car[1] = 0;
trace(car[1]);
That's it for that scene. Scene 1 (the second scene) has Frame 1 as completely empty, and Frame 2 with a button on it, and the actionscript:
stop ();
The button on Frame 2 has the following ActionScript code:
on (release) {
temp = 1;
temprandom = Math.random() * 100;
if (car[temp] == 2) {
if (temprandom < 35) {
car[temp] = 3;
trace (temprandom);
}
}
if (car[temp] == 1) {
if (temprandom < 25) {
car[temp] = 2;
trace (temprandom);
} }
if (car[temp] == 0) {
if (temprandom < 10) {
car[temp] = 1;
trace (temprandom);
} }
trace (car[1]);
trace (car[temp]);
gotoAndPlay(1);
}
Essentially, I'm working with car[1]. I'm totally ignoring car[0]. When car[1] == 0, there's a 10% chance it might become equal to 1. When car[1] == 1, there's a 25% chance it might become equal to 2. When car[1] == 2, there's a 35% chance it might become equal to 3.
Yet everytime I run this program, the value instantly jumps from 0 to 1 to 2 to 3, regardless of whether or not temprandom is less than 10 or not.
I put the trace (temprandom); in just to make sure there's not a mistake... temprandom will be equal to 95, yet car[1] will still increment.
I'm at a complete loss as to what's wrong here. I'm assuming it has to be something to do with arrays and If statements, but can't seem to find a way to make this work.
Eventually I'll be working with multiple copies of car[X], so that's why I'm doing an array and going through with car[temp]... as to run it through a for statement later. But I can't move to that stage if I can't get it to work with just one variable now.
Please, gurus out there, help me before I lose my sanity!
Detailed Vector Importing
I have a problem when trying to import some pretty detailed graphics from Illustrator. It comes in all broken and messed up. I am saving the illustrator file as a 5.0 version because that usually works. Does anyone have any advice?
Much appreciated
Looking For Detailed Book On Animation
I'm looking for a book on animation techniques. I'm not interested cartoon or character animation, nor in video. I'm interested in a dedicated look at the type of animation you typically see, say, on high-tech sites. Typically there are a series of scenes with text animation, animation of elements such as a computer network showing network packets or somesuch flowing one place to another. Or just some illustrations that build one o another. One common example is the splash on the home page of www.pingidentity.com.
The trouble with most books is that they try to be comprehensive. So they might devote only one chapter to tweaning, transitions, etc. I'd like to see something advanced that gives you plenty of techniques -- the benefit of someone's experience in creating product demos and the like.
If there are no books, online tutorials would be OK. Thanks.
Mimicking SaveAs Rightmenu Action - FileReference.download() Or PHP
A client asked me why it's not possible to do a "Save as" action
in it's "brand new" "under construction" Flash website.
I used to make a simple php page to download files from a website...
never needed to do it from an swf file but after a few tests...
1) I call an external php
- if I call it in a "_blank" window the popup is probably (often) stopped by some toolbar or limitation in scripts execution, when the popup isn't stopped the download works fine (download starts and it's possible to monitor progression in the downloads_browser_window) but it remains an opened php white page
- if I call it in "_self" the download works but I cannot see the progression of it in the downloads_browser_window
2) I use FileReference Class
- the download works and I'm able to monitor download events from inside the swf file (by FileReference event objects) but... the client say me that he is expecting to see the download progression in the download_browser_window instead of a progression bar inside the swf_webpage where he started the download...
So
How can I
- launch the download of a file from actionscript
AND
- see the progression in the download_browser_window
without asking the user to change his popup settings for the website...
The client is really upset because he wasn't so sure in using Flash
and I pushed him in this direction...
now he is complaining for this "Save As" thing, for Search Engine Related Problems...
Any help is really, really appreciated
thanks
Jo
[MX] Frame-detailed Control Of A FLV Movie?
First off, let me say that I can't design in flash. Period. The reason that I am posting here is to find out if what I want is even possible. If so, then I'm probably going to contract the work out to a developer.
I have a lot of small video clips (2 to 5 seconds each) that will be linked together. The movies are rendered scenes from a 3d modeling program. I want to be able to have the application play certain 'scenes' from the long movie, and then display a jpg image capture of the last frame of that scene (that I have) and make sure that what is written over it is interactive-capable.
For example, let's say the scene in the movie was "Walking to Grandma's House". When you click a 'Go' button, it plays the first 300 frames (001-300) of the loaded FLV file, then switches to the JPG screencap, as if you stopped walking. Using controls to look down, you see a nickel on the ground, so you pick it up by clicking and dropping it into your items area. You then look up, and press 'Go' again, and it plays another 300 frames (Frame 301-600) of the FLV.
Hope that I made this simple enough. If this is possible, could you recommend any technical details that I will need to advertise that I need for this job, like special scripting skills, etc.? Thanks in advance.
Image Download
I am working on a CD-ROM using flash and my client has asked me to put a section to download images from the CD to the user's hard drive. I know this is possible using director, but I can't seem to find any info on doing this using Flash.
I'm using MX 2204 Pro
Scrolling Text From A File... I Need A Clear, Detailed Answer.
Hi. I think my last post got lost in the shuffle, and I had some good help but when I added a new question the help disappeared. Anyway, here's the thing:
I can make a crolling, Dynamic text box. Not a problem. But, since this is for a band website and they want to be able to post news items without ripping the SWF open all the time, I need to load it dynamically. Someone pointed me to the tip on this at macromedia's site, but I couldn't make sense of it and there' no sample file to rip open. Can anyone send me a sample file or just post a really detailed explanation?
Any help is greatly, GREATLY appreciate.
J
The All Time Favourite Error#1010 (detailed Information)
Hi so here is what I'm trying to archive:
It's very simple I'm trying to create a nice imageviewer for my website so that people can take a look at the different details in the images.
For that purpose I have a Movieclip with the Image in it on my stage, a number of buttons and my actionslayer.
Now I want to use Tweener to modify the position of my Movieclip.
Here is the code that resides on the first frame of my actionslayer:
Instancenames:
Arrowup = one of my buttons
Swosh = my movieclip with the image in it
Code:
import caurina.transitions.*;
arrowup.addEventListener (MouseEvent.MOUSE_DOWN , arrowupfun);
function arrowupfun(e: MouseEvent):void
{
Tweener.addTween(swosh, {y:swosh.DisplayObject.y+10,
time:5});
}
Now it is the following part that causes the Problem:
Code:
y:swosh.DisplayObject.y+10,
Whenever I test the Movie with this in there instead of something simple like "x:500," I get the following error when I click the button:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at Imageviewer_fla::MainTimeline/arrowupfun()
So I know that it's that part of the code that causes the system to call for something that is undefined, but since 1010 doesn't really give me a clue on where the heck that stuff is missing I have no Idea where to troubleshoot...
This really annoys me since I wanna finish the site I hope someone here can help me.
If you want further information please say so.
Oh and if anyone is up for some quickhelp via messenger here are my MSN and Skypenames:
MSN: Leonardkoch@hotmail.de
Skype: Goulgag
Thanks in advance looking forward to your answers.
Leonard Koch
Image Gallery Download
I'm using Flash MX to create a CD-based standalone projector. I'm trying to give users the option of printing and downloading images with the click of a button.
I can get the print to work, but I don't have a clue as to how to do the download.
Any Ideas?
Thumbnail To Download Hi Res Image
Please if sombody could tell me the action i need to use to have a user click on a thumbnail image and the get a box to download a hi res of that image to their computer.
Thank You
Daniel
Download Image Button
I dont know what actionscript command to add to my button to enable a jpeg to be downloaded to the users desktop. Is it possible?
Ive found bad examples where the user is directed to an html page where they can right click and save the picture. That just seems ridiculous to me.
Download Image Directory?
Hey All,
Is there anyway to script a flash piece to load all images from a directory at the same root? Has anyone ever used loadmovie maybe on duplicate off the stage to begin loading/preloading images for slide like presentation?
Any ideas/work arounds/techniques here would be great.
cheers
-jub-
Download Image From Flash
Hey All,
I am curious how to go about letting users "Save to System" files from my flash application. Everything I have read so far requires the AIR runtime environment.
Essentially I have a ByteArray which I want to write through a filestream to the users chosen location.
Also I would like to know how to write to a fileserver location instead.
If anyone has any idea about where to start with this I would appreciate it.
Thanks,
Chad.
How To Download Image From An Swf File
I have created a flash application which displays images as in an exibition,I want the view to be able to download the image on display.How do i do this-
I have thought of two ways,
1:to provide a button as "Download" which on click will open a "open /save window" for the user and allow him to do the selected option.
Can anybody suggest a few ways to do this or any better and easy way to do this.
Thank you!
SWF To Download Image Test
I am working on a little project, to test prospective freelancers.
We have several test files which they will retouch, a timer to show them how long they have, and a method to measure when they begin their upload.
the one thing that is problematic is a solid method to start the timer.
I dont want to penalize someone with a slow download speed.
I was thinking that we could make an SWF for each test, which the loads each image. When it has loaded, the instructions display and the User could then save the file to their local drive to open it into photoshop.
I would really love some help in figuring out if this tentative idea (SWF to save image to local drive after complte download) would even work,
and then some help in how to do that.
Thanks !
Download Image In Flash
Hi there,
I have a flash photo gallery, but I would like an option to allow the user to right click on the flash image and be able to save/download the image.
Is this possible?
Thanks!
Server Crashing 2-3 Times A Week Detailed Backtrace Included
This error keeps crashing the fms server (running under linux fedora core 5):
*** glibc detected *** /usr/local/macromedia/fms/fmscore: double free or corruption (!
prev): 0x09ccbfe8 ***
======= Backtrace: =========
/lib/libc.so.6[0x47a6ba68]
/lib/libc.so.6(__libc_free+0x78)[0x47a6ef6f]
/usr/lib/libstdc++.so.5(_ZdlPv+0x23)[0x742fb3]
/usr/lib/libstdc++.so.5(_ZdaPv+0x1f)[0x74300f]
/usr/local/macromedia/fms/fmscore(_ZN10TCSegmentsD0Ev+0x89)[0x82e6035]
/usr/local/macromedia/fms/fmscore(_ZN10TCSegments8_releaseEv+0x3e5)[0x82e57ed]
/usr/local/macromedia/fms/fmscore(_ZN6TCPoolI10TCSegmentsE4Pool7releaseEPS0_mmm+0x690)[0x82e5e8c]
/usr/local/macromedia/fms/fmscore(_ZN10TCSegments8_releaseEv+0xb3)[0x82e54bb]
/usr/local/macromedia/fms/fmscore(_ZN5TCPtrI10TCSegmentsE7releaseEv+0x1c)[0x813f048]
/usr/local/macromedia/fms/fmscore(_ZN9TCAsyncIO21handleWriteCompletionEP7TCIOReqm+0x12b)[0x8224773]
/usr/local/macromedia/fms/fmscore(_ZN19AsyncRequestHandler3runEv+0x1c4)[0x8227464]
/usr/local/macromedia/fms/fmscore(_ZN12TCThreadPool23__ThreadStaticPoolEntryEPv+0xed)[0x830f945]
/usr/local/macromedia/fms/fmscore(_Z15__TCThreadEntryPv+0x98)[0x8310c20]
/lib/libpthread.so.0[0x47d20433]
/lib/libc.so.6(__clone+0x5e)[0x47ad0a1e]
======= Memory map: ========
If any adobe/fms developer is reading this forum, please consider this as a critical bug.
Thanks,
Dario Andrade
Image Download From A Projector File
I'm creating a dvd for a client that will have a Flash projector file. I want the user to be able to download an image to their desktop on (press) of a button.
Is this possible?
thanks in advance.
Save/download Image Button
is there any way to create a button in a flash movie to copy/save/download an image. (jpg)
since the rightclick/save as- is not available when viewing a flash movie.
I don't want to open an html page. ( and then give rightclick option)
also would like to avoid link to zip file in case someone doesn't have a decompressor program.
any other ideas??
thanks
Creating Path In .AS To Download Hi-res Image
Hello everyone, your help is greatly appreciated!
Summary: How do I create a new path to a folder in an actionscript file?
URL:http://www.linkshare.org/flashgallery/
external AS file:http://www.linkshare.org/flashgallery/cbgallery.as
NOTE: actionscript file is external to SWF file, not sure if that matters or not in coding.
Current link:http://www.linkshare.org/flashgaller...0aeroplane.jpg
Future link:http://www.linkshare.org/flashgaller...0aeroplane.psd
Problem: A photo is displayed in a Flash photo gallery and if you press the 'download image' button, it links to the JPG directly for viewing.
Goal: I want a link to a Hi-Res image for printing, so the link would not be same as the image viewed in the Flash gallery. The actionscript code would link to a 300DPI Hi-Res image located in a "hi-res" folder.
=======
I'm no AS expert, but I think the relevant code is:
var imageNameSplit:Array=String(thumbLoader.content["gal"+whichPic].myImage).split("/");
imagePath = imageNameSplit.join("/");
if(enableViewImageBtn){
downloadImageBtn.onRelease=function(){
getURL(imagePath,"_blank");
trace("word: "+imagePath);
}
Creating Path In .AS To Download Hi-res Image
Hello everyone, your help is greatly appreciated!
Summary: How do I create a new path to a folder in an actionscript file?
URL:http://www.linkshare.org/flashgallery/
external AS file:http://www.linkshare.org/flashgallery/cbgallery.as
NOTE: actionscript file is external to SWF file, not sure if that matters or not in coding.
Current link:http://www.linkshare.org/flashgaller...0aeroplane.jpg
Future link:http://www.linkshare.org/flashgaller...0aeroplane.psd
Problem: A photo is displayed in a Flash photo gallery and if you press the 'download image' button, it links to the JPG directly for viewing.
Goal: I want a link to a Hi-Res image for printing, so the link would not be same as the image viewed in the Flash gallery. The actionscript code would link to a 300DPI Hi-Res image located in a "hi-res" folder.
=======
I'm no AS expert, but I think the relevant code is:
var imageNameSplit:Array=String(thumbLoader.content["gal"+whichPic].myImage).split("/");
imagePath = imageNameSplit.join("/");
if(enableViewImageBtn){
downloadImageBtn.onRelease=function(){
getURL(imagePath,"_blank");
trace("word: "+imagePath);
}
Script To Detect Image Download
Hi,
I need to be able to detect if an external dynamic image that is opened on the click of a button into a movie has downloaded or not. Is there a simple way to do this? Does anybody have the actionscript for this?
Please help.
JimFl
How Do I Offer A Download Capability Of An Image?
Last edited by nu2it : 2002-03-26 at 12:49.
I want to offer the download of specific jpegs in my flash document to a user through the click of a button. I want to put this .swf file onto a cd with an autoluanch. From there users would need to be able to extract a jpg without having to connect to a browser, the internet. external folder on the cd, etc. Is that possible? How do i do this in flash? Is this even possible?
Somebody Help!
-nu2it
External Jpg Slideshow Download Image Randomly
Hi, I'm a flash newbie.
I downloaded a movie for an external jpg slideshow right here:
http://www.flashkit.com/movies/Scrip...8470/index.php
I was wondering if anyone could help me on changing the code, so the images could show on a random order.
Thanks in advance.
How Do I Create A Download(not View) Image Link In AS3?
I created a photo gallery using the tilelist component, and would like to have a button that will automatically download the image. Since you cant just right click and choose download to disk, is another way to do this?
Creating Path Or Link To Folder In .AS To Download Hi-res Image
Hello everyone, your help is greatly appreciated!
Summary: How do I create a new path to a folder in an actionscript file?
URL:http://www.linkshare.org/flashgallery/
external AS file:http://www.linkshare.org/flashgallery/cbgallery.as
NOTE: actionscript file is external to SWF file, not sure if that matters or not in coding.
Current link:http://www.linkshare.org/flashgaller...0aeroplane.jpg
Future link:http://www.linkshare.org/flashgaller...0aeroplane.psd
Problem: A photo is displayed in a Flash photo gallery and if you press the 'download image' button, it links to the JPG directly for viewing.
Goal: I want a link to a Hi-Res image for printing, so the link would not be same as the image viewed in the Flash gallery. The actionscript code would link to a 300DPI Hi-Res image located in a "hi-res" folder.
=======
I'm no AS expert, but I think the relevant code is:
var imageNameSplit:Array=String(thumbLoader.content["gal"+whichPic].myImage).split("/");
imagePath = imageNameSplit.join("/");
if(enableViewImageBtn){
downloadImageBtn.onRelease=function(){
getURL(imagePath,"_blank");
trace("word: "+imagePath);
}
Audio Action W/ An Image?
hey. well, i am kind of new to flash, but i have seen some a couple of other people do tihs, and i wanted to do it myself.
i have seen sig's, like on forums, that when you put your mouse over it, it plays music.. like a whole song. and that is what im trying to do.
now, i am good with fireworks and photoshop, so ive made a good image, and i have the song i want to use... but other than that, i have no sweet clue what to do. i have tried a few tutorials and also looked in the "how do i..." section and the help section of flash, but i cant figure out how to do it...
could someone please help me out? it would be much appreciated. thanks.
How To Hue An Image With Action Script
I have imported an image in flash. With in PS i can change hue to get an effects of changing colours. In flash i just try with advanced effect on a object, but this isnt what i want.
Is it possible to do that actionscript is changeing hue of an object. I would do thiis with setinterval, to change frequently priperies of object.
Other way is importing cca: 30 images prepared in PS but it would be hue swf file.
thx for help.
d.
Image Movement Thru Action Script
i would like to move series of images or one long image across or veritcally in the screen no by regualr animation but thru action scripting
can u help me in this
Action Script Center Image
Sorry If this seems silly but I am still learning.
I ahve created an interface that will act as a standalone app. It dynamically loads images into a image holder movieclip.
I have read how to center the clip using stage and clip width, but when I load my first clip I get height and width of 0, after i click a button to change the image I get the dimensions but not at first.
I have uploaded the file for you folks to look at.
Thanks for the help.
Dumps
Action Script - Load Image
I am trying to load an image into flash via flashvars and place it on the bottom layer.
I have a movie with 5 layers in it. The bottom most (layer 1) is the background image of the script, and layers 2-5 have animation occuring on them. Essentially, I just want the image loaded via the flashvars to load below the animation stuff.
I am successfully loading the image into the movie, but it is appearing on top of everything else. (Flash CS3). Here is my code:
Code:
var imgUrl:String = "pointing to my picture on development server";
if (_level0.imgURL != undefined) {
// If image was specified, overwrite default value.
imgUrl = _level0.imgURL;
}
this.createEmptyMovieClip("img_mc", 10);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip):Void {
target_mc._x = (Stage.width - target_mc._width) / 2;
target_mc._y = (Stage.height - target_mc._height) / 2;
}
mclListener.onLoadError = function(target_mc:MovieClip):Void {
//this shouldn't be used, but for testing purposes
//target_mc.createTextField("error_txt", 1, 0, 0, 100, 20);
//target_mc.error_txt.autoSize = "left";
//target_mc.error_txt.text = "Error downloading specified image;
" + target_mc._url;
}
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.addListener(mclListener);
myMCL.loadClip(imgUrl, img_mc);
stop();
I found the code on Adobe's site... any suggestions?
|