Need help with finding picture size

ok here is  my problem i have this sphere and it works great except when you click the thumbnails to display the picture, depending on the size of the picture, the pictures can get pushed to far over, and i understand why. the x and y coord never change. now my idea is to get the size of picture and use that to adjust the x-coord accordingly. my question is. how do i get the picture size? if i can. do the pictures have to be in the fla?
heres code:
The radius of the sphere, 'rad'. You can change it if you wish
especially if you use thumbnails of a different size than our thumbnails.
var rad:Number=380;
The position of 'board' that will be defined later. 'board' is the main
container containing the sphere and the black background
that reponds to mouse actions.
var posX:Number=stage.stageWidth/2;
var posY:Number=stage.stageHeight/2;
The size of thumbnails. Change the values to reflect the size of your
images.
var thumbWidth:Number=70;
var thumbHeight:Number=53;
The thumbnail images have been imported to the Library and linked to AS3
under the names 'Small1', 'Small2',....,'Small46'. The corresponding
Bitmap objects will be stored in the array 'thumbsArray'.
var thumbsArray:Array=[];
The addresses of the images corresponding to the thumbnails are stored
in 'picsArray'. The images will be loaded at runtime when the user
clicks on each thumbnail.
var picsArray:Array=[];
The Bitmap object corresponding to each thumbnail will be placed
in a Sprite, holdersArray[i][j], as its child. We have to do this
to make thumbnails responsive to mouse clicks.
var holdersArray:Array=[];
In order to depth-sort images on the sphere, we will need to keep
track of their midpoints and the position of each midpoint in 3D.
The midpoints will be stored in 'midsArray'.
var midsArray:Array=[];
The only part of our spherical menu that is hard-wired (and a bit harder
to customize) is the number of thumbnails and their placement on the sphere.
We have 46 thumbnails placed along 7 horizontal 'circles' on the sphere.
The 'jLen' vector describes the number of thumbnails on each circle.
The first 'circle' is the north pole and contains 1 image; the second
is the circle corresponding to the vertical angle of 30 degrees
from the negative y axis. That circle contains 6 images. The next one,
at 60 degree of vertical displacement contains 10 images;
the one after that, at 90 degrees from the negative y axis, is the equador
of the sphere and contains 12 images. Past that, we go symmetrically:
10, 6, and 1 image at the south pole.
All our arrays are organized to reflect that placement of thumbnails.
For example, thumbsArray is an array of arrays, thumbsArray[i], where
i corresponds to the number of each circle. thumbsArray[i][j] is the
j-th image on the i-th of the seven circles.
var jLen:Vector.<Number>=new Vector.<Number>();
jLen=Vector.<Number>([1,6,10,12,10,6,1]);
We use the almost standard parametrization of a sphere:
phi is the vertical angle measured from the vertical axis
pointing upwards (in Flash's coordinate system this is the negative
y-axis), theta is the horizontal angle measured from the
horizontal axis pointing away from the screen; that is,
the negative z-axis. phi changes from 0 to 90 degrees,
theta from 0 to 360 degrees. For each circle, phi is constant:
0, 30, 60, 90, 120, 150, 180. 'thetaStep' contains the angular
distances between thumbnails on each circle. Except
for the north and the south pole, for each circle
the angular distance between thumbnails equals to 360 divided
by the number of thumbnails on the circle.
var thetaStep:Vector.<Number>=new Vector.<Number>();
thetaStep=Vector.<Number>([0,60,36,30,36,60,0]);
//The vertical angle between circles.
var phiStep:Number=30;
To make images tangent to the sphere, we need to tilt them
vertically and horizontally. Horizontal tilt is always
equal to the theta angle of the midpoint
of the image and changes along each circle;
the vertical tilt is based on the values
of phi and is constant for each circle of thumbnails.
var phiTilt:Vector.<Number>=new Vector.<Number>();
phiTilt=Vector.<Number>([-90,-60,-30,0,30,60,90]);
//The next four variables are related to auto-rotation
//and rotation by the user.
var autoOn:Boolean=true;
var manualOn:Boolean=false;
var prevX:Number;
var prevY:Number;
//The amount of perpective distortion. Higher values give more distortion.
//Values have to be between 0 and 180 as they correspond to the view angle.
this.transform.perspectiveProjection.fieldOfView=70;
//We define and position the container 'board'.
var board:Sprite=new Sprite();
this.addChild(board);
board.x=posX;
board.y=posY;
//We call the function that draws the border and the background
//of 'board'.
drawBoard();
//Settings for our dynamic text boxes present on the Stage.
infoBox.mouseEnabled=false;
infoBox.wordWrap=true;
infoBox.text="";
loadBox.mouseEnabled=false;
loadBox.wordWrap=true;
loadBox.text="";
loadBox.visible=false;
When the user double-clicks on a thumbnail, the corresponding image
will be loaded into 'loader' - an instance of the Loader class.
'loader' is a child of the Sprite, 'photoHolder', which is a child
of the MainTimeline.
var photoHolder:Sprite=new Sprite();
this.addChild(photoHolder);
photoHolder.x=200;
photoHolder.y=100;
var loader:Loader=new Loader();
photoHolder.addChild(loader);
photoHolder.visible=false;
We will literally 'build' a shere of thumbnails by positioning
them in a Sprite called 'spSphere'. The moment we assign
any of the 3D properties to 'spSphere', for example a value for the z coordinate,
spSphere becomes a 3D container. That means we can place elements in it
in 3D. We will also be able to apply 3D methods to 'spSphere', e.g. rotations.
When 'spSphere' becomes a 3D display object, it has transfrom.matrix3D property.
The latter property holds all the information about the current 3D state
of 'spSphere'.
var spSphere:Sprite=new Sprite();
board.addChild(spSphere);
spSphere.x=0;
spSphere.y=0;
//We move 'spSphere' backwards to avoid distortion of the front thumbnails.
//You can experiment with different values for the z coordinate.
spSphere.z=rad;
//We call several functions defined later in the script.
//They names tell it all.
setUpPics();
buildSphere();
spSphere.rotationY=0;
spSphere.rotationX=0;
spSphere.rotationZ=0;
spSphere.filters=[new GlowFilter(0x666666,1.0,6.0,6.0,2)];
rotateSphere(0,0,0);
setUpListeners();
//The function that draws the black rectangle behind our sphere.
//You can change the values below to change the size and the color
//of the background. Those values do not affect the sphere itself.
function drawBoard():void {
      board.graphics.clear();
      board.graphics.lineStyle(0,0x333333);
      board.graphics.beginFill(0x000000, 0);
      board.graphics.drawRect(-640,-490,1180,1080);
      board.graphics.endFill();
//We add all the necassary listeners. They are self-explanatory.
//Note that holdersArray[i][j] is the Sprite that contains the
//j-th thumbnail on the i-th circle.
function setUpListeners():void {
          var i:int;
          var j:int;
          this.addEventListener(Event.ENTER_FRAME,autoRotate);
          board.addEventListener(MouseEvent.ROLL_OUT,boardOut);
          board.addEventListener(MouseEvent.MOUSE_MOVE,boardMove);
          board.addEventListener(MouseEvent.MOUSE_DOWN,boardDown);
          board.addEventListener(MouseEvent.MOUSE_UP,boardUp);
          loader.contentLoaderInfo.addEventListener(Event.COMPLETE,doneLoad);
          loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadingError);
          photoHolder.addEventListener(MouseEvent.CLICK,holderClicked);
         for(i=0;i<7;i++){
            for(j=0;j<jLen[i];j++){
                holdersArray[i][j].doubleClickEnabled=true;
                holdersArray[i][j].addEventListener(MouseEvent.DOUBLE_CLICK,picClicked);
The functions that are executed in response to events to which we listen.
The next one runs when a loaded picture is clicked.
function holderClicked(e:MouseEvent):void {
    board.visible=true;
    photoHolder.visible=false;
    infoBox.text="";
    manualOn=false;
    autoOn=true;
'picClicked' is executed when any of the thumbnails is double-clicked.
Note that in the function 'buildSphere' below, we assigned names to
all holders, holderArray[i][j]. We need those names now to know
which thumbnail was clicked and which image to load.
function picClicked(e:MouseEvent):void {
    var targName:String="Double Click Image To View";
    var i:int;
    var j:int;
    targName=e.currentTarget.name;
    i=int(targName.charAt(3));
    j=int(targName.substring(5,targName.length));
    board.visible=false;
    loader.load(new URLRequest(picsArray[i][j]));
    infoBox.text="";
    loadBox.text="Loading...";
    loadBox.visible=true;
function loadingError(e:IOErrorEvent):void {
    loadBox.text="There has been an error loading the image. The server may be busy. Refresh the page and try again.";
function doneLoad(e:Event):void {
    infoBox.text="Click the image to close it.";
    photoHolder.visible=true;
    loadBox.text="";
    loadBox.visible=false;
//Listeners responsible for mouse rotations and auto-rotation.
function autoRotate(e:Event):void {
         if(autoOn && !manualOn){
             spSphere.transform.matrix3D.prependRotation(-0.5,Vector3D.Y_AXIS);
             zSortPics();
function boardOut(e:MouseEvent):void {
            autoOn=true;
            manualOn=false;
function boardDown(e:MouseEvent):void {           
            prevX=board.mouseX;
            prevY=board.mouseY;
            autoOn=false;
            manualOn=true;
function boardUp(e:MouseEvent):void {
            manualOn=false;
     function boardMove(e:MouseEvent):void {
                var locX:Number=prevX;
                var locY:Number=prevY;
                if(!autoOn && manualOn){
                prevX=board.mouseX;
                prevY=board.mouseY;
                rotateSphere(prevY-locY,-(prevX-locX),0);
                e.updateAfterEvent();
The function setUpPics populates the arrays thumbsArray and picsArray.
Note the organization of thumbnails by circles on which they reside:
thumbsArray[0] - the north pole, thumbsArray[1] thumbnails of the first circle
down from the north pole, etc. 'picsArray' is organized similarly.
You can, of course, subsitute your own images, use thumbnails of
dimensions different from ours. Changing the number of thumbnails and their organization
would, however, require rewritting the script a bit.
function setUpPics():void {
    thumbsArray[0]=[new Bitmap(new Small1(70,46))];
    picsArray[0]=["pic1.jpg"];
    thumbsArray[1]=[new Bitmap(new Small2(70,105)),new Bitmap(new Small3(70,105)),new Bitmap(new Small4(70,53)),new Bitmap(new Small5(70,53)),new Bitmap(new Small6(70,53)),new Bitmap(new Small7(70,53))];
    picsArray[1]=["pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg","pic6.jpg","pic7.jpg"];
    thumbsArray[2]=[new Bitmap(new Small8(70,53)),new Bitmap(new Small9(70,53)),new Bitmap(new Small10(70,53)),new Bitmap(new Small11(70,53)),new Bitmap(new Small12(70,53)),new Bitmap(new Small13(70,53)),new Bitmap(new Small14(70,53)),new Bitmap(new Small15(70,53)),new Bitmap(new Small16(70,53)),new Bitmap(new Small17(70,53))];
    picsArray[2]=["pic8.jpg","pic9.jpg","pic10.jpg","pic11.jpg","pic12.jpg","pic13.jpg","pic1 4.jpg","pic15.jpg","pic16.jpg","pic17.jpg"];
    thumbsArray[3]=[new Bitmap(new Small18(70,53)),new Bitmap(new Small19(70,53)),new Bitmap(new Small20(70,53)),new Bitmap(new Small21(70,53)),new Bitmap(new Small22(70,53)),new Bitmap(new Small23(70,53)),new Bitmap(new Small24(70,53)),new Bitmap(new Small25(70,53)),new Bitmap(new Small26(70,53)),new Bitmap(new Small27(70,53)),new Bitmap(new Small28(70,53)),new Bitmap(new Small29(70,53))];
    picsArray[3]=["pic18.jpg","pic19.jpg","pic20.jpg","pic21.jpg","pic22.jpg","pic23.jpg","pi c24.jpg","pic25.jpg","pic26.jpg","pic27.jpg","pic28.jpg","pic29.jpg"];
    thumbsArray[4]=[new Bitmap(new Small30(70,53)),new Bitmap(new Small31(70,53)),new Bitmap(new Small32(70,53)),new Bitmap(new Small33(70,53)),new Bitmap(new Small34(70,53)),new Bitmap(new Small35(70,53)),new Bitmap(new Small36(70,53)),new Bitmap(new Small37(70,53)),new Bitmap(new Small38(70,53)),new Bitmap(new Small39(70,53))];
    picsArray[4]=["pic30.jpg","pic31.jpg","pic32.jpg","pic33.jpg","pic34.jpg","pic35.jpg","pi c36.jpg","pic37.jpg","pic38.jpg","pic39.jpg"];
    thumbsArray[5]=[new Bitmap(new Small40(70,53)),new Bitmap(new Small41(70,53)),new Bitmap(new Small42(70,53)),new Bitmap(new Small43(70,53)),new Bitmap(new Small44(70,53)),new Bitmap(new Small45(70,53))];
    picsArray[5]=["pic40.jpg","pic41.jpg","pic42.jpg","pic43.jpg","pic44.jpg","pic45.jpg"];
    thumbsArray[6]=[new Bitmap(new Small46(70,53))];
    picsArray[6]=["pic46.jpg"];
In the next function we actually create a 3D sphere of thumbnails by positioning
them in 3D within spSphere. Note the center of the sphere is at (0,0,0) of
spSphere. It might be worth recalling that with our interpretation of
phi and theta each point P=(x,y,z) on the sphere corresponding to given values
of phi and theta is given by:
x = rad * sin(phi) * sin(theta),
y = -rad * cos(phi),
z = -rad * sin(phi) * cos(theta).
Within the function, we populate 'holdersArray' and 'midsArray'. We assign thumbnails
to holdersArray elements, position holdersArray elements, tilt them, give them names.
We literally build our sphere.
function buildSphere():void {
    var i:int;
    var j:int;
    var tStep:Number;
    var pStep:Number=phiStep*Math.PI/180;
    for(i=0;i<7;i++){
        holdersArray[i]=[];
        midsArray[i]=[];
        tStep=thetaStep[i]*Math.PI/180;
        for(j=0;j<jLen[i];j++){
            midsArray[i][j]=new Vector3D(rad*Math.sin(i*pStep)*Math.sin(j*tStep),-rad*Math.cos(i*pStep),-rad*Math.sin(i*p Step)*Math.cos(j*tStep));
            holdersArray[i][j]=new Sprite();
            holdersArray[i][j].name="pic"+String(i)+"_"+String(j);
            holdersArray[i][j].addChild(thumbsArray[i][j]);
            thumbsArray[i][j].x=-thumbWidth/2;
            thumbsArray[i][j].y=-thumbHeight/2;
            spSphere.addChild(holdersArray[i][j]);
            holdersArray[i][j].x=midsArray[i][j].x;
            holdersArray[i][j].y=midsArray[i][j].y;
            holdersArray[i][j].z=midsArray[i][j].z;
            holdersArray[i][j].rotationX=phiTilt[i];
            holdersArray[i][j].rotationY=-j*thetaStep[i];
      zSortPics();
'zSortPics' depth-sorts all thumbnails corresponding to each view of
the sphere. It sorts thumbnails by removing them (or more precisely
their holders, holdersArray[i][j], as children of spSphere and then reassigning
them based on the z-coordinates of their midpoints.
function zSortPics():void {
    var distArray:Array=[];
    var dist:Number;
    var i:int;
    var j:int;
    var k:int;
    var curMatrix:Matrix3D;
    var curMid:Vector3D;
    curMatrix=spSphere.transform.matrix3D.clone();
    while(spSphere.numChildren>0){
        spSphere.removeChildAt(0);
        for(i=0;i<7;i++){
            for(j=0;j<jLen[i];j++){
            curMid=curMatrix.deltaTransformVector(midsArray[i][j]);
            dist=curMid.z;
            distArray.push([dist,i,j]);
      distArray.sort(byDist);
      for(k=0;k<distArray.length;k++){
          spSphere.addChild(holdersArray[distArray[k][1]][distArray[k][2]]);
          holdersArray[distArray[k][1]][distArray[k][2]].alpha=Math.max(k/(distArray.length-1),0.5) ;
function byDist(v:Array,w:Array):Number {
     if (v[0]>w[0]){
        return -1;
      } else if (v[0]<w[0]){
        return 1;
       } else {
        return 0;
The function that rotates the sphere in response to the user moving the mouse.
Note we are setting the z coordinate to 0 before rotation. Otherwise,
the non-zero translation coefficients produce undesirable effects.
Note also that we do not use this function in 'autoRotate'. That is because
when the sphere auto-rotates we want it to revolve about is pole-to-pole
axis. That means prepending rather than appending rotation.
See the function 'autoRotate' above.
function rotateSphere(rotx:Number,roty:Number,rotz:Number):void {
      spSphere.z=0;
      spSphere.transform.matrix3D.appendRotation(rotx,Vector3D.X_AXIS);
      spSphere.transform.matrix3D.appendRotation(roty,Vector3D.Y_AXIS);
      spSphere.transform.matrix3D.appendRotation(rotz,Vector3D.Z_AXIS);
      spSphere.z=rad;
      zSortPics();

I won't be searching thru all that code to try to find something relevant to your post, but if you are using a Loader to load the images, you can get the width and height as soon as the loading is complete using the loader object (loader.width, loader.height).  You just need to wait until loading is complete, so you'll need a listener for that if you don't have one already.

Similar Messages

  • I need help with finding right stylus pen for lenovo yoga 2 pro!

    I did read other person's post, but I did not find my answer. I am currently using my fingers to write my notes and it drives me nuts! I do have a stylus pen that have huge round fabric tip. It does not write well. I want a stylus pen with pointy end so I can acturally take my notes on OneNote. I writes equations down so it is very hard to write small and neat with my hand. I do know that my laptop is touch sensitive so it only works with rubber or fabric tips! I could not find any stylus pen with those tip that are pointy.... I need help on finding pointy tipped stylus pen that will let me write well. I am ordering ati-glare screen protector because I can see myself on the screen like a mirror... lol Hopefully this will not keep me from finding a pen that works well! Please give me link to the pen, if you can! Thank you for reading!

    ColonelONeill is correct.
    The Yoga 2 Pro does not have a digitizer, so a capacitative stylus, which mimics a fingertip, is what you'd need.
    Regards.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

  • Needing help with moving pictures around

    I am in need of help in moving pictures and images around
    dreamweaver document window. My older brother gave me his computer
    witch has dreamweaver MX (he is in Irag) so i can start building
    building my own websites. I went to borders and bought a book on
    dreamweaver MX. Here is where I am having a problem with: when ever
    I bring a picture into the document window I can not move the
    picture around the document window. The book say "place the
    insertion point where you want the image to appear" but there is no
    insertion point. There is just a straight line as if I am about to
    type something. It's almost like I am in microsoft word. If I take
    the mouse over the picture , and then left click and try to drag
    the picture to the location I want it in, it doesn't move. Can
    somebody PLEASE help me out with this problem. Thanks Jical

    Nadia gave you a good place to start… Here is what you
    have to understand. Web pages are based on specific code that tells
    the viewer’s browser how to display the page. There has to be
    something that says, “Put this picture in the lower right
    hand corner, and center this image in the middle of the
    screen”
    Then there are further instructions that say “Put this
    text here and that link there”. So Dreamweaver (and most
    other web developing programs) do not work like Illustrator or
    PowerPoint where you can simply grab a picture and slide it around
    the page.
    In its simplest form you might drag an image onto the
    Dreamweaver design view page and click on the center button in the
    properties dialog.
    Then type in text and center it, left justify, right justify,
    etc. Add another picture and so on and you could possibly create a
    passable web page. Now click on the Code view button and see what
    code Dreamweaver generated in order to do all of this.
    That is what you will really need to understand before you
    can really get proficient at web design.
    At the next level, you can start to add in tables. These
    actually are similar to tables in Word. You can put text in one
    cell, images in another, colored backgrounds, thick and thin
    borders with contrasting colors, and you can start to see how to
    “contain” your images as Nadia suggests.
    Now look at the code again and see how these cells are
    defined around your content.
    Once you understand how this works, you will get much more
    comfortable with Dreamweaver. You will just have to get used to the
    idea that it doesn’t work like all of the publishing software
    that is only dependant upon its own format for layout. HTML is
    dependant upon the many browsers, computers, operating systems,
    user preferences, and a million other unknown factors.
    That’s why this forum has more than 91,000 posts…

  • Need help with finding "my" camera..

    I'm having difficulty finding a camera with specific features that are important for me. I would greatly appreciate any help in finding the brand and model that fits the bill. I've googled and googled, without any luck. Help!  I'm looking for a digital camera with:
    1. GPS
    2. "small" size (gotta fit in my purse, no camera bags for me!)
    3. viewfinder
    4. takes AA batteries
    TIA

    As a GPS and AA enthusiast, I too have been waiting for a similar combination.
    nuff said about GPS models like the NIkon AW100, P510, S9300 similar models using propreitary batteries.
    DSLR with AA powered grips don't fit your portability factor
    have you considered an AA powered data logger?  I use the discontinued Sony GPS-CS1.  Not only does it provide a data file to sync with my camera clock, but it also draws a breadcrumb on where I go so I can look it up on a map afterwards.

  • MOVED: need help with finding gpu for win 7

    This topic has been moved to MSI Notebook.
    https://forum-en.msi.com/index.php?topic=128552.0

    Mike,
    I'm not going to be much help with Boot Camp however I can direct you to the Boot Camp forum where there are more people that know how to troubleshoot it and Windoze 7. You can find it at:
    https://discussions.apple.com/community/windows_software/boot_camp
    Roger

  • Need help with keeping pictures in focus after transitions

    I am fairly new to Final Cut X.
    Right now I am making a DVD of just photos with music added.
    I am using transitions between photos as well.
    I'm having one problem:
    When I play the movie in FC, during the transition from photo to photo my pictures look great and are clear, but when the transition is not happening and the picture is just showing it goes a bit blurry. 
    Can someone help me out with a solution for this?
    Thanks, Adam

    Highlight the song or songs you want to add the artwork to.
    Click the Artwork button in the lower-left corner of the iTunes window (4th icon in).
    The Artwork box will open.
    Open the folder with the pictures in it from Windows Explorer
    Drag the picture you want to the Artwork box from folder.
    Press OK.
    Alternatively:
    Highlight the song or you want to add the artwork to.
    Right click on it and choose Get Info
    Then choose the Artwork tab
    Choose Add and browse to the picture you want to add.
    To add artwork to multiple items using Get Info
    Open iTunes, highlight your selection (click on the first track in your list, hold down the shift key and click on the last).
    Right click anywhere in the selection and choose Get Info
    When you are asked if you want to edit multiple items say yes.
    Drag your artwork to the small artwork box about halfway down on the right and choose OK.

  • Need Help With find and Replace

    I am a little green to this all. I am trying to find and
    replace a word inside the edit region and Dreamweaver will not
    change it, because it says its inside a locked region, but its a
    editable region?
    I have about 900 pages I need to make this change on and was
    relying on the find and replace tool to do that. I tried differn't
    advanced options, nothing seams to change it. I am using cs3.
    Thanks for any help

    Using Templates with a 900 page site is a crime against
    humanity. You reach
    the optimal size for Templates between about 50 and 100.
    The error you are getting suggests that there are coding
    errors on the page
    (perhaps even unrelated to ANY DW Template markup). We'd need
    to see the
    page to make progress with what that might be, as Alan says.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "RyanWaters" <[email protected]> wrote in
    message
    news:ggs7fq$gnq$[email protected]..
    >I am a little green to this all. I am trying to find and
    replace a word
    >inside
    > the edit region and Dreamweaver will not change it,
    because it says its
    > inside
    > a locked region, but its a editable region?
    > I have about 900 pages I need to make this change on and
    was relying on
    > the
    > find and replace tool to do that. I tried differn't
    advanced options,
    > nothing
    > seams to change it. I am using cs3. Thanks for any help
    >

  • Need help with finding a workaround: the shotcut ctrl+click opens 2 tabs in my case

    Hello!
    I have several links with an onclick event, which contains some javascript handling and window.open() after it, and they have attribute href="javascript:void(0);" as well.
    When user try Ctrl+click Firefox opens him 2 tabs: the first one with "right" content and the second with javascript:void(0).
    I've tried to set href="#" and in this case Ctrl+click works as I want, but on the original tab the user is redirected by the browser to the top of the page. The empty attribute (href="") also results 2 tabs. Maybe there is some value of the href attribute with which everything will work as I want? I've fed up with this and will be appreciated a lot if you help. Thanks.
    == This happened ==
    Every time Firefox opened
    == User use Ctrl+click

    I won't be searching thru all that code to try to find something relevant to your post, but if you are using a Loader to load the images, you can get the width and height as soon as the loading is complete using the loader object (loader.width, loader.height).  You just need to wait until loading is complete, so you'll need a listener for that if you don't have one already.

  • Need Help with Reducing PDF Size

    Hey I'm having trouble reducing my PDF file sizes.
    First off, they were school projects created in Adobe Illustrator that I save to PDF form. 
    I'm trying to email several of them to potential employers (through Gmail) but the file size limit is 25MB, and some of my files exceed that limit. 
    For example I have one PDF file that is 72MB. 
    I've compressed the file by right-clicking on the icon --- I've also reduced the file in Acrobat and that doesn't do anything. 
    Now I try to reduce the files and Acrobat tells me:
    "The PDF document contained image masks that were not downloaded."
    So can anyone help me?  I would greatly appreciate this from everyone who has time to comment and give me suggestions/help.
    Thanks.

    If you can find when a pictures is loaded (not when it is getting loaded, but after it has just finished being loaded), that is when you can check the size using the Loader (loader.width and loader.height).

  • Need help with finding prime numbers

    I have seen this question asked several times so i apologize for asking once again but I am very new to programming and could use some help. I know the way I have the extra if statements is not at all efficient but I cannot seem to figure out how to get a nested for statement with a divisor to work. The error I'm getting with this current code is that the second for statement needs to be boolean.
    package primenumbers;
    * @author Owner
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
            int primecount; //running total of prime numbers
            int incrementer; //increment numbers
            int sqrtInc; //square root of current increment
            int divisor;
            //set variables to 0
            primecount =0;
            incrementer=3;
            sqrtInc = (int)Math.sqrt(incrementer);
            divisor = 0;
         //print 2
            System.out.println("2");
         for(incrementer = 3; incrementer < 10000; incrementer = incrementer + 1 )
                     if (incrementer % 2 != 0)
                  if (sqrtInc % 3 != 0)
                     if (sqrtInc % 5 != 0)
                          if (sqrtInc % 7 != 0)
                              if (sqrtInc % 9 != 0)
                                  if (sqrtInc % 11 != 0)
        for (divisor = 3; divisor = incrementer; divisor = divisor +1)
                                  if ( incrementer % divisor !=0)
                  if (incrementer % (Math.sqrt(incrementer)) != 0)
              System.out.println(incrementer);
        }

    aeakers wrote:
    I thought I had described it. I appreciate the help but it seems pretty clear to me what this program is supposed to do.Yes, what it's supposed to do is clear: It's supposed to find some prime numbers.
    What's not clear, and what I'm asking about, is what algorithm you're trying to use. There's more than one way to find primes, and they all start with no regard whatsoever or any programming language. Then they get implemented in a programming language. It's not clear at all from that mess of code what algorithm you're trying to implement.
    And especially in the followup posts. Nope. Nothing was clarified there.
    Program should list every prime number that is less than 10000.
    I have it to check if the modulus is not zero for the following conditions:
    -divided by 2
    -square root divided by 3
    -square root divided by 5
    -square root divided by 7
    -square root divided by 9
    -square root divided by 11Why those particular numbers?
    Then check the modulus is not zero for the following
    number divided by a second number that increases up to the first numberI think I kind of get what you're saying here, but I don't think you understand it well enough to translate it to Java.
    I am really trying to get you the information you need but I am not at all familiar with this.The point here is that programming is as much about clarity and specificity of thought and communication as it is about the mechanics of the language. If you can't clearly and precisely express what you're trying to do--without regard to any programming language--then you won't be able to program it.
    At the very least, if you can't find a way to express your algorithm clearly and precisely, then you ought to put print statements in at each step of your program so you can see exactly what's happening each step of the way, compare that to what you think should be happening, and then find out where you're going wrong.
    Also, as a point of best practice, you should alaways use braces for if, for, etc., even when they're not strictly necessary.
    // bad
    if (...)
      singleStatement();
    // good
    if (...) {
      singleStatement();
    }

  • Need help to find image size box

    I am a novice, I need to find the image size box on illistrator but not able to so please explaine how to find it on the page.  Thanks

    You may also be talking about the "Info" window. To open it, go to Window > Info or hit command+F8. It will show you the dimensions of the bounding box containing whatever object you have selected.
    Please let us know if we can help you further.

  • Need Help with finding Mean across rows

    Hi all,
    I have a requirement of finding mean of several columns across a row. The tricky part is there might or might not be a value in each of the rows & the average must be calculated for the ones which has a value. Let me give you an example:
    col1 col2 col2 col4
    1 NULL 3 5 --> Mean will be (1+3+5)/3 = 3
    NULL NULL 2 4 --> Mean will be (2+4)/2 = 3.
    One option (dump acc to me) is to get the whole record into a %ROWTYPE variable, parse through each of the columns, see if the value is not null & greater than 0, increment the counter (i) & calculate the sum. Finally do a sum/i. One mean has 215 columns that needs to be averaged and having a separate if-end if seems illogical. there must be a smart solution to find this kind of average. Please help.
    Thanks,
    Sirisha

    Hi, Sirisha,
    siri_me wrote:
    Hi all,
    I have a requirement of finding mean of several columns across a row. The tricky part is there might or might not be a value in each of the rows & the average must be calculated for the ones which has a value. Let me give you an example:
    col1 col2 col2 col4
    1 NULL 3 5 --> Mean will be (1+3+5)/3 = 3
    NULL NULL 2 4 --> Mean will be (2+4)/2 = 3.If you only have a few columns, you can do something like this:
    SELECT          (NVL (col1, 0)     + NVL (col2, 0)     + NVL (col3, 0)     + NVL (col4, 0)
          / NULLIF ( NVL2 (col1, 1, 0) + NVL2 (col2, 1, 0) + NVL2 (col3, 1, 0) + NVL2 (col4, 1, 0)
                      , 0
    FROM     table_x
    One option (dump acc to me) What does "dump acc to me" mean?
    is to get the whole record into a %ROWTYPE variable, parse through each of the columns, see if the value is not null & greater than 0, increment the counter (i) & calculate the sum. Finally do a sum/i. One mean has 215 columns that needs to be averaged and having a separate if-end if seems illogical. there must be a smart solution to find this kind of average. Please help.The smart way is to store the numbers in one column to begin with. The fact that it makes sense to take an average of them indicates that they are the same entity, so rather than a table like this:
    id     col1     col2     col3     col4
    10     1          3     5
    11               2     4it would make more sense to have a table like this:
    id     val     attr
    10     1     1
    10     3     3
    10     5     4
    11     2     3
    11     4     4If you are stuck with a design like the former, with col1, col2, col3 and col4 (or ... col215) then you can Unpoivot the data into a form like the latter, with only 3 columns. Then you can use the AVG function.

  • Need help with union-by-size method

    Hello :)
    I'm having a problem with a union-by-size method.
    It was originally intended for a university assignment, but as I'm getting random errors by using it, I've changed to using union-by-heigth instead (which works flawlessly :-).
    But I'm still very much interested in finding out what I did wrong with the union-by-size implementation (as I belive it'd be the better method since I use path compression and a lot of find(x)).
    So if anyone can tell me what I'm doing wrong with the following code, I'd really appreciate it. As it is it is I'm getting ArrayIndexOutOfBoundsException with a positive much higher number than the array contains (ie. 1606 with a 900 long array)...
    (I've also gotten a few stackoverflows in main, but I guess that is more with too much printouts... )
    int[] union-by-size-array = new int[n*n] //implemented in other part of the code
    private void union (int root1, int root2){
            int temporaryInteger;
            if(union-by-size-array[root2] < union-by-size-array[root1]){
                temporaryInteger = union-by-size-array[root2];
                union-by-size-array[root1] = root2;
                union-by-size-array[navn2] += temporaryInteger;
            }else {
                temporaryInteger = union-by-size-array[root1];
                union-by-size-array[root2] = root1;
                union-by-size-array[root1] += temporaryInteger;
        }

    Ok, I'll supplement.
    n is given by the user as an argument.
    int nrOfDisJointSets = 1;
    int[][] board = new int[n][n];
    int[] ] union-by-size-array = new int[n+1];
        private void createNewNodeBoard(){
            for(int i = 0; i < n; i++){
                for(int j = 0; j <n; j++){
                    board[i][j] = createNode();
        private Node createNode(){
            Node newNode = new Node(nrOfDisJointSetst);
            union-by-size-array[nrOfDisJointSets] = -1;
            nrOfDisJointSets++;
            return newNode;
        }the union method is called by the following line
    union(find(x), find(y));navn2 is supposed to be root2 btw..

  • Need help with changing text size

    Hi everyone,
    I would like to allow users to easily change the text size of
    a website I am designing.
    To see an examplme, go to the Dell website (www.dell.com), on
    the bottom left there is a link to enlarge the text (or bring it
    back to normal size).
    Is this something that I can do through dreamweaver, or maybe
    CSS?
    Thanks in advance for your help!
    Jose

    This article may be of some use:
    http://www.alistapart.com/articles/alternate/
    Nadia
    Adobe® Community Expert : Dreamweaver
    ~~ CSS Templates |Tutorials |SEO Articles ~~
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au
    > I would like to allow users to easily change the text
    size of a website I
    > am
    > designing.
    >
    > To see an examplme, go to the Dell website
    (www.dell.com), on the bottom
    > left
    > there is a link to enlarge the text (or bring it back to
    normal size).
    >
    > Is this something that I can do through dreamweaver, or
    maybe CSS?
    >
    > Thanks in advance for your help!
    >
    > Jose
    >

  • Need help with find a specific letter in a sentence

    Hello, user has to input a sentence and then input word to find in a sentence
    then program has to tell how many times the word was used in the sentence
    forexample:
    program: please enter a sentence
    user: I am new to java
    program: Please enter the word
    user: e
    Program: e was used 7 times in the sentence
    I am very new to java, which comman should i use to find the word
    Thanks

    initiate a counter variable(int).
    Iterate your String with a for loop. Compare your charAt(iterator) to the given char.
    If charAt(Iterator) == givenChar then counter++.
    Et voila.

Maybe you are looking for

  • HT4848 How do I create a Recovery System on my start up volume/hard drive?

    So i discovered the article about using the Recovery Disk Assistant....but, I noticed it says that in order to create a Recovery on an external HD that it requires an existing Recovey System on my start up volume...I assume this means a Recovery part

  • Converting digits from display to tactile vibrations

    I would like to get a pulse or pulses for the some output.. i.e. i need to convert digital output (i.e. clock display to tactile display (vibrations)) if the clock or any display, displays 345, then i would have three switches on my module, i switch

  • Cannot disable the tax-only calculation in a AR Credit Notes document

    Hello, When trying to raise a tax only credit the following error message appears "Cannot disable the tax-only calculation in a AR Credit Notes document that was based on another document" I have two lines specified in the AR Credit Note screen both

  • HISTORY MANAGE CHECK BOX

    HI MASTERS, WHY WE UUSE HISTORY MANAGE CHECK BOX IN ASSET MASTER, AND IN ASSET CLASS, I THINKING  IT IS USED FOR UPLOADING THE ASSETS TO ASSET HISTORY SHEET IS IT. PLEASE GIVE REPLY THIS , POINTS WILL B ADDED.

  • I cannot remove the mp3tube toolbar search from the navigation bar

    I have a toolbar mp3tube that has taken over my searches. It seems to be part of yahoo but I have deleted all and it still comes back. It is making it impossible to use firefox for browsing.