Changing the Registration point via AS3 . how?

hello,
is it posseple to change the Registration point via AS3 ?
Best Regards,
Crimson

The Attach Code window isn't working for me on this so I
pasted the code into the message. Hope the formatting remains
reasonable.
public class HomePage extends MovieClip {
public var frenchieReal:Swimmer; //Swimmer extends
MovieClip; contains image of French Angel
public var frenchie:Sprite; //To offset regisration point of
frenchieReal
public function loadStage() {
var timer:Timer;
var wayPoints:Array;
//Establish timer for swimmers
timer = new Timer(100, 0);
//Create new swimmer supplying: image path, width, heigth,
and initial x and y location
frenchieReal = new Swimmer("Photoshop/oceanswimmer.png", 57,
41, -24, -28);
frenchie = new Sprite();
frenchie.x = 244;
frenchie.y = 532;
this.addChild(frenchie);
frenchie.addChild(frenchieReal);
frenchieReal.setTimerListener(timer);
//Set waypoints for swimmers
wayPoints = [[230, 530],
[240, 520],
[250, 500],
[260, 480],
[298, 480],
[358, 540],
[368, 544],
[388, 520],
[398, 495],
[404, 475],
[420, 500],
[458, 545],
[528, 550]];
frenchieReal.setPath(wayPoints);
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.utils.Timer;
import flash.net.*;
import flash.display.*;
public class Swimmer extends MovieClip {
private var path:Array;
private var pathLength:uint;
private var pathLocation:int;
private var loader:Loader;
private var intercept:int;
public function Swimmer(imagePath:String, w:uint, h:uint,
xx:uint, yy:uint) {
var urlRequest:URLRequest;
this.x = xx; //Transaltion offsets for image MovieClip (eg,
-24 and -28)
this.y = yy; //Image is visible if these two values are
nonnegative
this.loader = new Loader();
this.addChild(this.loader);
urlRequest = new URLRequest(imagePath);
if (urlRequest != null) this.loader.load(urlRequest);
//Sets an array of waypoints
public function setPath(p:Array) {
this.path = p;
this.pathLength = p.length;
this.pathLocation = 1;
this.parent.x = this.path[0][0];
this.parent.y = this.path[0][1];
this.intercept = -this.parent.y;
public function setTimerListener(t:Timer):void {
t.addEventListener(TimerEvent.TIMER, timerListener);
//this.parent in timerListener is the Sprite object to which
image MovieClip is parented
function timerListener(e:TimerEvent):void {
var i:int;
var iMinus1:int;
var xx:int;
var y1:int;
var y2:int;
var rise:int;
var run:int;
var rotationAngle:int;
if (this.path != null) {
//Move to next segment?
if (this.parent.x >= this.path[this.pathLocation][0]) {
this.pathLocation++;
//Go back to first segment?
if (this.pathLocation == this.pathLength) {
this.pathLocation = 1;
this.parent.x = this.path[0][0];
this.parent.y = this.path[0][1];
this.intercept = -this.parent.y; //Minus y to translate
everything to lower quadrant
//y = ax + b
//y = ((path
[1] - path[i-1][1]) / (path[0] - path[i-1][0])) * this.x +
path[i-1][1]
i = this.pathLocation;
iMinus1 = i - 1;
this.parent.x += 2;
xx = this.parent.x - this.path[iMinus1][0];
y1 = -this.path[iMinus1][1];
y2 = -this.path
[1];
rise = y2 - y1;
run = this.path[0] - this.path[iMinus1][0];
this.parent.y = ((y2 - y1) / (this.path
[0] - this.path[iMinus1][0])) * xx + intercept;
this.parent.y = -this.parent.y;
rotationAngle = -(180/Math.PI) * Math.atan2(rise, run);
this.parent.rotation = rotationAngle;
trace("rise = " + rise + " run = " + run + " rotationAngle =
" + rotationAngle + " Intercept = " + this.intercept);
trace("x = " + this.parent.x + " y = " + this.parent.y + "
rotation = " + this.parent.rotation);

Similar Messages

  • How to change the registration point on a shape

    Hi,
    Is there a way to change the registration point on a shape
    created in Director? For instance, I created a filled oval, and by
    default Director sets the top left corner of the surrounding square
    as the registration point. Nevertheless, I need to place that
    registration point at the center of the oval.
    Best regards.

    Hi, if you create a shape vector from director, the reg point
    is in the center of it; if you import a vector created in other
    aplication (flash), the regpoint is in the top left corner. To
    change the regpoint of an imported shape, try this:
    put your shape in the stage in x,y = 0,0 position, then, if
    your shape rect is 12,8 pixs, and if you want to move the regpoint
    to the center of it
    on preparemovie me
    member("yourshape").regpoint = point(6,4)
    end
    play and stop the movie, your shape will change the regpoint
    to 6,4
    remove the script, and that's all.
    Best regards.
    sayeg

  • Can I change the registration point of a movie clip?

    I'm loading a movie clip dynamically and its registration
    point defaults to top-left corner. I need to change it to the
    center, is this possible? if so, how?
    Thank you

    Thank you. I tried that and it didn't work too. Please check
    this code:
    loader.loadClip(_global.image_url+this["image1"], image1);
    DynamicRegistration.initialize(image1);
    image1.setRegistration( 20, 20);
    What is wrong with it?

  • HT201274 How do I change the registration of my ipod? I bought a new ipod and want to register it under a different name.

    I just bought a new ipod and when I plugged it in to register it, the name of my son's ipod appeared. How do I change the registration so that I can make it my own?

    It sounds like yu either restored it from a backup of your son's iPod or you set it up via iTunes with iTunes signed into his account.
    I would go to Settings>General>Reset>Ease all content and settings and then set it up with your account. If you do it via iTunes make sure that iTunes is signed into your account.

  • How do you change the registration on an iPhone?

    I just bought an iPhone on eBay that still has 8 months of warranty.  How do I change the registration? Will the warranty stay with the phone?

    Ive tried that multiple time but never get the email confirmation.
    also does the applecare tie to the device too? Thanks again for all your help.
    i have any trouble i guess ill just approach another apple tech at another store. this one perticular store has always gave me a hard time.

  • How can i change the mouse pointer image?

    Hi friends!!
    It's possible to change the mouse pointer image in Swing?
    Thanks a lot.

    There's a setCursor() method on the frame component.

  • Change the active microphone in AS3

    Is there a way to change the active microphone in AS3 without using the SecurityPanel.MICROPHONE?  All of my attempts stop all microphone activity, even if triggered by a button click.
    Using
    var mic:Microphone = Microphone.getMicrophone();
    works fine, them if at a later point I do
    mic = Microphone.getMicrophone(newIndex);
    and poll mic.activityLevel - the level is always -1.
    If I switch back to the original mic, it works again, which ever was originally selected in the security panel works.  This is with two working mics, and I have switched which is selected via the security panel to make sure it is not mic specific.
    Is this  a security risk and not allowed?  Once you initialize one mic, is that what you are stuck with?  I have switched cameras in air, but that was air.
    - as a side note, the reason for needing this is we get feedback whenever a user is using the computer speakers and is on firefox.  I have set loopback to false and I have brought the SoundMixer level down to 0, but as soon as the security panel microphone window pops up, the level comes up and loopback acts as if it was set to true.  When the window closes, I get control again.

    Figured it out.  It looks as though the Microphone.activityLevel is -1 until you add a SampleDataEvent listener.  You do not need to add this if you are streaming to the server.  In my tests I was updating my reference to the mic for checking the activityLevel in an update loop.  I did not update the SampleDataEvent lsitenre since I was not actaully recording, just checking the mic input level, and did not think it needed tobe in place.
    It seams possible that the Microphone checks that it either has a SampleDataEvent listener, or is connected to a server before updating activityLevel, I just have never seen that kind of thing done.
    I am not certain this is the case, but it is what it looks  like.  If anyone has more infomation, please share.

  • I changed the path of my photos, how can I find them from iPhoto

    I didn't import my photos into the photo library,
    now I changed the path of my photo,
    how I can find them,
    I have thousands of photos, I don't want to check one by one~

    I believe this is the post Larry's referring to:
    Pascal Mah
    Re: iPhoto '11 referenced library problems
    Jul 27, 2011 4:28 PM (in response to Terence Devlin)
    YES!!!
    I finally managed to recover my iPhoto library!
    But it was not easy. I had to hack into the database file to put up things right.
    After a significant amount of trial-and-error, here is the procedure I came to, which finally worked for me (use at your own risk):
    0. Make sure you make enough backups so as to revert to the previous state if something goes wrong!
    1. Make a copy of your iPhoto Library [Show Package Contents]/Database/apdb/Library.apdb to your desktop.
    This file contains most of the data involved for managing your iPhoto data.
    2. Open this file using a SQLite database manager.
    I used Navicat 9.1, which has nice import-export features. For direct editing, Base 2.0 is may be easier.
    3. Open the table RKMaster.
    This table contains all records for the individual pics of your library.
    4. Correct the path of each of your pic files in the imagePath column to their current filepath.
    This contains the path of your pic files at the time they were imported, and is not updated by iPhoto even though you have moved your pic files somewhere else.
    If you have several thousands of paths to correct, a good idea is to export this column to a text file (also including the modelId column for referencing), and to correct paths using the substring Search&Replace function of your favorite text editor. Be sure to re-import the corrected data properly using the modelId column as references.
    5. If needed, correct in the same manner the content of the fileVolumeUuid column to the value of the drive currently containing your picfiles.
    If needed, obtain this value considering a pic which was recently imported from that drive.
    6. If your drive name was modified, also correct its name in the name column of the RKVolume table.
    Identify the proper record by considering its uuid previously obtained.
    7. If you're happy with your work, quit the database managing program and put Library.apdb back in its original location inside your iPhoto Library.
    Keep the older somewhere in case something goes wrong.
    8. Run iPhoto to see if your work is successful!
    At this point, you might consider rebuilding the Photo Library (hold alt-cmd while launching iPhoto) and choose Repair the iPhoto Library Database (Be sure to leave the Rebuild the iPhoto Library Database from automatic backup unchecked!). This might correct some possible unconsistencies resulting from your edits. Also, a good thing might be to rebuild all thumbnails. If iPhoto does not bug you for locating files during that process, you have possibly done your work right! If not, back to step 1.
    As said, this worked for me, with no visible inconsistencies or side effects to be noticed in the behavior of iPhoto (at least for now). But possibly some knowledgable people might comment and improve that process, and some database script guru might also help automating this. Please comment.
    Lessons learned (How I understand the things as far as I know):
    A. Library.apdb stores the initial drive and path of the pic files at the time they were imported. This is not modified as the files are moved around.
    B. Some other data (BLOBs?) is used to track the files at their actual location. Therefore, it seems OK to move the pic files after they were imported.
    C. Unfortunately, this other data is broken if the file is recreated (even with same content and location), for example with a file-based backup and restore (Time Machine).
    D. In that case, iPhoto is unable to recover the file if its current drive and path does not match the one when the file was imported, stored in the database. Also there is no mechanism in iPhoto to correct this data.
    E. Therefore, it is very important to import pic files in iPhoto only when these are already in their final location! If not, your iPhoto Library won't survive a TimeMachine backup and restore! (Possibly, a block-based drive backup could work... I don't know).
    F. ...And Apple should really, really fix this issue! (By correcting the stored filepath and drive to the current file location at least when the database is repaired, and by offering at least some basic file reconnection options).
    OT

  • Change the end point URL in WSDL for web-service

    Hi All,
    Morning , could someone please help us with this question, we are stuck with this currently.
    In SOA Suite 10g as well 11g we have a jsimple Java class whose one of the methods is exposed as a web service.
    In the project it has created the WSDL as well and have deployed the .ear file to the servers from EM console successfully.
    Now we need to migrate this web service to testing & production environments.
    1. Could someone please let us know the steps as to how do we change the end point url in the WSDL for this web service (present in web content --> WEB-INF/wsdl path in the j-developer project) for migration in case of both 10g (OC4J) as well 11g (WLS) servers.
    2. Also could this change/update be done prior to deployment as well as post deployment as well.
    Looking forward to inputs regards this...as we are stuck with this ..would be very helpful
    Thanks as always for help & guidance..

    Hi
    As Vijay mentioned, you develop a WebService in JDeveloper and test in JDeveloper integrated Weblogic Server say at http://localhost:7101/MyWebService/MyPort?wsdl. Thats it. Once it is working. Export it into a .WAR file. If you have any other supporting EJB JARs etc, put all these into a full blown .EAR at application level. NOW deploy this .EAR or .WAR into any Domain on any host and any port. DOES not matter. That server's host and port will be taken. Infact even if this other domain is Clustered domain, still it will work by giving webserver host and webserver port that sits in front of the cluster.
    I develop my webservices in JDeveloper and test at 7101 port. This .WAR gets deployed in QC Env at qchost:qcport. Same .WAR deployed to UAT at uathost:uatport and finally to prod also at prodhost:prodport.
    Its just the Client (WebService Proxy) that is calling this WebService need to use appropriate host and port based on which Env it is connecting to. For this, simply do not hard code WSDL URL in the java code or anywhere. Simply get it from a .properties file using a key value pair like this.
    WSDL_URL=http://host:port/MyWebService/MyPort?WSDL.
    Now have Environment specific values for above key and put that properties file in that domain root folder. And in your code always refer this key.
    You can use many approaches along the above lines.
    If your WebServies proxy is a webservice adapter say within bpel, still you can modify the value using deployment plan .xml file file while deploying.
    I would not absolutely prefer opening war file from ear and modifying war and updating ear file etc etc. Also do not have multiple EARs for Environment specific. Just have only one single EAR or WAR file that can be deployed to any environment.
    Thanks
    Ravi Jegga

  • Change the end point in a web service client???

    Hello,
    With the Web Service Proxy Wizard of JDeveloper 10g R3, I created a web service proxy that connects to a (web service) end point like this: http://carina.bicevida.cl/OidServices/OidBasicWebServiceSoapHttpPort
    My three related questions are:
    1.- How can I change the end point registered in the (client) web service proxy ?
    2.- How can I do this without need to rebuild the client application?
    3.- How can I do this once my client application have been deployed in the application server?
    Please help.

    Hi,
    these are your options
    - Edit the endpoint meta data stored in the .proxy xml file (e.g. \src\project\myservice.proxy)
    - Use WS proxy wrapper and call setEndpoint on the proxy
    - Recreate the proxy in JDeveloper based on the new endpoint. This may require merging any business logic if it was inserted directly in the proxy (as opposed to a wrappering class)
    where I think option 1 and 2 is what you would look for. I don't know how exactly JDeveloper 11 is different, but I got the info from development that there will be simplifications.
    Frank

  • Moving the registration point

    how can i move the original registration point , for example
    i draw a rectangle with the registration point in the middle , but
    when i move the rectangle down the registration point stays on top
    and my rectangle which is in the bottom has no registration point
    how can i move the rectangle along with its registration point
    ????

    Not sure I follow, but I'll take a guess. Are you referring
    to the + sign in the middle of stage screen when creating a symbol?
    or the centerpoint white dot in the middle of an object. If the
    former, then it doesn't move. If the latter, just click and drag
    the white dot. It will move the centerpoint (it will snap to
    anchors too). Hope that helps.

  • Is there a way to preserve the registrations points in a legacy file?

    I installed CS5 yesterday, modified a Flex skin template and exported it. To my surprise, in the Flex application, all the symbols were offset from their positions... What happens is that in CS5 the registration point is centered and not in the top left corner. This effectively kills the whole Flex skin template (with tens of symbols) and makes it useless.
    Is there a way to either preserve the registration points or automatically reposition them? I do know that I can simply edit every single one and have the registration point set correctly but that is not practical, or feasible, taken in consideration my company's development time for this product... very frustrating!

    What do you mean by "image number"? The file names like "IMG_7822.CR2" or "IMG_7822.jpg"?
    You can create custom names with appended numbers, when you export your image files to be saved on a disk.
    Sort your images by date in the browser, select them, then use the command "File > Export > Version" to write the files to the disk. Set the name format to "Custem Name with Index" or "Custom Name with Counter" to create numbered names in your current sort order.
    Regards
    Léonie

  • I would suggest a new feature:The possibilty to change the mouse pointer icon when you hover on an a

    I would suggest a new feature:The possibilty  to change the mouse pointer icon when you hover on an active link by any other one icon I select.

    Current Firefox versions have a feature called tear-off tabs.<br />
    You can detach a tab from the current window and open it in a new window by dragging a tab in the browser window.<br />
    You can drag that tab back to the tab bar in the original window to undo that detaching.
    bug489729 (Disable detach and tear off tab):
    * https://addons.mozilla.org/firefox/addon/bug489729-disable-detach-and-t

  • Can I create a keyboard shortcut to change the reference point? (Mac CS6)

    I'm forever changing the reference point during a job and the tiny squares are a nightmare (my eyes aren't what they used to be), a shortcut to change it from the centre to top left would be great.
    Cheers
    Mark.

    @Mark – and here an overview of all available options:
    AnchorPoint.BOTTOM_CENTER_ANCHOR
    The center point on the bottom of the bounding box.
    AnchorPoint.BOTTOM_LEFT_ANCHOR
    The bottom left corner.
    AnchorPoint.BOTTOM_RIGHT_ANCHOR
    The bottom right corner.
    AnchorPoint.CENTER_ANCHOR
    The center point in the bounding box.
    AnchorPoint.LEFT_CENTER_ANCHOR
    The center point on the left side of the bounding box.
    AnchorPoint.RIGHT_CENTER_ANCHOR
    The center point on the right side of the bounding box.
    AnchorPoint.TOP_CENTER_ANCHOR
    The center point on the top of the bounding box.
    AnchorPoint.TOP_LEFT_ANCHOR
    The top left corner.
    AnchorPoint.TOP_RIGHT_ANCHOR
    The top right corner.
    Uwe

  • Can I change the center point for a motion scale

    I would like to motion scale an image with the center for the scaling at the bottom of the image, not the center of the image. I tried changing the anchor point numbers, but that moves the photo as well.

    Try setting the Anchor Point - NOT the Center Point. The Ccenter Point is where the center of the image will be; the Anchor Point is the point at which the image is anchored.
    -DH
    Message was edited by: David Harbsmeier

Maybe you are looking for

  • How do I add an element in Labview 5.1?

    Hi, I have been using LabView 5.1 for a while but I cannot figure out how to put an element into the diagram portion of the program I am making? Any Suggestions? Thanks Muhammad Asfour

  • HT204053 can I send music from my computer to my phone?

    can I send music from my computer to my phone ?

  • How to get the Contact person name of Account site level contact person

    Hi All, I have contact person defined at account level and other at account site level. I am trying to print the site leve contact name in my AR Invoice report. What i used is bill_to_site_use_id a input in the below query select hp2.party_name from

  • Filters log file in planning

    Hi All, Is there any log file for filters in Hyperion planning 4... I was tried to refresh filter for one user but getting error like "Filter created Expect for XYZ user"... Please suggest ..... Thanks in advance.. Regards, Ashok Edited by: Prabhas o

  • Error  while performing Organisational Assignment

    Hi ,       Administrators -  Rec, Pay, Tim have been created in the group Spb. While performing  the action - organisational assignments rec(personnel admin), Tim (time), pay(payr admin)  of the group spb have been assigned to subarea - 225, Business