Copy link to clipboard
Copied
New to Animate CC. Have been using Flash CS6 with this project for years with no issues because I was using the Normal Mode for creating actionscript. I have provided a graphic of the project below. I am using the Scrollpane Component at the bottom of the stage with a MovieClip containing buttons. When a specific button is selected it loads an external jpg at the stop on the stage. Each button within the MovieClip loads its own external jpg image. Any help would be greatly appreciated. Thanks and let me know if you need additional info.
1 Correct answer
the same timeline (the main one) that applies addChild to your loader.
you can just edit the imageA and the for-loop's end.
there are lot's books and online resources for as3. senocular was my personal favorite resoure when learning as3.
Copy link to clipboard
Copied
what's your question?
if it's how to encode what you described, what code worked with cs6 now fails?
Copy link to clipboard
Copied
Thank you for the quick response.
I am using the following code on a button located inside the MovieClip that is located inside the Scrollpane Component to load an external jpg file:
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.MouseEvent;
var img1Request:URLRequest = new URLRequest("me.jpg");
var img1Loader:Loader = new Loader();
btn1.addEventListener(MouseEvent.CLICK, clickF);
function clickF(event:MouseEvent):void{
img1Loader.load(img1Request);
1;addChild(img1Loader);
}
I want the jpg to load at the top center of the stage but instead it is loading inside the Scrollpane Component. What code do I need to add to make this happen?
Copy link to clipboard
Copied
that code's probably on the timeline of a movieclip that's in the scrollpane but i can't tell from what you posted.
you can try this.parent.addChild() and this.parent.parent.addChild() but better would be to put all your code on the main timeline and use something like,
yourmovieclip.btn1.addListener...
Copy link to clipboard
Copied
No luck with the previous information but that could certainly be my lack of experience with AS3. Is there away for me to attach the FLA file and hopefully that would assist you in determining my error/s.
Thank you,
John
Copy link to clipboard
Copied
no. you would need to upload elsewhere and post a link.
Copy link to clipboard
Copied
OK please download the files and see if this will help.
Copy link to clipboard
Copied
all the code's on the main timeline: http://www.kglad.com/Files/forums/scrollpane.fla
Copy link to clipboard
Copied
A few closing questions:
Where would I place the code in the script to position the jpg in a specific x / y location ?
Do I use the same script for each button or simply add the name of the new jpg where you have currently placed var imageA:Array = ['placeholder.jpg','dog.swf','placeholder.jpg'] Do all the buttons need instance names?
Is there a resource that you recommend for beginners to learn AS3 from the ground up?
Thank you again for your patience.
John
Copy link to clipboard
Copied
the same timeline (the main one) that applies addChild to your loader.
you can just edit the imageA and the for-loop's end.
there are lot's books and online resources for as3. senocular was my personal favorite resoure when learning as3.

