I’ve Joined Bluehost I am very excited to share that I’m starting a new role with Bluehost! I’m truly excited to join the small team of sponsored WordPress experts to actively contribute to the open-source project. My responsibilities entail working on internal initiatives helping customers succeed in their efforts and contributing to WordPress core. I’ll […]
I’ve set aside some time to take some online courses at FrontendMasters to deepen my understanding of various engineering principles as a personal continuing education goal. While taking courses I focus by taking notes, and figured I may as well share them with the world, so welcome to the Learning Series! The first course is […]
Earlier this year I was able to use my some personal reinvestment time at work to study up on react. I took an online training course (Wes Bos anyone?) I enjoyed the time to focus on learning the material presented. I am also aware that unless I use the information to build something on my […]
At 10up we had an internal blog series entitled A Day in The Life to help us get to know each other better and share a bit about how we work on a day to day. I wanted to share mine here as well! It seems a day in my life is similar to many […]
As I updated a WordPress site today (the new 5.0 version just shipped) I was proud to see my name in the list of core contributors! I’m listed as a core contributor in versions 4.9 as well as 5.0! I didn’t get around to sharing the news last year, but seeing my name in the credits […]
I’m happy to be contributing to the WordPress community as a speaker at WordCamp Atlanta 2018. I submitted a few topics and have been selected to speak about development process for teams. Here’s the short description: Overview of some processes used at an agency level. Version control, code standards, database migrations, environment aware config files […]
7 thoughts on “Tutorial to Create a Responsive Image Scroller in ActionScript 3.0”
hi. i am going to copy/paste the post i posted on flashtuts, maybe you can help me:
very nice tut, very well explained. i do have one question. let’s say i already have created a ’scroller’ which has a nice look, and i’ve already placed some containers for thumbnails in the scroller. what would be the simpliest code to load pictures from xml into those specific containers? (everything else, including movement is done separately)
i will start with this:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
var xmlPath:String = “pictures_xml.xml”;
this part is enough for loading the xml, correct? (let’s say that the pictures are small enough so i will not need the complete event listener.)
what i need now is to put the infos from xml into my scroller and make so that when i press one image i got the big one loaded into a different container. and here i got stucked.
can you, please, help me? you can name however you want the containers and the scroller.
thanks you very much,
Hii all, I m going to perform a Drag and Drop intractivity using ActionScript 3.0.
I m going to perform drag n drop of images which are loading into a movieclip and then i m trying to apply the drag n drop logic but i m facing a trouble as loader class is used in loading external images and startDrag() and stopDrag() method cannot be applied on loader type object it should either be applied on a movieclip object or on Sprite type object. Here is my source code that i m working on. Please help me as soon as possible :
public class dnd extends MovieClip
public var startX:Number;
public var startY:Number;
public var xmlData:XML
public var tf:TextField
public var loader1:Loader = new Loader()
public var loader2:Loader = new Loader()
public var loader3:Loader = new Loader()
private var url1:String = “image1.png”
private var url2:String = “image2.png”
private var url3:String = “image3.png”
public var placeHolder_mc1:MovieClip = new MovieClip;
public var placeHolder_mc2:MovieClip = new MovieClip;
public var placeHolder_mc3:MovieClip = new MovieClip;
public var target_img1:MovieClip
public var target_img2:MovieClip
public var target_img3:MovieClip
public var aSprite:Sprite = new Sprite();
public var aSprite2:Sprite = new Sprite();
public var aSprite3:Sprite = new MovieClip();
public function dnd():void
var xml:URLLoader = new URLLoader();
public function callXML(e:Event):void
var loader:Loader = new Loader()
xmlData = new XML(e.target.data);
var imgNode:XMLList = xmlData.images.img.(@id == “0”);
trace(“IMG 1::” + imgNode);
var request1:URLRequest = new URLRequest(imgNode);
/*xmlData = new XML(e.target.data);
var imgNode1:XMLList = xmlData.images.img.(@id == “0”);
var imgNode2:XMLList = xmlData.images.img.(@id == “1”);
var imgNode3:XMLList = xmlData.images.img.(@id == “2”);
var request1:URLRequest = new URLRequest(imgNode1)
var request2:URLRequest = new URLRequest(imgNode2)
var request3:URLRequest = new URLRequest(imgNode3)
var tempClip:MovieClip = new MovieClip();
loader1.x = 50
loader2.x = 150
loader3.x = 250
placeHolder_mc1 = loader1.content as MovieClip;
placeHolder_mc2 = loader2.content as MovieClip;
placeHolder_mc3 = loader3.content as MovieClip;
public function onComplete(e:Event):void
//var bmp:BitmapData = BitmapData(e.target.content)
//trace(“BMP::” + bmp);
var bitmap:Bitmap=e.target.loader.content as Bitmap;
public function pickUp(event:MouseEvent):void
trace(“hit …?” + target_placeHolder1_mc)
reply_txt.text = “”;*/
//trace(“tempClip created type ::” + event.target);
startX = event.target.x;
startY = event.target.y;
public function dropIt(event:MouseEvent):void
var myTargetName:String = “target” + event.target.name;
//trace(“myTargetName ::” + myTargetName);
var myTarget:DisplayObject = getChildByName(myTargetName);
trace(“mera Target ::” + myTarget);
if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget)
event.target.buttonMode = false;
event.target.x = myTarget.x;
event.target.y = myTarget.y;
event.target.x = startX;
event.target.y = startY;
You solved it already basically, just put the loader into a container movieclip and then you’ll be able to apply the drag and drop logic to them. That or you can re-parent the contents of the loader object to any display object on loadcomplete and it will rid you of the loader object altogether.
The tutorial and the source code is not available in the link you gave. pls check it. infact there is nothing showing if i type flash.tutsplus.com
It’s actually changed to active.tutsplus.com – funny they dont redirect or anything. Thanks for finding it, I’ll update the link.
This is very useful.
I just had one problem, while trying it.
What if the images I have has different “width”, and I don’t want it to be in the “box” (say in here 140), and I just want the space between the images is the “padding”.
I hope you can help.
How can I make this into a vertical slider?
Comments are closed.