Groups | Blog | Home
all groups > flash actionscript > may 2005 >

flash actionscript : Beginner Help


LucianF
5/1/2005 12:00:00 AM
I am a beginner working on a personal site that displays some of my artwork.
Currently I use different scenes to display the images by clicking on a smaller
thumbnail button, but this method is rapidly becoming confusing and time
consuming. How can I load a .jpg image that I have converted to a graphic
symbol/movieclip (located in the library) to a specific location on the stage
on release of a button? I would appreciate any help on this and the more
discriptive the better.
kglad
5/1/2005 12:00:00 AM
once you've converted or created a movieclip from your jpg, you can use
attachMovie() to bring the movieclip from the library to the stage. you need
to give your movieclip a linkage ID to use attachMovie(): right click on your
movieclip in the library, left click on linkage, tick export for actionscript,
type a suitable identifier name (or linkage ID) and click ok. you can then use:

yourBtn.onPress=function(){
_root.attachMovie("yourLinkID","picName",1);
_root.picName._x=100; // use suitable parameters for your purposes.
_root.picName._y=33;
}
LucianF
5/1/2005 12:00:00 AM
kglad
5/1/2005 12:00:00 AM
LucianF
5/1/2005 12:00:00 AM
I tried it but kept getting an error message in the script. This is what i've
got:

button name: thumb1
linkageID: Limage
movieclip name: test1

thumb1.onPress=function(){
_root.attachMovie("Limage","test1",1);
_root.test1_x=100;
_root.test1._y=33;
}

The error I get reads:
on handler
thumb1.onPress=function(){

thanks.

kglad
5/1/2005 12:00:00 AM
LucianF
5/1/2005 12:00:00 AM
kglad
5/2/2005 12:00:00 AM
AddThis Social Bookmark Button