How do I know what thumb is click and store this valuse for later use

Hi guys I have build an here's my code and xml driven image gallery

package com.elements
{
import flash.display.MovieClip;
import the left arrow;
import the right arrow;
import flash.display.Sprite;
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
import flash.display.Loader;
to import flash.events.ProgressEvent;
import flash.events.IOErrorEvent;
import com.elements.PreloaderObject;
import com.greensock.TweenMax;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
Import 12345678910111213import;

SerializableAttribute public class Scrollercontainer extends MovieClip
{
private var int index;
private var padding: Number = 20;
private var leftArrow:LeftArrow;
private var rightArrow:RightArrow;
private var scrollerBg:Sprite;
private var scrollerMask:Sprite;
private var xmlPath:String = "xml/scroller.xml.
private var xmlLoader:URLLoader;
private var preloader: PreloaderObject;
private var indexTracker:Array;
public static var bgImage:Array;
public static var thumbImage:Array;
public static var labelArray:Array;
private var xmlData:XML;
private var vx:Number;
public void Scrollercontainer()
{
addEventListener (Event.ADDED_TO_STAGE, onAddedtoStageHandeler, false, 0, true);
this.addEventListener (MouseEvent.MOUSE_OVER, scrollThumbNail);
}
private void onAddedtoStageHandeler(evt:Event):void
{
scrollerBg = new Sprite();
scrollerBg.graphics.beginFill (0 x 000000, 1);
scrollerBg.graphics.drawRect (0,0,865,78);
scrollerBg.graphics.endFill ();
addChild (scrollerBg);
scrollerBg.x = 28;
scrollerBg.y = 13;
scrollerMask = new Sprite();
scrollerMask.graphics.beginFill (0 x 000000, 1);
scrollerMask.graphics.drawRect (0,0,865,78);
scrollerMask.graphics.endFill ();
addChild (scrollerMask);
scrollerMask.x = 28;
scrollerMask.y = 13;
scrollerBg.mask = scrollerMask;
left arrow = new LeftArrow();
leftArrow.x = 14;
leftArrow.y = 44;
leftArrow.buttonMode = true;
addChild (leftArrow);
right arrow = new RightArrow();
rightArrow.x = 901;
rightArrow.y = 44;
rightArrow.buttonMode = true;
addChild (rightArrow);
lodXMLinit();
}
private function lodXMLinit (): void
{
bgImage = new Array();
thumbImage = new Array();
labelArray = new Array();
xmlLoader = new URLLoader();
xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
xmlLoader.load (new URLRequest (xmlPath));
Preloader = new PreloaderObject();
preloader.buildPreloader ();
}
private void xmlLoaded(evt:Event):void
{
xmlData = new XML (evt.target.data);
var xmlList:XMLList = xmlData.slide;
var point: XML;
trace (xmlList.ToXmlString ());
for each (xmlList)
{
bgImage.push (item.image);
thumbImage.push (item.thumbImage);
labelArray.push (item.label);
}
trace(thumbImage[1]);
buildThumbScroller();
}
private function buildThumbScroller (): void
{
indexTracker = new Array();
for (var i: int = 0; i < thumbImage.length; i ++)
{
var thumbBackground:MovieClip = new MovieClip();
var thumbImgeBackground:Sprite = new Sprite();
thumbImgeBackground.graphics.beginFill(0xffffff,1);
thumbImgeBackground.graphics.drawRect (0,0,100,78);
thumbImgeBackground.graphics.endFill ();
thumbBackground.addChild (thumbImgeBackground);
thumbBackground.x = (100 + padding) * i;
thumbBackground.src = thumbImage [i];
thumbBackground.buttonMode = true;
var preloader: PreloaderObject = new PreloaderObject();
Preloader.Name = String (i);
preloader.buildPreloader ();
var imageContainer:Sprite = new Sprite();
var thldr:Loader = new Loader();
thldr.contentLoaderInfo.addEventListener (Event.OPEN, pairs loadStarted);
thldr.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);
thldr.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, showProgress);
thldr.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, onError);
thldr. Load (new URLRequest (thumbBackground.src));
imageContainer.addChild (thldr);
thumbBackground.addChild (imageContainer);
thumbBackground.alpha = 0;
thumbBackground.addEventListener (MouseEvent.CLICK, showBigImage);
indexTracker.push (thumbBackground);
scrollerBg.addChild (thumbBackground);
}
for (var j: int = 0; j < indexTracker.length; j ++)
{
indexTracker [j] .buttonMode = true;
.indexs indexTracker [j] = j;
indexTracker [j] .addEventListener (MouseEvent.CLICK, showBigImage);
}

}
private void loadStarted(evt:Event):void
{

scrollerBg.addChild (preloader);
Preloader.y = scrollerBg.height/2;
}
private void imageLoaded(evt:Event):void
{
resizeThumbNail (evt.target.loader.parent, 100, 57, true, true, false);
TweenMax.to(evt.target.loader.parent.parent,0.5,{alpha:1});)
}
private void showProgress(evt:ProgressEvent):void
{

var p: Number = (1.0 / evt.bytesTotal) * evt.bytesLoaded;

If (p == 1)
{
If (preloader.stage)
{
scrollerBg.removeChild (preloader);
}
this.removeChild (preloader);
}
on the other
{
preloader.loadBar.width = scrollerMask.width * %;
}

}
private void onError(evt:IOErrorEvent):void
{

}
private void resizeThumbNail(mc:DisplayObject,maxWidth:Number,maxHeight:Number,constrainProportions:Boolean=true,horCenAlign:Boolean=true,verticalCentralAlign:Boolean_=_true):void
{
MC. Height = maxHeight;
MC. Width = maxWidth;
If (constrainProportions)
{

}
If (horCenAlign)
{
MC.x = (maxWidth - mc.width) / 2;
}
If (verticalCentralAlign)
{
MC.y = (maxHeight - mc.height) / 2;
}
}
private void scrollThumbNail(evt:MouseEvent):void
{
scrollerBg.addEventListener (Event.ENTER_FRAME, onEnterFrameHandeler);
scrollerBg.addEventListener (MouseEvent.MOUSE_OUT, stopScrolling);
}
private void onEnterFrameHandeler(evt:Event):void
{
If (mouseY > scrollerMask.y & & mouseY < scrollerMask.height)
{
If (mouseX > 0 & & mouseX < scrollerMask.width/2)
{
VX =-(mouseX-(scrollerMask.width/2-rembourrage * 2)) / 8;
}
ElseIf (mouseX > scrollerMask.width/2 & & mouseX < scrollerMask.width)
{
VX =-(mouseX-(scrollerMask.width/2-rembourrage * 2)) / 8;
}
scrollerBg.x += vx;
}
if(scrollerBg.x > scrollerMask.x)
{
scrollerBg.x = scrollerMask.x + padding;
}
If (scrollerBg.x <-(scrollerBg.width-scrollerMask.width))
{
scrollerBg.x =-(scrollerBg.width-scrollerMask.width);
}
}
private void stopScrolling(evt:MouseEvent):void
{
scrollerBg.removeEventListener (Event.ENTER_FRAME, onEnterFrameHandeler);
}
private void showBigImage(evt:MouseEvent):void
{
= index evt.target.indexs;
var bgImageloader:Loader = new Loader();
bgImageloader.contentLoaderInfo.addEventListener (Event.COMPLETE, bgimageLoaded);
bgImageloader.contentLoaderInfo.addEventListener (Event.OPEN, startLoading);
bgImageloader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, showProgressBg);
bgImageloader.load (new URLRequest (bgImage [index]));

}
private void startLoading(evt:Event):void
{
this.parent.addChild (preloader);
}
private void showProgressBg(evt:ProgressEvent):void
{
var p: Number = (1.0 / evt.bytesTotal) * evt.bytesLoaded;

If (p = 100)
{
If (preloader.stage)
{
this.removeChild (preloader);
}
}
on the other
{
preloader.loadBar.width = % stage.stageWidth*;
}
}
private void bgimageLoaded(evt:Event):void
{
var bg:Bitmap = evt.target.content as Bitmap;
BG. Smoothing = true;
BG.alpha = 0;
this.parent.parent.addChildAt(bg,0);
TweenMax.to(bg,1,{alpha:1});)
}
}

}

but when I got an error

If please help me track the index and therefore I have can show image basically appropriate when one is clicked thum

ReferenceError: Error #1069: property not found markings on flash.display.Loader and there is no default value.
at com.elements::Scrollercontainer/showBigImage() [E:\madhu\xmldrivenslideshow\com\elements\S crollercontainer.as:220]

thumbBackground.alpha = 0;
thumbBackground.addEventListener (MouseEvent.CLICK, showBigImage);
indexTracker.push (thumbBackground);
scrollerBg.addChild (thumbBackground);
}
for (var j: int = 0; j< indextracker.length;="">
{
indexTracker [j] .buttonMode = true;
      .Indexs indexTracker [j] = j;
indexTracker [j] .addEventListener (MouseEvent.CLICK, showBigImage);
}

Why not just put this code in the first loop for? So you're just setting properties of thumbBackground...:

thumbBackground.alpha = 0;
thumbBackground.addEventListener (MouseEvent.CLICK, showBigImage);

thumbBackground.buttonMode = true;

thumbBackground.indexs = i;

indexTracker.push (thumbBackground);
scrollerBg.addChild (thumbBackground);
}

And then, in showBigImage use currentTarget:

private void showBigImage(evt:MouseEvent):void
{
           index = evt.currentTarget.indexs;

Tags: Adobe Animate

Similar Questions

  • How can I know what is a plugins and if I really need it?

    I didn't even know I had 'plugins '. After seeing just a list, I want to know what they are doing and if I need them (so I can clean my system if I don't). For the most part they say technically that they are. It does not help... :))

    You can always google the name of the plugin and you're sure to get an explanation somewhere in the top 10 hits. If you are sure you don't need a pug you can always uninstall it. If you come across a site that uses it, it will ask you to install again.

    If you use several browsers always transfer your settings from one to the other may have collected plugins you no longer need.

  • I visit my daughter and they have DSL but it so slow and Facebook does not completely load. How can I know what the problem is and fix it?

    I visit my daughter and they have DSL for the game but not a computer. I can connect to the internet with my laptop very well, but it is so slow and especially never finishes loading. Unable to get Facebook and Farmville to load correctly how to find what is the problem and ffix it? Its driving me crazy!

    Hi DonnaSuttles,

    ·         What operating system is installed on your computer?

    ·         If it works well before?

    ·         Did you do changes on the computer before the show?

    I suggest you to check and clean the boot if the problem persists.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

     

    Note: After troubleshooting, be sure to configure the computer to start as usual as mentioned in step 7 in the above article.

    You can also view the article mentioned for more information:

    Why is my Internet connection so slow?

    http://Windows.Microsoft.com/en-us/Windows7/why-is-my-Internet-connection-so-slow

    Let us know the results.

  • How can I format / erase a partition vmfs on the HARD drive for later use by windows?

    Hi all

    I have a HARD drive to a virtual host formatted as a vmfs partition. I need to delete / erase this HARD drive vmfs partition because it will now be used in a Windows environment. Can someone explain please how can I remove vmfs partition so that it can be formatted in NTFS? Can be done in a Windows operating system like the current place of residence may have one easily accessible Linux or vmware?

    Thank you.

    vmTrekker

    Windows should be able to reformat a VMFS partition in the GUI. If this isn't the case, you can run the diskpart utility and erase the partition table on the disk.

    André

  • How do I know what version (update / output level) version 6 has been applied to my system?

    Question
    How do I know what version (update / output level) version 6 has been applied to my system? I applied several different publication levels to version 6 of FF, but all about feature tells me is Version 6.0. No version! This seems to be a change in the updates in the way which are managed. What is a distortion because of the speed in which you push updates and what's new?
    contact me if you need something more

    e-mail address removed

    For those who are in need of a photo/screenshot, see attachment below. Right click on the image below, choose "Open in New Tab", click on the image to open in the new tab to zoom in and enlarge the image.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

  • Should I delete the programs of 2004? How can you know what is safe to delete?

    Original title: remove programs

    I think I have a virus.  I see on my computer a few applications with and installed as of 2004.  The computer was purchased in 2007.  When I run it in safe mode, it works fine and all applications have a date of 2007 or newer.  Should I delete the programs of 2004? How can you know what is safe to delete?

    Hello

    This is not an indication of malware. Could be those are placed on the
    computer by the manufacturer of the system and that was the date that firstly, they prepared their
    for massive installation, or if they did not set a date and be used arbitrarily.

    =============================================================

    If you need search malware here's my recommendations - they will allow you to
    scrutiny and the withdrawal without ending up with a load of spyware programs running
    resident who can cause as many questions as the malware and may be more difficult to detect as the
    cause.

    No one program cannot be used to detect and remove any malware. Added that often easy
    to detect malicious software often comes with a much harder to detect and remove the payload. Then
    its best to be thorough than paying the high price later now too. Check with them to one
    extreme overkill point and then run the cleaning only when you are sure that the system is clean.

    It can be made repeatedly in Mode safe - F8 tap that you start, however, you must also run
    the regular windows when you can.

    TDSSKiller.exe. - Download the desktop - so go ahead and right-click on it - RUN AS ADMIN
    It will display all the infections in the report after you run - if it will not run changed the name of
    TDSSKiller.exe to tdsskiller.com. If she finds something or not does not mean that you should not
    check with the other methods below.
    http://support.Kaspersky.com/viruses/solutions?QID=208280684

    Download malwarebytes and scan with it, run MRT and add Prevx to be sure that he is gone.
    (If Rootkits run UnHackMe)

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN

    Malwarebytes - free
    http://www.Malwarebytes.org/

    Run the malware removal tool from Microsoft

    Start - type in the search box-> find MRT top - right on - click RUN AS ADMIN.

    You should get this tool and its updates via Windows updates - if necessary, you can
    Download it here.

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN
    (Then run MRT as shown above.)

    Microsoft Malicious - 32-bit removal tool
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=AD724AE0-E72D-4F54-9AB3-75B8EB148356&displaylang=en

    Microsoft Malicious removal tool - 64 bit
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=585D2BDE-367F-495e-94E7-6349F4EFFC74&displaylang=en

    also install Prevx to be sure that it is all gone.

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN

    Prevx - Home - free - small, fast, exceptional CLOUD protection, working with others
    security programs. It is a single scanner, VERY EFFICIENT, if it finds something to come back
    here or use Google to see how to remove.
    http://www.prevx.com/   <-->
    http://info.prevx.com/downloadcsi.asp  <-->

    Choice of PCmag editor - Prevx-
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    Try the demo version of Hitman Pro:

    Hitman Pro is a second scanner reviews, designed to save your computer from malicious software
    (viruses, Trojans, rootkits, etc.). who infected your computer despite safe
    what you have done (such as antivirus, firewall, etc.).
    http://www.SurfRight.nl/en/hitmanpro

    --------------------------------------------------------

    If necessary here are some free online scanners to help the

    http://www.eset.com/onlinescan/

    New Vista and Windows 7 version
    http://OneCare.live.com/site/en-us/Center/whatsnew.htm

    Original version
    http://OneCare.live.com/site/en-us/default.htm

    http://www.Kaspersky.com/virusscanner

    Other tests free online
    http://www.Google.com/search?hl=en&source=HP&q=antivirus+free+online+scan&AQ=f&OQ=&AQI=G1

    --------------------------------------------------------

    Also follow these steps for the General corruption of cleaning and repair/replace damaged/missing
    system files.

    Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup

    Start - type this into the search-> find COMMAND to top box and RIGHT CLICK-
    RUN AS ADMIN

    Enter this at the command prompt - sfc/scannow

    How to analyze the log file entries that the Microsoft Windows Resource Checker
    (SFC.exe) program generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    Run checkdisk - schedule it to run at the next startup, then apply OK then restart your way.

    How to run the check disk at startup in Vista
    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    -----------------------------------------------------------------------

    If we find Rootkits use this thread and other suggestions. (Run UnHackMe)

    http://social.answers.Microsoft.com/forums/en-us/InternetExplorer/thread/a8f665f0-C793-441A-a5b9-54b7e1e7a5a4/

    I hope this helps.

  • How will I know what security pack I have in my computer? and do I have to load the update of security in ms10-046

    I have recivied an email indicating that I need to load a security update. He referenced MS10-046 "a vulnerability in the windows shell could allow remote access" is this necessary? and it refers to the sp2. Which leads to my next question how can I know what "SP" I have on my computer. Thanks for your time and considerartion.

    go to start > run > type

    winver

    Click ok

    What service pack t - he say that contains?

  • I have a 2002 Home edition WIndows Xp System. How will I know what bit is?

    How will I know what bit is?

    Because they do not have a 64-bit edition family... you have a 32-bit operating system.

    To see for yourself, make a right click workstation-> properties, on the general tab, you will see under "system":
    Microsoft Windows XP
    Home Edition
    Version 2002
    Service Pack 3

    For a 64-bit version "Windows XP Professional x 64 Edition" appears under System.

  • How do I know what type of prossesor my laptop is and what is the speed of the processor?

    How do I know what type of prossesor my laptop is and what is the speed of the processor?

    On the start menu, click computer , and then click System Properties.

  • need help on history, recycle bin and cookies: how will I know what someone has done on my laptop?

    I would like to learn more about history on my computer vista laptop microsoft and more on maybe the trash and or cookies. For example, someone else used my laptop last night and delete everything that he was looking at or for then how can I know what it was?

    Assuming that it has not been removed, you can view the history of visited web sites by clicking on the Favorites button, click the history tab.

    The only things in the trash are files or folders that have been removed from the system (no evidence they have been read or something like that).

    Cookies will not tell you anything either because they are terms in the code and you can not tell what web site they belong - no good for tracking not web history (and they apply only to the history of the web).

    You can view the Start / recent items to display some of the files which were recently seen (assuming that the list has not been removed).  That may help some.  You can also go to C:\Users\\Recent for a longer list of recently accessed files (as long as you know the user name).

    There is actually very little that you can do with hindsight to see what anyone seen or done on your computer.

    If you want to implement such a procedure, use the Parental http://windows.microsoft.com/en-US/windows-vista/Set-up-Parental-Controls control and activity reports control Parentalhttp://windows.microsoft.com/en-us/windows-vista/Set-up-Parental-Controls-activity-reports.  Do this for each account you want to track.  Then you can check what you wish now that you could check.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How will I know what ink cartridges are low?

    I have a photosmart b210. How do I know what color cartridge becomes weak? been all over the apps through the screens of the printer and cannot find it ANYWHERE! help, please!

    Hi Shinski_lynch,

    What a nice printer.

    He should ask on the front if the ink is low, but you can also follow these steps to see if you are running low on ink.

    • Menu configuration (it looks like a key on the front panel)
    • Click on 'tools '.
    • Then click on "Display Ink Level".
    • That displays the ink of your printer.

    Please let us know if that solved your problem.

  • my C drive is full, how do I know what programs can I remove?

    I know that you can remove some programs, but how do I know what ones I can remove without affecting my computer?

    I know that you can remove some programs, but how do I know what ones I can remove without affecting my computer?

    We cannot comment on what programs you need to remove. In addition, some programs running in the background and removing will raise questions.

    However, you can uninstall programs that have been installed by you. You can go to start-> programs and features-> press enter type. Search for programs that have been installed by you, select them and click on uninstall, individually.
    Once uninstalled, you can install another drive as the installation location.
    But, before you uninstall, go on-> do work right click on the C partition :\-> click Properties. In the Properties dialog box, click Disk Cleanup. In the Disk Cleanup dialog box, click clean up system files. And then click Ok. This will clean the junk files.
  • How will I know what camera raw I like a plug-in?  I started using PSCC.

    How will I know what camera raw I like a plug-in?  I started using PS cc.

    In Photoshop:

    Click on Photoshop (Mac) or (Win) the help > about Plug-Ins > Camera Raw

  • How do I know what RAID controller works the box?

    Using the VMware Compatibility Guide, how do I know what RAID controller works out of the box (no installation necessary driver, no action necessary special) for 5.5 ESXi update 2?

    PS - I initially assumed that if they appear then they work OOB, but there is nothing on the page registration or landing pages of the device that makes this clear.

    Once you click the RAID controller in the HCL, you will see all the supported versions of ESXi with the appropriate driver listed as "inbox" or async". There may be more driver for a specific version, but if one of them is stated as "inbox", it is supposed to work out of the box.

    André

  • How can I know what ram slot ram in there on my G4 imac

    OK so I have an imac G4 1 GHz version and I don't have any tools to open it to see what ram slots are empty for a ram upgrade how can I know what ram slot is free and opening the mac

    There is a user accessible memory slot. You can install a maximum of 2GBs. The memory of the plant is pre-installed.

Maybe you are looking for