How to display bitmap in Flex App

Hi,
I want to alter pixel data in an image and then display the
altered version alongside original image. I am manipulating the
bitmapData from the original image and then creating a new Bitmap
from the altered bitmapData.
How can I add the new Bitmap to the display list? I am
getting a "not UIComponent" error message when I try to add it.
Casting it as a UIComponent also fails.
Or am I taking the wrong approach?
TIA

Hi,
Please try as show in the code below.
Hope this helps.

Similar Messages

  • How to display ads in Flex APP

    Hi All,
    How i can place a ads in the flex application.
    Any work around.
    Please send the sample link or tutorials
    Thanks & Regards,
    chaitanya

    An ad would be an image or Flash movie, both of which can be displayed quite easily and given hyperlink behavior. It all depends on what kind of logic you need to support rotation. You will want to keep the ad content resources external of the swf. Maybe have an XML properties file to load in specifying resources, their links, and whatever else you need.

  • Convert displayed datetime in Flex app to database's

    I currently use Flex web services to request data from an sql
    server database (via a .net app) and bind the result set .net
    datatable to a flex datagrid. The datagrid has a datetime column
    that displays the local time at which the client created the record
    instead of the sql server datetime value. How can I change my
    datagrid records to show the database's datetime? Here's an
    articles related to this issue... but wasn't able to get it to work
    in my context:
    http://blog.shrefler.net/?p=13.
    Any help would be appreciated!

    "justneed2know" <[email protected]> wrote in
    message
    news:g980h7$m5f$[email protected]..
    >I currently use Flex web services to request data from an
    sql server
    >database
    > (via a .net app) and bind the result set .net datatable
    to a flex
    > datagrid.
    > The datagrid has a datetime column that displays the
    local time at which
    > the
    > client created the record instead of the sql server
    datetime value. How
    > can I
    > change my datagrid records to show the database's
    datetime? Here's an
    > articles
    > related to this issue... but wasn't able to get it to
    work in my context:
    >
    http://blog.shrefler.net/?p=13.
    >
    > Any help would be appreciated!
    Why not just send the request to create the record to the
    server _before_
    you do anything with it in Flex, then bring it back and
    display it in Flex?

  • How to display BITMAP at runtime

    Hey all....
    I am new to Photoshop SDK CS2 plugin programming. Can anyone help me to find out any code or any information to display bitmap image on plugin dialog using photoshop API and not the Windows API or MFC. I am just using a simple Dialog extending PIDialog Class and placed a picture control at design time using resource editor in windows (Visual Studio).
    When I pass the resourceID of an Image in design time to picture control it displays the image and plugin is also working good but don't know how to pass it at runtime.
    thanks

    Hi,
    Thanks for your reply. My Plugin is an Automation type plugin and is visible in File/Automate menu. I am just opening a 'File Browse Dialog Box' through 'Open File' Button on Plugin Dialog to select a image file (*.bmp) then I want to display that image in thumbnail in Picture Control box on plugin Dialog (just like the File/Automate/Picture Package... plugin already included in Photoshop cs2).
    I have also downloaded the code given by you. again thanks for that. I am trying to understand the code. But I think it is too much for just displaying an image in picture control.
    Thanks

  • How to display reply in flex data grid?

    Hello All,
    Frompast couple of months i am working on a Flex Application which used MySQL databse and PHP as server side language. In this application user can login and they can post their comments which will be displayed in a datagrid. This will have a reply button where other users can send their reply. My problem is how i will be displying the reply of a msg in a datagrid. Here is the screenshot of my datagrid
    I thought of 2 options:
    1. Displaying the reply in the datagrid and disaply in the same row: i don know how we can do this.
    2. Store all the replies in data base and display in toher panel though a button. From flex side it is easy to do but i don know how i can store them in database.
    Please let me know if you have any ideas/tutorials on this

    This is only in theory, haven't actually checked it but I think it could work
    If each one of those posts is done by an itemrender, your renderer can have 2 states stateone and statetwo for example.
    The reply state (statetwo) being bigger and containing space for the reply post.
    Store your replies in the database and have another boolean column ( Tinyint(1) or something) in your MySql db indicating that a particular post has a reply . When you pull your data from the database and put in in an arraycollection check this column for each post and use it to set the state of the itemrenderer.
    That way posts with no reply with be state one, and posts with replies will be state 2 and you can populate the reply field with data from the object in your arraycollection.
    I suppose it all does depend on how you get your data from MySQL and how you store it in Flex but I think states is a way you could accomplish things like this.

  • How many display options for Web Apps are there?

    I know this is going to sound stupid,
    But are there only 2 ways to show web apps?
    Basically - I want to get links to auto populate on one web app, pulling just links to another web page (this web page is one of the fields in another web app), but automatically updated when the category of the "linked to" web app has another product linked to it.
    I know what that reads like!
    The only thing is - these are separate web apps.
    The alternate/backup view of the first web app looks like this:
    Currently - the user has to manually add the links like this:
    Which is not ideal - I just want them to dynamically populate on the fly.
    Is this possible?
    Cheers, Dave

    Funny you say that - as the most obvious things appear in your brain immediately after posting a question... Will see how that works...

  • How to call Flex app from Javascript in portal question

    I've setup my flex 4 app with a callback function. The flex app is embedded in a Java portlet on a WebLogic Portal 10.3.2. How can I call the Flex app from the portlets javascript function? Code below shows how the flex app is embedded in the wrapper jsp.
    <script language="JavaScript" type="text/javascript">
            AC_FL_RunContent(
                        "src", "<%= srcPath %>",
                        "id", "<%= (String)request.getAttribute("portlet_name") %>",
                        "name", "<%= (String)request.getAttribute("portlet_name") %>", 
                        "width", "<%= request.getAttribute("width") %>",
                        "height", "<%= request.getAttribute("height") %>",
                        "align", "middle",
                        "quality", "high",
                        "FlashVars", "PORTLET_WS=<%= request.getAttribute("window_state")%><%= wsrpEncodedChannel %>",
                        "allowScriptAccess","sameDomain",
                        "type", "application/x-shockwave-flash",
                        "pluginspage", "http://www.adobe.com/go/getflashplayer");         
    </script>

    Thanks for the response. I followed the instructions in the link, but it does not appear to work within a Weblogic 10.3.2 portal. My Flex app is wrapped in a Java JSR 286 portlet. Should this approach work or is there a different approach for the portlets wrapper JavaScript to call a Flex callback function?
    thanks
    Dan

  • Configuring socket policy for flex apps(with blocked port 843)?

    We have built several flex-based ecommerce apps for a fortune 500 customer of ours, that for various reasons, we need to use sockets to a different domain and requires a socket policy file, but were having trouble configuring our flex apps for deployment in thier enviornment where they are blocking virtually everything except port 80 . The current documentation in in regards to socket policy files and crossdomain files in a non-standard configuration not using port 843 is not providing any useful help to us.
    Here is the scenario:
    Flex apps are served from domain www.a.com in  to users browsers via http. The apps then make socket connections to domain www.b.com:80 where there are php scripts serving json data to the flex apps via port 80 using http(we use sockets because we need to set and read back http headers). The problem is the flex apps cannot make socket connections to the www.b.com domain without errors like below(unless we setup a socket policy server on port 843 of www.b.com, in which case everything works):
    Warning: Timeout on xmlsocket://www.b.com:80 (at 3 seconds) while waiting for socket policy file.  This should not cause any problems, but see http://www.adobe.com/go/strict_policy_files for an explanation.
    Error: Request for resource at xmlsocket://www.b.com:80 by requestor from http://www.a.com/bin-debug/DownloadManagerFlex.swf is denied due to lack of policy file permissions.
    Error: Request for resource at xmlsocket://www.b.com:80 by requestor from http://www.a.com.us/bin-debug/DownloadManagerFlex.swf is denied due to lack of policy file permissions.
    Since we cannot use port  843 for the socket policy file server, we setup the socket policy server on a different ip in the same domain: spf.b.com:80 (using the sample perl code Adobe provides), and per the docs(cited below), use Security.loadPolicyFile("xmlsocket://spf.b.com:80") before we invoke "socket.connect", to supposedly tell the flash player to check there for the socket policy file. The problem, as you can see from the error log, is that the  loadPolicyFile("xmlsocket://spf.b.com:80") is ignored.
    No matter what we do or how we set things up, we cannot get the flash player to recognize the loadPolicyFile(), it always wants to go to the port were making the socket connection on. It is unclear how to properly configure the flex app, socket policy file and crossdomain file for the above scenario. The docs allude to being able to serve  the socket policy file from a different port 80 in the same domain as the socket connection were trying to make, but were having no luck with that.
    ->Can anyone shed some light on how to make this work or what are we  missing/doing wrong? Also, if we can get this to work, are we  stuck with a 3 second delay because this(very large) customer is blocking port 843?
    As an aside,  the documentation for all this is a bit scattered, unclear and contrdictory:
    One document says:(http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_07.html)
    "This warning usually means one of two things: first, that you need to set up a
                socket policy file server on port 843, which is the first location that Flash
                Player checks by default; or second, that you need to provide more explicit
                guidance to Flash Player from ActionScript by calling loadPolicyFile to indicate the location
                of a socket policy file. When you call loadPolicyFile rather than allowing Flash Player to check
                locations by default, Flash Player will wait as long as necessary for a
                response from a socket policy file server, rather than timing out after 3
                seconds."
    Another document says(http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html):
    "If an ActionScript Security.loadPolicyFile() command exists within               the SWF file, then the Flash Player runtime checks that location. Flash Player checks               the destination of the loadPolicyFile() only after it has checked the               master policy file on port 843 for permission to acknowledge other policy               files. If the developer has not specified a loadPolicyFile() command,               then Flash Player checks the destination port of the connection."

    I found the reason why the Flex application was ignoring the socket policy (crossdomain.XML). I have a policy server that listens to port 843 and submits the policy to the Flex client. My policy was getting ignored by the Flex application and I was getting the sandbox security error you were getting. The solution to this problem isto write a null byte right after the policy server sends the policy. I'm using Apache Mina that is wrtten is Java and the null byte is written as follows:
    public void sessionCreated (IoSession session)
            throws Exception
            session.write(_policy);  -- > policy string
            session.write("\u0000"); --> null byte
             //session.close(true); ---> No need to close the session because it is closed by the Flex client after it receives the null byte.
    Now my Flex application can read and accept the policy from port 843 and I'm not getting more security violations.
    Thanks for your reply,
    Alberto

  • Security for deployed Flex Apps

    I know that there are many decompilers available for .SWF
    files. How can you make your Flex apps secure ?
    I have seen this product, is this reccomened for flex
    http://www.amayeta.com/software/swfencrypt/

    Refer tohttp://www.oracle.com/technology/documentation/1012_solaris/install.1012/install/ports.htm

  • An AS component doesn't appear in a flex app

    The following AS draws a line and works in its own right,
    package components {
    import flash.display.Sprite;
    import flash.display.Shape;
    public class DrawTest1 extends Sprite {
    public function DrawTest1() {
    var shape:Shape = new Shape();
    shape.graphics.lineStyle(0,0x0000FF, 1);
    shape.graphics.lineTo(100,100);
    addChild(shape);
    It was then included in a flex app as
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:custom="components.*"
    layout="horizontal">
    <custom:DrawTest1 />
    </mx:Application>
    but only a blank screen (i.e. without the line) was displayed
    when the flex app was executed (no error message was given during
    compilation). Please help.

    Flex containers (incluing Application) can contain only
    components which are derived from UIComponent or implement
    IUIComponent interface.
    To get your component to display in the application create a
    UIComponent as child and add the DrawTest1 component as a child to
    it.
    <mx:UIComponent id="p1"
    creationComplete="p1.addChild(t1)"/>
    <custom:DrawTest1 id="t1"/>

  • How to exit a Flex app

    I have a Flex application that is run in a browser.  There is a public page and then other pages that cannot be accessed unless the user logs in.  To log in, I show a popup window and the results of their username, password and role determines which page in a viewstack gets displayed.
    My issue is this.  When the user clicks the logout button, I want the app to go back to the public page as if they just eneterd the application for the first time.  Is there are easy way to accomplish this, and is it secure?  If so, how?
    Thanks again!

    if you wanted to just close the window all together you could write some Javascript to close the window, then in your flex app call the function when they click the logout button
    If you want to actually end it with Actionscript you could try:
    public function applicationExit():void {
         var exitingEvent:Event = new Event(Event.EXITING, false, true);
         NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
         if (!exitingEvent.isDefaultPrevented()) {
              NativeApplication.nativeApplication.exit();
    Source: http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html

  • How use PHP to read image files from a folder and display them in Flex 3 tilelist.

    Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
    PHP :
    PHP Code:
    <?php
    //Open images directory
    $imglist = '';
    $dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "filename: " . $file . "\n";
    $dir->close();
    ?>
    FLEX 3 :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.rpc.events.ResultEvent;
    public var image:Object;
    private function resultHandler(event:ResultEvent):void
    image = (event.result);
    ta1.text = String(event.result);
    private function faultHandler(event:FaultEvent):void
    ta1.text = "Fault Response from HTTPService call:\n ";
    ]]>
    </mx:Script>
    <mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
    <mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
    <mx:HTTPService id="pic" url="{phpPicture}" method="POST"
    result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
    <mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
    <mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
    </mx:Application>
    Thanks. Need help as soon as possbile. URGENT.

    i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
    PHP Code:
    <?php
    echo '<?xml version="1.0" encoding="utf-8"?>';
    ?>
    <root>
    <images>
    <?php
    //Open images directory
    $dir = dir("images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
    //$dir->close();
    ?>
    </images>
    </root>
    Flex Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="callPHP();">
    <mx:Script>
    <![CDATA[
    import mx.rpc.http.HTTPService;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var arr:ArrayCollection = new ArrayCollection();
    private function callPHP():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Picture.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    arr = event.result.root.images.image as ArrayCollection;
    private function faultHandler( event:FaultEvent ):void
    Alert.show( "Fault Response from HTTPService call:\n " );
    ]]>
    </mx:Script>
    <mx:TileList id="tilelist"
    dataProvider="{arr}">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Image source="images/{data}" />
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

  • How to display all data on one page in web app

    Hello.
    So I have web app JSF (IceFaces framework) + JBoss all Crystal Report working perfectly. So I have page with Crystal Report tags (e.g.
    <bocrv:reportPageViewer reportSource="#{crystalReport.reportPath}" ...
    in this report I have table with some data (data from DB) and I want to display this data on one page. Unfortunately now this data are moving to the next page and unfortunately I even donu2019t know how switch to the next page (I see only info e.g. 1with 2).
    So how to display this data on one page if its impossible how to torn on pagination.

    So I canu2019t do this, I canu2019t display all data on one page (until Iu2019m using JSF tags)?
    In JSF tags Iu2019m setting only path to file. In my bean Iu2019m using u201CReportClientDocumentu201D object itu2019s easy way to load report file (u201Copenu201D method) and set parameters (u201CgetDataDefController().getParameterFieldController()u201D method) and also connect to data base (u201Clogonu201D method) but I havenu2019t this property u201CsetSeparatePages(boolean)u201D.
    Maybe Iu2019m doing this wrong and there is a simpler way maybe I can use somehow u201CCrystalReportVieweru201D please give my any advice.

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • How to debug 4.5.1 flex app in Black Berry play book?

    Hi ,
         i do want to know how to debug the 4.5.1 flex app in Blackberry playbook and the process  or do we need do enable any properties  plz let me help on this ASAP.
    Thanks

    Simeon,
    Thanks for that, I had a brainfart and forgot you can have the properties defined in that manner.  I changed it but it still wasn't working which made me realize I had to change the backgroundColor property on the view in Away3D.  I realized this after trying the params for the class and then not adding the view (which had a white bg) and then i looked at the docs and bam, there it was.  Thanks!
    Matt

Maybe you are looking for