Object coordinates

Hi
I want to know about indesign object coordinates.
In .indd file coordinates take 32 byte for any coordinate for top, left, bottom, right or (x, y, width, height).
How calculate x and y value from these 8-8 byte.It contain floting value but not follow IEEE standered.
What format use to store coordinate in indesign .indd file.
When I create a text frame in indesign on first page using Facing option whose value are
X=0, Y=0, Width=50,Height=50 and ruler is set on (0,0).I am not using any rotation.
Then I find the 32 byte for this in .indd file
00 00 00 00 00 00 22 C0
67 BD 78 7C 6C 91 7A C0
EE 76 BB DD 6E D7 62 40
F0 01 9B CD 66 63 71 C0
How calculate x , y width, height value from these hex byte.
What standered use by indesign to store coordinate.
Is there is any function in sdk that take these hex value and return coordinate.
Thanks

Hi  Jongware
Thanks for Reply
According you i try to convert these byte using double-precision binary floating point format but i am not getting my answer.
I am sending some screen shot of these byte. Plz help me  to get  x and y coordinate.
I am creating textframe in indesign using Facing with default setting and set x=0 mm , y=0 mm,w=50 mm, h=50 mm for textframe.
and get hex value
x = 00000000000022c0 // (after converting in double-precision binary floating point i get  -8)
y =67bd787c6c917ac0   //(after converting in double-precision binary floating point i get  -425.088985892906)
w =(EE76BBDD6ED76240 - 00000000000022C0) //(after converting EE76BBDD6ED76240  in double-precision binary floating point i get  150.732283464567)
H= (F0019BCD666371C0 - 67bd787c6c917ac0) //(after converting F0019BCD666371C0  in double-precision binary floating point i get  -278.212598424433)
According my information
InDesign  coordinates are measured relative to the current location of the ruler’s zero point; the vertical (Y-axis) coordinates below the zero point are positive numbers; coordinates above the zero point are negative numbers.
When you get or set  the location of a path point, the coordinates are passed and returned in the typical (x, y) order. InDesign returns some coordinates in a different order, however, and it expects you to supply them in that order. Geometric bounds and visible bounds are arrays containing four coordinates, which define (in order) the top, left, bottom, and right edges of the object’s bounding box,  (y1, x1, y2, x2).
I am not understand that i follow the right approch Plz help me  as soon as possible.
I am waiting for your reply.
Thanks

Similar Messages

  • Indesign Object Coordinates

    Hi
    I want to know about indesign object coordinates.
    In .indd file coordinates take 32 byte for any coordinate for top, left, bottom, right or (x, y, width, height).
    How calculate x and y value from these 8-8 byte.It contain floting value but not follow IEEE standered.
    What format use to store coordinate in indesign .indd file.
    When I create a text frame in indesign on first page using Facing option whose value are
    X=0, Y=0, Width=50,Height=50 and ruler is set on (0,0).I am not using any rotation.
    Then I find the 32 byte for this in .indd file
    00 00 00 00 00 00 22 C0
    67 BD 78 7C 6C 91 7A C0
    EE 76 BB DD 6E D7 62 40
    F0 01 9B CD 66 63 71 C0
    How calculate x , y width, height value from these hex byte.
    What standered use by indesign to store coordinate.
    Is there is any function in sdk that take these hex value and return coordinate.
    Thanks

    Hi Bill joy,
    Check this out....
    //COORDINATES
    test();
    function test(){
    //alert(myDocument.rectangles.item(0).resolve(AnchorPoint.TOP_LEFT_ANCHOR,CoordinateSpaces .INNER_COORDINATES)[0]);
    var rectangleCount=myPage.rectangles.count();
    var i = 0;
    var coordinates=[];
    var multi=[];
    var multi1=[];
    for(var j=0;j<=rectangleCount-1;j++){
        var coordinatesValue = myDocument.rectangles[j].paths[0].pathPoints;
        for (; i < coordinatesValue.length; i++) {
         coordinates[i]=(coordinatesValue[i].anchor);
    //alert(coordinates);
    var i=0;
    multi[j]=coordinates[i][i];
    multi1[j]=coordinates[i][i+1];
    alert(multi[j]);
    alert(multi1[j]);

  • Object coordinates relative to selected artboard.

    What controls origon (x,y = 0,0) of a objects coordinates? I'm not refering to which the "Reference Point".
    I use a bunch of artboards and sometimes origon originates from the newest artboard i have created, which is great for my workflow. I place a lot of objects using the top coordination tool.
    But often the origon fixes it's position to the first artboard. Is there a way to control the origon?
    Specs: Win7, 64bit, Illustrator CS6 16.0.3.
    Best regards
    Kristian Bendsen
    Game artist

    Click in the top left square of the rulers to reset
    If you are having trouble with items pasting on the wrong artboard, keep your artboards palette visible, and highlight the artboard you want to paste into.

  • How to omit component's coordinates in xml serialisation

    Hi colleagues,
    my application uses XMLEncoder to serialize JPanel component (it's coordinates). The generated XML is like this:
    <object class="MyJPanel">
    <void property="bounds">
    <object class="java.awt.Rectangle">
    <int>28</int>
    <int>93</int>
    <int>227</int>
    <int>162</int>
    </object>
    </void>
    </object>
    Coordinates are measured in pixels. It is problem for me. I need to serialize component's coordinates in some screen independent measurement. E.g. in milimeters. I can add properties for bounds representation of the components in milimeters. But I do know, how to OMIT default bounds pixels serialization. I.e. I would like to receive serialization like this:
    <object class="sk.gnome.sf9.Block">
    <void property="widthInMilimeters">
    <double>100</double>
    </void>
    <void property="heightInMilimeters">
    < double >130</double >
    </void>
    </object>
    I did some experiments with extending the SimpleBeanInfo class, but nothing was successful. Can anybody give some advice?

    Hi,
    If you wish to change the Default serialization behaviour then you have to override the read and write methods provided when you implemented Serializable.
    So for example I have my own version of a hashTable which I override the readObject and writeObject methods,,, take a look at the JPanel source to see how it saves and restores the object. If no behaviour is defined then assume that EVERY global object/primitive which is not "transient" is being saved.
    //** Serializable interface, write
    private synchronized void writeObject(ObjectOutputStream lOOS) throws IOException
         // Write out the threshold and loadfactor
         lOOS.defaultWriteObject();
         // Write out length, count of elements and then the key/value objects
         lOOS.writeInt(table.length);
         lOOS.writeInt(size);
         for (int lCount = table.length - 1; lCount >= 0; lCount--)
         DataRListEntry lEntry = table[lCount];
         while (lEntry != null)
              lOOS.writeObject(lEntry.value);
              lEntry = lEntry.next;
    //** Serializable interface, read
    private void readObject(ObjectInputStream lOIS) throws IOException, ClassNotFoundException
         // Read in the threshold and loadfactor
         lOIS.defaultReadObject();
         // Read the original length of the array and number of elements
         int lLength = lOIS.readInt();
         int lSize = lOIS.readInt();
         // Compute new size with a bit of room 5% to grow but
         int lTable = (int)(lSize * loadFactor) + (lSize / 20) + 3;
         if (lTable > lSize && (lTable & 1) == 0) lTable--;
         if (lLength > 0 && lTable > lLength) lTable = lLength;
         table = new DataRListEntry[lTable];
         size = 0;
         // Read the number of elements and then all the key/value objects
         for (; lSize > 0; lSize--)
         Object value = lOIS.readObject();
         put(value);
    }

  • What function to set coordinate system in 6i with API?

    #define D2FP_COORD_SYS 72
    here's the define that relates to what i want to do.
    what are the names of the functions that set/get the coordinate system. (i want to set it to character and change the default units)
    thanks,
    [email protected]

    The Other missing Header file :-) - d2fcrd.h - In fact this is shipped in the Forms API lauchpad on the Forms section on OTN. But here it is anyway:
    /* Copyright (c) Oracle Corporation 1996.  All Rights Reserved. */
       NAME
        D2FCRD.H -- Dev2K Forms API CooRDinate system declarations
       DESCRIPTION
        Contains the public declarations for the Forms API CooRDinate system
       PUBLIC FUNCTIONS
        d2fcrdcr_Create          - Cover for d2fobcr_Create
        d2fcrdde_Destroy         - Cover for d2fobde_Destroy
        d2fcrddu_Duplicate       - Cover for d2fobdu_Duplicate
        d2fcrdex_Extract         -
        d2fcrdap_Apply           -
        d2fcrdg?_Get*Prop        - Cover for d2fobg?_Get*Prop
        d2fcrds?_Set*Prop        - Cover for d2fobs?_Set*Prop
        d2fcrdhp_HasProp         - Cover for d2fobhp_HasProp
        d2fobcs_CharSize
        d2fobss_StringSize
    #ifndef D2FCRD
    #define D2FCRD
    #ifndef ORATYPES
    # include <oratypes.h>
    #endif
    #ifndef D2FPRIV
    # include <d2fpriv.h>
    # endif
    /* C++ Support */
    #ifdef __cplusplus
    extern "C"
    #endif
    ** Object: Coordinate Info
    ORA_RETTYPE(d2fstatus) d2fcrdcr_Create( d2fctx *pd2fctx, d2fcrd **ppd2fcrd );
    ORA_RETTYPE(d2fstatus) d2fcrdde_Destroy( d2fctx *pd2fctx, d2fcrd *pd2fcrd );
    ORA_RETTYPE(d2fstatus) d2fcrddu_Duplicate( d2fctx *pd2fctx,
                                               d2fcrd *pd2fcrd_src,
                                               d2fcrd **ppd2fcrd_dst );
    ORA_RETTYPE(d2fstatus) d2fcrdex_Extract( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                             d2ffmd *pd2ffmd );
    ORA_RETTYPE(d2fstatus) d2fcrdap_Apply( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                           d2ffmd *pd2ffmd );
    ORA_RETTYPE(d2fstatus) d2fcrdgb_GetBoolProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                 ub2 pnum, boolean *pprp );
    ORA_RETTYPE(d2fstatus) d2fcrdgn_GetNumProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                ub2 pnum, number *pprp );
    ORA_RETTYPE(d2fstatus) d2fcrdgt_GetTextProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                 ub2 pnum, text **pprp );
    ORA_RETTYPE(d2fstatus) d2fcrdgo_GetObjProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                ub2 pnum, dvoid **pprp );
    ORA_RETTYPE(d2fstatus) d2fcrdgp_GetBlobProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                ub2 pnum, dvoid **pprp );
    ORA_RETTYPE(d2fstatus) d2fcrdsb_SetBoolProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                 ub2 pnum, boolean prp );
    ORA_RETTYPE(d2fstatus) d2fcrdsn_SetNumProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                ub2 pnum, number prp );
    ORA_RETTYPE(d2fstatus) d2fcrdst_SetTextProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                 ub2 pnum, text *prp );
    ORA_RETTYPE(d2fstatus) d2fcrdso_SetObjProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                ub2 pnum, dvoid *prp );
    ORA_RETTYPE(d2fstatus) d2fcrdsp_SetBlobProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                                ub2 pnum, dvoid *prp );
    ORA_RETTYPE(d2fstatus) d2fcrdhp_HasProp( d2fctx *pd2fctx, d2fcrd *pd2fcrd,
                                             ub2 pnum );
    ** These will eventually move to d2fob.h
    ORA_RETTYPE(d2fstatus) d2fobss_StringSize( d2fctx *pd2fctx,
                                               text *str,
                                               d2ffnt *pd2ffnt,
                                               d2fcrd *pd2fcrd,
                                               number *width,
                                               number *height );
    ORA_RETTYPE(d2fstatus) d2fobcs_CharSize( d2fctx *pd2fctx,
                                             number width,
                                             number height,
                                             d2ffnt *pd2ffnt,
                                             d2fcrd *pd2fcrd,
                                             number *char_width,
                                             number *char_height );
    /* Begin convenience macros  */
    #define d2fcrdg_char_cell_hgt(ctx,obj,val) \
               d2fcrdgn_GetNumProp(ctx,obj,D2FP_CHAR_CELL_HGT,val)
    #define d2fcrdg_char_cell_wid(ctx,obj,val) \
               d2fcrdgn_GetNumProp(ctx,obj,D2FP_CHAR_CELL_WID,val)
    #define d2fcrdg_coord_sys(ctx,obj,val) \
               d2fcrdgn_GetNumProp(ctx,obj,D2FP_COORD_SYS,val)
    #define d2fcrdg_dflt_fnt_scaling(ctx,obj,val) \
               d2fcrdgb_GetBoolProp(ctx,obj,D2FP_DFLT_FNT_SCALING,val)
    #define d2fcrdg_real_unit(ctx,obj,val) \
               d2fcrdgn_GetNumProp(ctx,obj,D2FP_REAL_UNIT,val)
    #define d2fcrds_char_cell_hgt(ctx,obj,val) \
               d2fcrdsn_SetNumProp(ctx,obj,D2FP_CHAR_CELL_HGT,val)
    #define d2fcrds_char_cell_wid(ctx,obj,val) \
               d2fcrdsn_SetNumProp(ctx,obj,D2FP_CHAR_CELL_WID,val)
    #define d2fcrds_coord_sys(ctx,obj,val) \
               d2fcrdsn_SetNumProp(ctx,obj,D2FP_COORD_SYS,val)
    #define d2fcrds_dflt_fnt_scaling(ctx,obj,val) \
               d2fcrdsb_SetBoolProp(ctx,obj,D2FP_DFLT_FNT_SCALING,val)
    #define d2fcrds_real_unit(ctx,obj,val) \
               d2fcrdsn_SetNumProp(ctx,obj,D2FP_REAL_UNIT,val)
    /* End convenience macros  */
    /* C++ Support */
    #ifdef __cplusplus
    #endif
    #endif /* D2FCRD */

  • Can I place all my SQL's in one object?

    Hi,
    Is there a way to have a business component
    object where I can place all my SQL's and
    call methods off of it.
    A method that displays that selects all
    items in an item table
    Say.. I have a select where the 'where'
    clause will change upon user choice or
    the 'order by' clause changes according to
    the user's sorting preference.
    Similarly with other SQL's without
    associating the business component to one
    perticular table or view.
    Any Help, Ideas Greatly appriciated..
    Thanks,
    Rajan

    The Business Components for Java framework supports the "View Object" component that encapsulates a SQL statement and makes it easy to work with its result set.
    View Objects can be created at design time using the View Object wizard, so that their SQL statement can be pre-determined, or they can be created at runtime with a completely dynamic SQL statement.
    Any View Object supports the ability to programmatically augment its WHERE clause with additional predicates, set bind variable values, and other common operations.
    View Objects coordinate with Entity Objects to enable your result set to be fully scrollable and fully updateable, no matter how many underlying entity object may be participating in the join query.
    You can set a View Object to bet in "Forward Only Mode" to more efficient read through the data if you do not need to cache or update it. For example, to "rip" forward only through some data to format it for display on a web page.

  • 3d object moves when merging

    So I haven't played with the 3d features in Photoshop very much and gave myself (what I thought) was a simple project to play with. I'm trying to make a little cog with a recessed color band. Have been doing an extrusion using vector objects.
    I extruded them both separately, the gear to 2" the blue ring to 1.6". Matched up the camera and set them both to the same position
    Gear                                                         Ring
    I then made sure the cameras were in the same default position and tried to merge them 3D -> Merge 3D Layers. I read that I should hold shift to make sure the objects position doesn't change so I did that but it doesn't seem to make any difference because once I merge them the gear wheel scoots out of position and shrinks. I thought maybe I wasn't holding shift long enough but even holding it from before I ever click into the menu until well after it appears the merge is complete it does the same thing.
    Gear                                                          Ring
    The ring stays in position but the gear scoots forward and shrinks. I could just manually change the numbers back but I'm hoping to add more elements and taking a screen shot of each property before merging seems like I must be missing something.
    I'm on a PC running Windows 7 using Photoshop CC 2014.2.2

    I downloaded the psd.  You created the shapes layers with a Adobe program I do not use.  Then extruded them and merged and see the same thing I see when merging objects. They do not lineup like you expect them to.  I wrote. What I do reset the object coordinates I forgot to add was I also use the move to ground button for the objects after the using the reset Coordinates button.  Then I use the move tool to line up the objects relative to each other.   I duped you document and did that to your merged objects.  Here is the duped PSD with the objects reset mover to ground then positioned. Is this what you expected the merge to look like? http://www.mouseprints.net/old/dpr/GearTestDupe.psd
    Right click the above link and save it to your machine

  • Find out object in buffered image cature by JMF

    hi friends ..
    i doing one project in which i want to simulate real time object motion in java 2d ..
    for this using web cam i success fully capture image and buffered in pixel array ....
    now i want object coordinate to simulate it in 2d .. ..
    imagine human motion . and i want simulate it in form of human skeleton ... so make a skeleton i want coordinate
    and by change coordinate frame by frame .. i want to simulate it ..
    so suggest some thing relevant ..
    thanks in advance ..

    user5228856 wrote:
    the solution you give me l give me a all out report ,
    what i need is
    select <<>>
    from <<>>
    where object_name = owner.object_name
    result set should return what all db user has select priv on the given object.site below contains desired code
    http://www.petefinnigan.com/tools.htm

  • Merge-Down Layers on 3D Object Vanishing - Bug?

    I can only assume this is some kind of bug but I would welcome any advice or even just hearing if anyone else is experiencing this problem:
    I have a 3D layer with an object that has 2048px texture layers. The 3D document is 5000px (big so that there is some quality maintained when painting in 3D mode)
    I create a 2D layer above the 3D layer and add something on that layer (dosen't really matter what - say just a filled square)
    I do a merge down from the 2D onto the 3D layer.
    Here is what I see:
    Case 1)
    If I turn off the merged 2D layer's visibility but the 3D layer dosen't show the merged content until I make a small rotation then it appears. If I open the 2D texture of the 3D layer the content instantly vanishes, or if I rotate around for a while eventually the merged content vanishes.
    Case 2)
    If I open up the texture layer before doing the merge then I will actually see the content in the texture after the merge - but it still vanishes before my eyes if I even click between the 2D and 3D layer
    Workaround:
    The only way around this I have found is:
    1) Open the texture layer
    2) do the merge
    3) duplicate the texture layer before doing anything else
    If I follow the aorkaround then I can keep the merged content.
    Obviously this is some kind of issue - but I'm not sure with what. Here are my system particulars:
    Photoshop CS5 - PC (this happens in both 23 and 64 bit versions exactly the same)
    System:  Win 7sp1 x64 16Gb RAM Corei5 2500K
    Nvidia GTX 570 with 266.58 drivers

    I downloaded the psd.  You created the shapes layers with a Adobe program I do not use.  Then extruded them and merged and see the same thing I see when merging objects. They do not lineup like you expect them to.  I wrote. What I do reset the object coordinates I forgot to add was I also use the move to ground button for the objects after the using the reset Coordinates button.  Then I use the move tool to line up the objects relative to each other.   I duped you document and did that to your merged objects.  Here is the duped PSD with the objects reset mover to ground then positioned. Is this what you expected the merge to look like? http://www.mouseprints.net/old/dpr/GearTestDupe.psd
    Right click the above link and save it to your machine

  • Relative Object Position

    It would be nice to have option to chose
    from where object coordinates are measured (Page, Margines, Spread...)
    For example, you want to move your object 10mm from margine,
    or just want to check how far is it from margine...
    tomaxxi

    Well, here it is....
    My idea is to add little icon to chose from where position would be measured...
    I worked out just two examples, but it could be more... like Spline, Spread, Object...
    I dont fint moving zero point so effective if you work in facing pages and multipages document...
    And I dont see why you are talking about databases....
    First example:
    Position origin is Page or in my case document zero point...
    Second example:
    Position origin is Margin, so position of object is calculated be substracting margin width and height...
    So, you dont have to move your document zero point...
    Thanks for listening...
    tomaxxi

  • Sending /receiving object data from JavaNIO bytebuffer

    Hello All,
    i have designed a real time Physics simulation with javanio , which is about moving balls simultaneously (real time) on multiple clients.
    Currently, i m sending the coordinates of one ball with string parsing, but now i want to move multiple balls and want to have some generic mechanism other than sending string, so i create 4 balls on server.
    my design with string base is already running (one ball which is running from server, receiving coordinates as string on clients now i want more balls so i have problem to send the coordinate for each ball and receiving the same on client to draw while there are no reference attach to those which ball correspond to which ball on client) but i need little bit generic solution which can be valid for other simulations too.
    This should be realized by sending the reference of each ball but i don't have idea how to realized that with java byte buffer and with javanio overall.
    how i can realized, so that coordinates of each ball correspond to same ball on client (which i created on client too), and each ball can be move according to its received coordinates from the sever.
    I have the problem with implementation, if somebody help me with code example , it would be great, anyway which can be generic for sending simulation data like object coordinates other than strings can be acceptable(if somebody did similar work) but it should implement the usecase as i described.
    Thanks,
    Jibbylala
    PS: i saw this post:http://www.coderanch.com/t/276259/Streams/java/Convert-ByteBuffer-object
    they are sending the whole object but i just wanted to send
    Ball.X ,Ball[i].Y and receive the same at client sit
    Edited by: 805185 on Mar 20, 2011 8:29 PM

    I think the question here is that if you have n balls on the server, and you receive coordinates on the client, how the client will know for which ball the coordinates are meant. The answer is pretty simple: just modify your protocol to send the ball number before you send the coordinates. You say you currently use strings to represent the coordinates. Say your string currently looks like this: x|y, where x is the x-coordinate, | the separator and y the y coordinate. You could modify this string as follows: n|x|y, where n is the ball number, x the x coordinate and y the y coordinate. This way the client knows for which ball the coordinates are meant.
    If you want to avoid the string parsing, use the ByteBuffer.putDouble() and ByteBuffer.putInt() methods as suggested by EJP.

  • How to email a Movie Clip in Flash

    Hi everyone.
    I am creating a painting / drawing application in flash.
    I want to add a functionality, which allows the user to send his/her painting to his/her email address.
    How can this be done?
    Please note that the painting / drawing would be a movie clip
    Help on an urgent basis would be greatly appreciated
    Thanks

    Hi,
    I did something similar for AS2:basically there was a "designer" swf where one could interact to create a design,
    and a "viewing" swf that contained all the bits and pieces used (e.g. a blank t-shirt).
    The designer swf would send data (placement of objects, coordinates of strokes) to the server, and the server would amend the blank viewer swf by compiling the data object and adding it as another code block. The code of the viewing swf would handle constructing the desired image, by placing objects, adding strokes, etc.
    With the simple structure of AS2 code, php could do that.
    I sort of believe that something similar could be done for AS3 if the server is able to run java (the flex sdk programs). Addition: PHP by itself should be able to replace an embedded text file ... such as an xml description of the artwork

  • Can i use this script in illustrator?

    can i use this script in illustrator?
    Newsgroup_User

    // This script exports extended layer.bounds information to [psd_file_name].xml
    // by pattesdours
    function docCheck() {
        // ensure that there is at least one document open
        if (!documents.length) {
            alert('There are no documents open.');
            return; // quit
    docCheck();
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var docRef = activeDocument;
    var docWidth = docRef.width.value;
    var docHeight = docRef.height.value;
    var mySourceFilePath = activeDocument.fullName.path + "/";
    //  Code to get layer index / descriptor
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    function getLayerDescriptor (doc, layer) {
        var ref = new ActionReference();
        ref.putEnumerated(cTID("Lyr "), cTID("Ordn"), cTID("Trgt"));
        return executeActionGet(ref)
    function getLayerID(doc, layer) {
      var d = getLayerDescriptor(doc, layer);
      return d.getInteger(cTID('LyrI'));
    var stackorder = 0;
    // function from Xbytor to traverse all layers
    traverseLayers = function(doc, ftn, reverse) {
      function _traverse(doc, layers, ftn, reverse) {
        var ok = true;
        for (var i = 1; i <= layers.length && ok != false; i++) {
          var index = (reverse == true) ? layers.length-i : i - 1;
          var layer = layers[index];
          //  alert("layer.typename  >>> "+layer.typename ); 
          if (layer.typename == "LayerSet") {
            ok = _traverse(doc, layer.layers, ftn, reverse);
          } else {
      stackorder = stackorder + 1;
            ok = ftn(doc, layer, stackorder);
        return ok;
      return _traverse(doc, doc.layers, ftn, reverse);
    // create a string to hold the data
    var str ="";
    // class using a contructor
    function cLayer(doc, layer) {
    //this.layerID = Stdlib.getLayerID(doc, layer);
      this.layerID = getLayerID(doc, layer);
      //alert("layer ID: " + this.layerID);
      this.layerWidth = layer.bounds[2].value - layer.bounds[0].value;
          this.layerHeight = layer.bounds[3].value - layer.bounds[1].value;
      // these return object coordinates relative to canvas
          this.upperLeftX = layer.bounds[0].value;
          this.upperLeftY = layer.bounds[1].value;
          this.upperCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.upperCenterY = layer.bounds[1].value;
          this.upperRightX = layer.bounds[2].value;
          this.upperRightY = layer.bounds[1].value;
          this.middleLeftX = layer.bounds[0].value;
          this.middleLeftY = this.layerHeight / 2 + layer.bounds[1].value;
          this.middleCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.middleCenterY = this.layerHeight / 2 + layer.bounds[1].value;
          this.middleRightX = layer.bounds[2].value;
          this.middleRightY = this.layerHeight / 2 + layer.bounds[1].value;
          this.lowerLeftX = layer.bounds[0].value;
          this.lowerLeftY = layer.bounds[3].value;
          this.lowerCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.lowerCenterY = layer.bounds[3].value;
          this.lowerRightX = layer.bounds[2].value;
          this.lowerRightY = layer.bounds[3].value;
       // I'm adding these for easier editing of flash symbol transformation point (outputs a 'x, y' format)
       // because I like to assign shortcut keys that use the numeric pad keyboard, like such:
       // 7 8 9
       // 4 5 6
       // 1 2 3
          var windowW=2048;
          var windowH=1536;
       this.leftBottom = this.lowerLeftX + ", " + (windowH-this.lowerLeftY);
       this.bottomCenter = this.lowerCenterX + ", " +  (windowH-this.lowerCenterY);
       this.rightBottom = this.lowerRightX + ", " + this.lowerRightY;
       this.leftCenter = this.middleLeftX + ", " + this.middleLeftY;
       this.center = this.middleCenterX + ", " + this.middleCenterY;
       this.rightCenter = this.middleRightX + ", " + this.middleRightY;
       this.leftTop = this.upperLeftX + ", " + this.upperLeftY;
       this.topCenter = this.upperCenterX + ", " + this.upperCenterY;
       this.rightTop = this.upperRightX + ", " + this.upperRightY;
      // these return object coordinates relative to layer bounds
          this.relUpperLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relUpperLeftY =  layer.bounds[0].value - layer.bounds[0].value;
          this.relUpperCenterX = this.layerWidth / 2;
          this.relUpperCenterY = layer.bounds[0].value - layer.bounds[0].value;
          this.relUpperRightX = this.layerWidth;
          this.relUpperRightY = layer.bounds[0].value - layer.bounds[0].value;
          this.relMiddleLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relMiddleLeftY = this.layerHeight / 2;
          this.relMiddleCenterX = this.layerWidth / 2;
          this.relMiddleCenterY = this.layerHeight / 2;
          this.relMiddleRightX = this.layerWidth;
      this.relMiddleRightY = this.layerHeight / 2;
          this.relLowerLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relLowerLeftY = this.layerHeight;
          this.relLowerCenterX = this.layerWidth / 2;
      this.relLowerCenterY = this.layerHeight / 2;
          this.relLowerRightY = this.layerHeight;
          this.relLowerRightX = this.layerWidth;
          this.relLowerRightY = this.layerHeight;
      return this;
    // add header line
    str = "<psd filename=\"" + docRef.name + "\" path=\"" + mySourceFilePath + "\" width=\"" + docWidth + "\" height=\"" + docHeight + "\">\n";
    // now a function to collect the data
    var isParentAvailable=false;
    var prevLayerSetName="";
    function exportBounds(doc, layer, i) {
        var isVisible = layer.visible;
        var layerData = cLayer(doc, layer);
    //alert("layer.name  >>> "+layer.name );
    //alert("typename >>> "+layer.typename);
    /*if(layer.parent.name == "ParentTest"){
    for(var i in layer.parent){
        alert(" III >>> "+i+"<<<layer.parent>>"+layer.parent[i]);
      if(isVisible){
    // Layer object main coordinates relative to its active pixels
    var startStr="";
        if(layer.parent.typename=="LayerSet"){
            if(prevLayerSetName!="LayerSet")    {
                startStr="\t<parentlayer id='"+layer.parent.name+"'>\n\t";
            }else{
                   startStr="\t";
            // endStr="\t</parentlayer>\n";
             prevLayerSetName=layer.parent.typename;
          }else{
               if(prevLayerSetName=="LayerSet"){
                    startStr="\t</parentlayer>\n";
                prevLayerSetName="";
      var positionStr=layer.name.split(".")[0].substr(layer.name.split(".")[0].length-3,layer.name. split(".")[0].length);
      var assetPosition=leftTop;
      if(positionStr=="L_B"){
      assetPosition=leftBottom;
      }else if(positionStr=="B_C"){
      assetPosition=bottomCenter;
      }else if(positionStr=="R_B"){
      assetPosition=rightBottom;
      }else if(positionStr=="L_C"){
      assetPosition=leftCenter;
      }else if(positionStr=="C"){
      assetPosition=center;
      }else if(positionStr=="R_C"){
      assetPosition=rightCenter;
      }else if(positionStr=="L_T"){
      assetPosition=leftTop;
      }else if(positionStr=="T_C"){
      assetPosition=topCenter;
      }else if(positionStr=="R_T"){
      assetPosition=rightTop;
      var str2 =startStr+ "\t<layer name=\"" + layer.name
      + "\" stack=\"" + (i - 1) // order in which layers are stacked, starting with zero for the bottom-most layer
      + "\" position=\"" + assetPosition // this is the
      + "\" layerwidth=\"" + layerData.layerWidth
      + "\" layerheight=\"" + layerData.layerHeight
      + "\" transformpoint=\"" + "center" + "\">" // hard-coding 'center' as the default transformation point
      + layer.name + ".png" + "</layer>\n" // I have to put some content here otherwise sometimes tags are ignored
    str += str2.toString();
    // call X's function using the one above
    traverseLayers(app.activeDocument, exportBounds, true);
    // Use this to export XML file to same directory where PSD file is located
        var mySourceFilePath = activeDocument.fullName.path + "/";
    // create a reference to a file for output
        var csvFile = new File(mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".xml");
    // open the file, write the data, then close the file
    csvFile.open('w');
    csvFile.writeln(str + "</psd>");
    csvFile.close();
    preferences.rulerUnits = originalRulerUnits;
    // Confirm that operation has completed
    alert("Operation Complete!" + "\n" + "Layer coordinates were successfully exported to:" + "\n" + "\n" + mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".xml");

  • Using a timer as a score system

    Hey Actionscripters,
    I've recently started using Flash (Action Script 2.0). For one of the projects at school they are getting us to essentially make our own puzzle games from scratch.
    On the frame at which the puzzle sits I have a big button that says start. Clicking this button makes the first puzzle piece appear on stage and when you place it within set coordinate the next puzzle piece is moved on stage and so on until piece 9; the final piece were it goes to the next frame - The score frame/winning frame?
    Pretty simple, but another function the start button has is it starts a timer (timer is a var name set to a dynTextbox). Essentially I want it so that when the final piece of the puzzle is placed the timer is stopped and the time that it stopped on is saved and put on the score tab, plus stored in a var or something so that I can use it later.
    I made the timer, but when I sorta figured out how to make it trace the last number in the timer I broke it and have hit a wall with no idea what to do.
    Here are my codes:
    START button -
    Code:
    on (release){
              timer = 0; //Sets the variable to 0
              countup = function(enabled:Boolean){ //Creating the countup function
                        if (enabled == true) {
                                  timer += 1; //timer function
                        } else {
                                  timer = timer;
                        _root.btn_llamastart.enabled = false;
    on (release){
              countupInterval = setInterval(countup,1000); //Set the counting internval to X
              setProperty(_root.llama_p1, _x, "640.80");
              setProperty(_root.llama_p1, _y, "164.30");
    Piece 9 (last piece) -
    Code:
    on (press) { //On event 'press'
              startDrag(this); //Starts draging object }
    on (release) {
              stopDrag(); //Stops dragging
        if ((this._x >0) && (this._x < 30) && (this._y >260) && (this._y <360)) {  // if puzzle pieces is within these set boundaries
                  setProperty(this, _x,"14.60"); //Set objects coordinates to set ones
                  setProperty(this, _y,"314.25"); //Set objects coordinates to set ones
                        gotoAndStop(4);
                        var totalTime:Number = _root.timer;
                        trace(totalTime);
                        countup(false);
    If someone could help me do what I want to achieve, that would be awesome.
    Cheers! 
    edit : I want to use the last time to be put on a leader board kind of thing as well. Less amount of time taken to most.

    What broke?  You should learn how to use the trace function to troubleshoot your code.  YOu can use it to track what happens to different values during the processing to home in on where the problem lies.
    It looks likeyou are using Actionscript 1 more than Actionscript 2, setProperty is AS1 coding and is unnecessarily complicating things for you. 
    You should get your code off of the objects and place it in the timeline, using instance names to target the different object you place it on now.

  • Refresh issue in read only VOs

    Hi,
    We have a create/edit page where user creates a particular entity say A. There is another search page where one of the search criteria is the entity A. This search criteria is shown as a dropdown in this page. The problem is, once the entity is created, it does not immediately gets reflected in other page search criteria drop down. There is a inconsistent lag in time after which the entity appears. Some times its 30 minutes to 1 Hrs. Kind of it looks like a cache issue of a read only VO which probably might get pushed out of cache after a lag and comes back, but we are not sure if there is any parameter to control this default behavior. Also this behavior was observed only in System testing environment. This behavior was not observed in any of our development instances. We are in release 12.1.3. Any pointers would be helpful.
    Thanks and Regards,
    Balaji

    From the documentation
    >
    When a view object has one or more underlying entity usages, you can create new rows, and modify or remove queried rows. The entity-based view object coordinates with underlying entity objects to enforce business rules and to permanently save the changes to the database. In addition, entity-based view objects provide these capabilities that do not exist with read-only view objects:
    Changes in cache (updates, inserts, deletes) managed by entities survive the view object's execution boundary.
    Changes made to relevant entity object attributes through other view objects in the same transaction are immediately reflected.
    >
    Read more at
    http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcquerying.htm#ADFFD239
    http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcadvvo.htm#ADFFD1197

Maybe you are looking for