Flash :: Calculate The X & Y Coords - Width And Height Of Specific Piece Of Text Inside A PDF Document
Oct 28, 2010
On my website, I display uploaded PDF files in a flash player for my users to read. I already use various tools to extract the text and produce a serious of high quality images from the file and the system works well. The last piece of the puzzle is to be able to highlight specific parts of the document to help users with accessibility issues.
However I cannot figure out how to calculate where the specific text is positioned on the page? Notes: The documents uploaded to the system are from 3rd parties, so fonts may be embedded. Meaning that I cannot be sure of the width of specific letters. The text to be highlighted may not be unique, the same text may be repeated How can I calculate the coordinates, height and width of a specific piece of text on a PDF, so that I can then draw a box around it?
View 1 Replies
Similar Posts:
Nov 3, 2011
What code can I use to shrink a piece of text in a dynamic text field to fit within a certain height and width.
View 1 Replies
Nov 18, 2009
I want to create a text box with a fixed width that will fit itself to its current text. So I went ahead and wrote this simple application[code]...
View 2 Replies
Jul 31, 2009
I am tweeing a bunch of rectangles randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added random rotation (between -30 and 30 degrees), the corners of my rectangles are still sticking out of the stage at the end of the tween.
If I trace objects width and height after the rotation I get the new values but this still doesnt help me because I am tweening to that rotation.
Code:
mc.rotation = 20;
trace(mc.width);
trace(mc.height);
View 5 Replies
Jul 30, 2009
I am tweeing a bunch of rectangular shaped objects randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added a random rotation between -30 & 30 degrees they still stick out of the stage a little.how could I calculate width & height of the these objects based on their final rotation so they dont stick out of the stage?
View 6 Replies
Oct 25, 2005
I am working on a 3d zoom function. How can I calculate it it best? I have a placeholder_mc:
width: 400
height:400
_x:0
_y:0
In the placeholder_mc I have 10 obj_mc's:
orig width:400, scaled in placeholder_mc: _xscale=20
orig height:400, scaled in placeholder_mc: _yscale=20
the _x and _y are random positions
Now I need a formula that make the placeholder_mc zoom into obj_mc inside and the placeholder_mc must be _xscaled, _yscaled so that the width and height of the clicked _mc are exactly 400x400.
for the _x and _y I use.. onEnterframe=
placeholder_mc._x=placeholder_mc._x+(placeholder_m c.obj_mc._x-placeholder_mc._x)/8;
placeholder_mc._y=placeholder_mc._y+(placeholder_m c.obj_mc._y-placeholder_mc._y)/8;
So this makes the placeholder_mc move to the correct position of the clicked object but how can I scale it now the placeholder_mc so that he moves and scales correct?
View 12 Replies
Apr 12, 2010
i'm using loadmovie() to load a youtube video player inside my flash website but i want to specify the width and height so it can fit my box.This is my code:
vloader.loadMovie("http://www.youtube.com/v/Alw5hs0chj0&hl=fr&fs=1hJ-mPcGtC");
I have an empty CLIP called "vloader" where i load the video player.Note: it is recommended that i get a code in Action script 1.0
View 2 Replies
Jul 29, 2010
I am trying to reference to top level (stage) width and height of the main stage for the placement of something located inside a movieclip on the stage.
My code is:
Code:
my_loader.x = (stage.stageWidth - my_loader.width)/2;
my_loader.y = (stage.stageHeight - my_loader.height)/2;
But this seems to just relate to the width/height of the mc that my_loader is nested in...
I have tried the following and had no luck:
stage.stage.stageWidth
root.stage.stageWidth
parent.stage.stageWidth
MovieClip(root).stage.stageWidth
View 8 Replies
Nov 10, 2009
Does anyone know how to get the width and height in ActionScript for a Flex application running inside the flash player in the web browser.
e.g. In the web browser I can use the tag to embed a Flex application (as a .swf). To the embed tag, I can provide the dimensions. I would like to get these dimensions inside the flex application action script.
View 2 Replies
Jun 4, 2003
I was wondering if it is possible to make a new pop up window with specific width and height... by just using actionscript ( not javascript ) ....
View 3 Replies
Jul 2, 2009
calculate textarea height based on the text length and fontsize in as2?
View 4 Replies
Aug 1, 2011
Waht is the right way to get 3D coords from 2D mouse coords using Away3D. (version 3.6.0) It's ambigoius problem in general, so there is restriction that 3D point belongs to some fixed plane.
There are some examples with camera.unproject and plane.getIntersectionLineNumbers methods, but they don't work if camera is rotated or plane is not trivial.
View 1 Replies
Jun 12, 2009
i want to load external images of different height and width into same height and width.
View 3 Replies
Feb 24, 2010
i want to load external images of different height and width into same height and width.
View 0 Replies
Mar 25, 2011
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
View 1 Replies
Mar 7, 2012
We are trying to get a Rectangle that represents the exact* boundary of the text in a TextField.
*Exact as possible.
Take this image:
Using my current knowledge, I can retrieve the blue rectangle above like so:
var textRect:Rectangle = new Rectangle(
field.x,
field.y,
[Code]....
Even if I fill a small section with the color I'm looking for I still get a zero-sized rectangle:
bmd.fillRect(new Rectangle(0, 0, 30, 30), textField.textColor);
View 2 Replies
Feb 5, 2009
I am using this script (3.0) to set the text of a dynamic text field...
stop();
my_Btn.addEventListener(MouseEvent.MOUSE_OVER, onMouseover);
function onMouseover(event:MouseEvent):void
[Code].....
How do I set the height and width of the text?
View 1 Replies
Feb 22, 2005
how do i make a button trigger a movie clip that targets specific coords? I'm building a map and when a button is click it goes to a defined point. right now it jumps to the coords, but i'd much rather it smoothly move instead. the other thing is that i would like it to move from whatever point it is currently at.
View 11 Replies
Jun 21, 2011
I'm trying to apply the code below to a movieclip, so that any text can be entered and the movieclip's height and width of its text field will resize automatically. Does anyone know how to apply this code to a movieclip? If you could write any sample code or make changes to my code that
[Code]...
View 1 Replies
Mar 10, 2010
I know this is possible to be done using javascript, and I presume I could get the values to flash calling js, but I'm looking for any AS3 library/code that does the same.
js examples: [URL]
View 1 Replies
Mar 25, 2011
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
View 3 Replies
Jun 1, 2010
I am looking at the SimpleButton entirely wrong. Here's what I'm doing (inside of a MovieClip):
[Code]...
the close_btn.width and height remain 0. Am I supposed to just rely on the DisplayObject members of the SimpleButton completely and ignore width/height/x/y or what?
View 2 Replies
Aug 22, 2009
trace ("The Width is: " + stage.width + "."); trace ("The Height is: " + stage.height + "."); The Width is: 0. The Height is: 0. Why is it Zero instead of the document's size ?
View 2 Replies
Jul 26, 2011
I'm trying to edit an HTML that uses swfobject to load a flash file.
What I'm trying to do is to reduce the size of the SWF file.
I've tried editing the height and width parameter within the swfobject(), but that didn't work.
I tried reducing the width height in the HTML css, but that also didn't work..
How can I pass a 'width' or a 'height' parameter to the swfobject so it will actually load the swf in a smaller or 'zoomed out' way?
View 2 Replies
Apr 5, 2012
I have many dropdowns in my flex application. Now I want to set rowCount property so that as many rows as possible so there is less scrolling when see the dropdown items.The flex application was running on a popup window. So I think I have to know the distance from dropdown to bottom border of window, and then calculate what number should be for the rowCount. Like Height/per row height.As I known, the dropdown.y is the relative y coordinate of itself. But my dropdown has many parent UI layout component, and also I have many dropdowns, it is hard to calculate one by one.
View 1 Replies
Jun 3, 2010
I have three datagrids inside VBox container. Since I don't want scrollbar in my flex widget i am increasing the height of SWF through javascript, which increases with each addition of row in my datagrid. My query is how can I get the exact height of my VBox which is the parent element of datagrid. I am not able to get the height of VBox. I have tried to use measuredHeight,height with no success.
View 1 Replies
Jan 26, 2010
I'm loading a flash MovieClip (Test.swf) like below. The problem is I can't read the size of mc (mc.width and mc._width both return 0, for the height as well), but I need to scale it. I have the stage size, I can scale, but I don't have the size of Test.swf, so I can't scale it to fit into the stage... ActionScript2, not actionscript3. If it was 3, I could get the value from the loader, but with as2??? The problem is I don't have control over the swf I load, so I can't put it's dimensions in the first frame...
[Code]...
View 1 Replies
Feb 22, 2010
package
{
import flash.display.*;
[code].....
View 3 Replies
Mar 27, 2010
swfObject embed has the following signature,swfobject.embedSWF(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn)with width and heigth required attributes,What can I do to signify dynamic height and width.
View 4 Replies
Apr 18, 2011
In the following code Only the button image has been embeded into the flex code. But in the html object or embed tag why the height and width has to be specified. Even though for this is a normal button if we do not specify the height and width there seems to be some error
HTML
<div align="center"><br />
<div style="display:block;width:100px;height:100px;" id="audio"
class="testsound" align="center"/>
<p class="clickable">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100" id="myMovieName">
[Code] .....
View 3 Replies