Image Dynamic Masking

I got this code from an online source. I will appreciate your help in editing the code very much.
NEED HELP IN THE FOLLOWING:
I need the image to be inside the stage and not load externally.
I also want the masking to start when mouse rolls over.
the file id made out of 2 frames and has an external file named test.jpg...
frame 1:
Stage.scaleMode = "noScale";
_root.createEmptyMovieClip("foo",1);
_root.foo.createEmptyMovieClip("img",2);
_root.foo.onEnterFrame = function()
if(this._width > 100 && this.img.getBytesLoaded() >= this.img.getBytesTotal() && this.img.getBytesLoaded() > 0)
  this._x = 80-this._width/2
  this._y = 300-this._height/2
  nextFrame();
if(n==undefined)
loadMovie("test.jpg",_root.foo.img);
} else {
loadMovie(n,_root.foo.img);
stop();
frame 2:
stop();
_global.h = 50;
_root.createEmptyMovieClip("mask",3);
_root.foo._visible = 0
_root.foo.img.setMask(_root.mask);
mask.onEnterFrame = function()
this.onMouseMove = function()
  this.a++;
  this.createEmptyMovieClip("l"+this.a,10+this.a);
  this.lc = this['l'+this.a];
  with(this.lc)
   beginFill(0x000000,100);
   moveTo(0,-h/2)
   lineTo(100,-h/2)
   lineTo(100,h/2)
   lineTo(0,h/2)
   lineTo(0,-h/2)
   endFill();
  this.x1 = _root._xmouse;
  this.y1 = _root._ymouse;
  this.lc._x = this.x1;
  this.lc._y = this.y1;
  this.x2 = this['l'+(this.a-1)]._x == undefined ? _root._xmouse : this['l'+(this.a-1)]._x;
  this.y2 = this['l'+(this.a-1)]._y == undefined ? _root._ymouse : this['l'+(this.a-1)]._y;
  this.lx = this.x1 - this.x2;
  this.ly = this.y1 - this.y2;
  this.rotation = Math.atan2 (this.lx,this.ly);
  this.rotation *= 180/Math.PI;
  this.lc._rotation = 270-this.rotation;
  this.lc._xscale = Math.sqrt(this.lx*this.lx+this.ly*this.ly)+1;
  _root.foo.img.setMask(_root.mask);
  updateAfterEvent();
_root.foo._visible = 1
mask.onMouseUp = function()
this.a++
this.onMouseMove = undefined;
foo2._alpha = 20
this.onMouseMove

Is this AS3?  I'm no expert, but if the image isn't loading I might suggest using an event to wait for the JPG to fully load before executing your other functions.  Something like this:
     public class loader extends Sprite {
          private var loadObj          :     Loader          = new Loader();
          public function loader() {
               var url               :     String               = "insert_file_path_here";
               var target          :     URLRequest     = new URLRequest(url);
               loadObj.contentLoaderInfo.addEventListener(Event.COMPLETE, initHandler);
               loadObj.load(target);
          public function initHandler(event:Event):void {
               addChild(loadObj);
That would load an external image or movie clip, and when it was ready add it to the stage of the movie.  The way I have it written there is for a document class, but you could modify that code for a frame script instead.

Similar Messages

  • How to change the images dynamically in a table.

    Hai,
                     How to change the images dynamically in a table based on the condition in webdynpro abap.
    Edited by: Ravi.Seela on Oct 13, 2011 2:17 PM

    This has been much discussed earlier. Do search posts.
    For your scenario i would do the following.
    inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
    create a  supply function for the node image .
    Supply method now has a Element (Parent element ) and node.
    Based on your record in element, set the right image source to path attribute and bind the node.
    This will make sure that the framework calls the image supply function for every row in a table.

  • Dynamic mask not working once loaded

    I have a movie that has a dynamic mask in it. Once I load
    that file into my other movie, it no longer works.
    I am not even sure to start to look. It makes no sense to me.
    Any ideas?
    Thanks a lot!

    re-assign the mask after loading is complete.

  • Adobe form - Printing images dynamically

    I have created a simple read-only (not interactive) Adobe form. At the end of the document, I need to print a signature depending upon the approver (which I can access from the data structure imported into the form.).
    If I create an image field, how do I assign the image dynamically depending on the approver?
    I have thought of an alternative solution of creating 3 separate forms each with a static image of the signature and calling a separate form in the program depending on the approver. But I was wondering if I can assign images dynamically so that I can have only one form.
    Any help will be greatly appreciated.
    Jitendra Mehta

    Hello . The solution is easy, I have posted the solution into IFbA forum under NeWeaver many times. And I can recommend you to read this article where there is a complete solution for your problem:
    http://www.docstoc.com/docs/2540673/How-To-Integrate-ADOBE-form-on-WebdynPro-for-ABAP-and-Deploy-it-
    It was originally SAP SDN blog, but I am not able to locate it on sap site any more. Hope this solves your problem, regards Otto

  • Proble displaying images dynamically in jsp

    Hi, I am new here. I have to display the images dynamically reading from a database. I have no problem displaying images. When i try to reduce the width in img tag then it is slowly rendering it. How to overcome this.
    <img src="image.jsp?imgID=112" width="150" heigth="130" border="0">
    I am also giving the sample jsp to display
         byte [] imgData = blob.getBytes(1,(int)blob.length());
    response.setContentType("image/jpeg");
    OutputStream o = response.getOutputStream();
    o.write(imgData);
    I want to display the image without any time taken. How could I solve this. Please Help me.
    Thanks.
    Phani.

    You should not crosspost questions. It is rude and a waste of our time.
    Please stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5372144].

  • How to add Image dynamically in Webdynpro ABAP

    Hi Experts,
    How to add Image dynamically in Webdynpro ABAP.
    My requirement is i maintain all the images in a table.
    image source has to pick the table URl dynamically and display.
    is that possible in webdynpro?
    and also please give the suggesion,
    without using MIME objects is that anyway to get images?
    Thanks in advance.
    Regrads,
    Jeyanthi

    Hi,
      are those icons wou want to display then. he following code will be useful.
    data : lo_IMG type ref to CL_WD_IMAGE.
    LO_IMG = cl_wd_IMAGE=>new_IMAGE( id = img_id SOURCE = 'ICON_BW_APD_TARGET' tooltip = sts_tltp ).
    lo_cont->add_child( the_child = lo_img ).
    here lo_cont is the container where you want to add the image dynamically and source is the attribiute through which you can change the ICON image. this thing you can getit from data base table and change accordingly.
    Regards,
    Anil kumar G

  • How to render image dynamically in ADF using URL

    Hi all,
    I have a requirement where i need to render the images dynamically using the url. As the url are of the IPM Application and each of the url is associated to a particular image of a particular document. I have tried making the URL Data Control but couldn't able to get the Image as per the document,even the image is not being rendered onto the page.I want the whole IPM console to be rendered on my jspx page.
    Note- It is not a wsdl url.
    Please suggest how should i implement this
    thanks in advance

    if you decompile the imaging.ear file, there is a web.xml file which you can add the following parameter:
    <context-param>
    <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
    <param-value>never</param-value>
    </context-param>
    or take a look at      Receiving "Warning: Unable to load content in a frame. Frame content will load at the top level." When Trying to Use the <af:inlineFrame> Component [ID 1266770.1] on Oracle Support.
    Make sure you take a copy of the imaging app before you make changes. You can then upload back through the weblogic console.
    Sudi

  • How to make a one-color fill images with masks in documents from our multiple layers ?

    Hello everyone!
    I`m to open PSD document with same layers. I need to:
    1. Save the jpg file (preview) in a certain place
    2. All layers with masks to make one-color fill instead of images with masks.
    Thanks
    This is way ?
    var theLayers = collectLayers(app.activeDocument, []);
    alert (theLayers.join("\n"));
    function collectLayers (theParent, allLayers) {//---------------------------------------------------
    if (!allLayers) {var allLayers = new Array}
       else {};
       for (var m = theParent.layers.length - 1; m >= 0;m--) {
          var theLayer = theParent.layers[m];
          if (theLayer.typename == "ArtLayer") {
               var bar = new Array;
               bar = theLayer.bounds
               l0= Math.abs(this.app.activeDocument.width - theLayer.bounds[2] - theLayer.bounds[0]);
               l1= Math.abs(this.app.activeDocument.height -theLayer.bounds[3] - theLayer.bounds[1]);
                if((l0+l1)>0) { // layer mask is set
                    // delete this layer
                    //create new layer
                    //create new mask from array bar
                    //fill selection
                allLayers.push(theLayer);
       return allLayers

    I may not quite follow.
    Would you mind posting an example (a screenshot with the Layers Panel visible for example) and an overview of the resulting images you want to produce?

  • How to change the image dynamically depend upon the input parameter

    Hi All
    I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
    How to change the Logo dynamically depend upon the input passed by the user.
    If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
    Is it possible to change the logo according to the input without keeping this in Template.
    I have seen this link but its not working fine
    http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
    Regards
    Srikkanth.M

    Hi,
    I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
    Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
    Regards
    Srikkanth

  • How to embed images dynamically?

    HI all , I'm new to flex.
    Here is what I've already done, I use
    [Bindable]   
    [Embed(source="images/xxx.jpg")]
    private var img:Class;
    to embed several images in an application.
    But the source of these images can not be determined until the run time, I got image's url dynamically, and used some variables to store them. For example, an url may refers to an url
    var url:String = "images/xxx.jpg";
    Then I think it's possible to give its value to an image source by using
    [Bindable]   
    [Embed(source=url)]
    private var img:Class;
    However,it doesn't work. there is a compile error, the description is:
    "url" does not have a recognized extension, and a mime type was not provided
    Unable to transcode url
    So what's the problem here, and could any one give me some advice to embed images dynamically?
    Thanks!

    HI
    I don't think you can embed an image dynamically as you need to know the path of the image when you use the embed tag.  The embedding takes place at compile time, and you app would need to be compiled into a swf before your code loads.
    If you need dynamc images in an application then its usually done by loading them when the app is running.  You do this by using for example a HTTP service to load in the image paths.  You can then view them by assigning them to an image tag through Actionscript.
    I hope that helps and I got the idea of what you were trying to do.
    Heres a quick example I used for someone else on swapping images from an arrayCollection.  You could do something like this and populate the arrayCollection using a HTTP service.  Or just access the xml from the HTTP directly for the image paths
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()" xmlns:local="*">
         <mx:Script>
              <![CDATA[
              import mx.controls.Button;
              import mx.collections.ArrayCollection;
    [Bindable]
    private var ac:ArrayCollection = new ArrayCollection([
    {imageTitle : 'Car 1', imageUrl : 'http://www.geekologie.com/2007/12/07/future-car-1.jpg'},
    {imageTitle : 'Car 2', imageUrl :'http://www.speedace.info/solar_cars/solar_car_images/Solar_Wing_front_Japanese_e lectric_powered_car.jpg'},
    {imageTitle : 'Car 3', imageUrl : 'http://www.dezeen.com/wp-content/uploads/2008/09/gem-peapod-car-by-chrysler-llc- et008_027evsqu.jpg'}
    private function showCar(num:int):void {
    img.source = ac.getItemAt(num).imageUrl;
    imgTitle.text = ac.getItemAt(num).imageTitle;
    ]]>
         </mx:Script>
         <mx:Image id="img" source="{ac.getItemAt(0).imageUrl}" width="426" height="243"/>
         <mx:Label id="imgTitle" text="{ac.getItemAt(0).imageTitle}"/>
         <mx:Button label="Button" click="showCar(0)"/>
         <mx:Button label="Button" click="showCar(1)"/>
         <mx:Button label="Button" click="showCar(2)"/>
    </mx:Application>
    Good luck
    Andrew

  • Rendering images dynamically from file server path

    Hi,
    We are having JDeveloper 11.1.2.4
    We have following requirement - Image files are located on server. File locations (path and name) are stored in database table.
    We need to dynamically access file locations from database table, access file from server and render it in ADF image component.
    Is it possible? If yes, we would really appreciate some pointers/help on how to achieve it.
    Please note that we are able to render images dynamically when they are stored in database BLOB column. We can do that using a ImageServlet class. In doGet() method, we are fetching the database BLOB column based on current row id.
    Thanks,
    Vivek

    Here is the scriplet I tried. But it is not redering the image and definitely I am missing something here. Please suggest changes or any direction.
    <%
    File f = image.getThumbnailFile(); //image file from a bean
    ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
    InputStream inputStream = new FileInputStream(f);
    byte[] bytes = new byte[1024];
    int read;
    try{
              while ( (read = inputStream.read(bytes)) > -1 )
                      byteOutput.write(bytes, 0, read);
              //byte[] ba = byteOutput.toByteArray();
              ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOutput.toByteArray());
              response.setContentType("image/gif");                       
              while ( (read = byteInput.read()) > -1 )          
                   response.getOutputStream().write(read);
              response.getOutputStream().flush();
    catch(Exception e){}                           
    %>

  • Want to add Image Dynamically...

    I want to add image dynamically in my output screen..so is there any code that i can use..Please help with this...

    Can you please be more specific about what you want to do dynamically.  Do you just want to dynamically control which image appears in an image UI element (which can be done by data binding a context attribute to the image Source property) or do you want a dynamic number of images (which can be done with a row repeater or multipane UI element and inner Image UI elements).

  • Display Images Dynamically

    Hai
    I am new to Jdeveloper. I have a task to display images dynamically.
    <img src="file:///Z:/Image/sample.bmp "
    alt="images" />
    i am using mysql database.i am getting the path from database.
    Now i want to pass the path of the image file.how can i do it
    If anybody knows please tell me
    thanks
    raju

    Hi,
    Assuming that your technology is ADF/JSF .... you only need to create a binding for the image source attribute and then use an af:objectImage tag to display the image. You could use for example something like this :
    <af:objectImage source="#{bindings.ImageSource.inputValue}"/>Just remember that in order for the image to display correctly, the path from the database has to be relative to your web root.
    Thanassis

  • HOW DO I MAKE IMAGES DYNAMIC USING DREAMWEAVER & MySql

    Hi there,
       I wanted to make images dynamic in that the images would be stored in my database and then use dreamweaver to pull the images from the database using a recordset. But how do I get to store the images in MySql now that dreamweaver doesn't support BLOB and also how do I make dreamweaver pull the images from that database? PLZ somebody help

    To pull the image from Database on to your page
    1. Open your php page
    2. put your cursor where you want the image to show on the page
    3. insert>image>Select File Name From: Data Sources>select record from recordset> click ok
    4. View in browser
    In Mysyl the image was stored as a "longblob" type with "binary" attributes
    but my system is Dreamweaver CS3.
    Hope this helps. Let me know.

  • Add images dynamically

    Hello eperts,
                        can any one tell me how to add images dynamically in webdynpro. i had loaded the image in mime,and inside the method wdmodifyview i had written the coding ,
    data: lr_image      type ref to cl_wd_image.
    data: lr_container  type ref to cl_wd_transparent_container.
    data: lr_flow_data       type ref to cl_wd_flow_data.
        lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_image = cl_wd_image=>new_image( source = 'new.jpg'l view = view ).
        lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_image ).
        lr_container->add_child( lr_image ).
    where 'new.jpg' is my mime object name.
    what other steps i have to follow to get the image while running.... thanks in advance.

    hi,
    if you want, you can modify the layout, just using your coding:
    lr_container->set_layout_data(lr_flow_data).
    In addition, make sure that your JPG is the MIME object of this WD component, otherwise, you should add "WD name" as the prefix of JPG's name..
    Best wishes.

Maybe you are looking for

  • Report server 6i and Report services 10g

    what is the extra features in Report Services 10g which are not available in Report server 6i. why would we use AS report services 10g rather then report server 6i,and our only requirment is to run oracle report on web which can fulfill with the help

  • Skype 7.0.59.102 chat history only 30 days

    With all previous versions of Skype I was allowed to access chat history for each contact or group all the way from the start of the conversation. Now, with Skype 7.0.59.102, it only goes back a month. This is terrible!! Please, is there a way it can

  • Logitech Download Assistant

    how do I delete Win 8.1 file  windows/system32/rundll32.exe ? I don't have any Logitech stuff on my PC...and wish to remove it from my list of startup apps

  • How to create bapi funcion module

    Hi, I am getting an error while activating bapi funcion module that "REPORT/PROGRAM statement missing, or program type is i(INCLUDE)". Can any body resolve this error.

  • Need info about SXMB_MONI

    Hi, Can any give information about SXMB_MONI . How to check the Runtime process of XI.