Change the BitmapImage source on a decision-making event

Hello

I have a BitmapImage and I would like to change its source during execution.

<BitmapImage source="img1.png" id="img" smooth="true" smoothingQuality="high"
      
transformX="102" transformY="162">
   
<filters>
       
<DropShadowFilter distance="-1" angle="45"/>
   
</filters>
</BitmapImage>


In the script part, I change its source so that it points to another picture.


img.source = "img2.png";

If the previous assignment is inside the mouseDown Manager, it works perfectly. But if I place it in a method that is triggered when data is received via a socket, the source remains unchanged.

What I have discovered so far is: I added an event listener for the type "sourceChanged" and it is actually triggered, but when I inspect the source, point it to the old image.

Thank you!

Hello

It turned out to be a bug in my code, completely independent of sockets or anything else.

Not sure how to proceed... should I close this post?

Tags: Flex

Similar Questions

  • Why firefox free version 29.0.1. It's terrible! I had to find a plugin to change the back legs. Bad decision. Why this was done?

    Why firefox free version 29.0.1. It's terrible! I had to find a plugin to change the back legs. Bad decision. Why this was done?
    Not happy with the version 29.0.1 - are there plans for this move?

    Hi RickAce

    Could you please start a new thread for your question?

    You can provide more information such as your operating system and installed extensions and plugins installed.

    In case of accidents also please add a few recent crash ID that you can find on the subject: page hangs and which begin with a prefix 'bp '.

    You can check for problems with the files that store the preferences.

    Delete a possible user.js file and files numbered prefs-# .js and rename (or delete) the file prefs.js to reset all the prefs by default, including the prefs set via user.js and pref which is no longer supported in the current version of Firefox.

  • Change the data source in my ApplicationModule

    Studio Edition Version 11.1.1.3.0

    I have the following problem:
    in WLS 10.3 I've defined three global DataSource (or several)

    and I have only a single ApplicationModule. Can I change the data source in my ApplicationModule (by code)?

    THX Thomas

    Envoy

  • Change the ImageView source in C++

    Hi guys

    I'm trying to edit an ImageView in C++ source

    I first link QML and C++, can I change the source as in the reference Images

    toplogo = root->findChild ("toplogo");

    toplogo-> setImageSource(QUrl("assets/images/logo.png"));

    The image exists, however, the program crashes and the log indicates that there is no source.

    I tried QUrl errors for different combinations of URL of the image of logging:

    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>
    qDebug()< "error="" url:"=""><>

    But the newspaper still prints for all attempts:

    URL ERROR: ' invalid URL 'asset:///images/logoideas.png' ":" '.

    Any ideas would be appreciated.

    Pepe

    You must use the property objectName (not the id property) > please see my post above

    in QML

    ImageView {}
    objectName: "'toplogo" "

    }

     

     toplogo-> setImageSource (QUrl("asset:///images/logoideas.png"));)<- app="" crashes="">

    It hangs here probably topLogo is NULL

    If {(topLogo)

     toplogo-> setImageSource (QUrl("asset:///images/logoideas.png"));)

    }

  • OBIEE Mapviewer 11.1.1.7.1 cannot change the data source

    Hi all

    I am trying to configure mapviewer on our environment and after

    by clicking on configuration

    Add the DB details

    Save & Restart is updated the file xml but not displayed on the data source tab.

    But where as the other details of DB, I am able to add without problem, then if I click on change by selecting the data source to add/edit the details required to DB I get following error.

    Source of data editing is not yet supported. However, you can delete and re-create it with the new settings.

    and on the Management tab is not showing me any option to add the new source of data manually.

    someone has encountered this problem before. TIA

    Maybe the connection details are wrong, you see something in the Map Viewer logs files?

    under FMW_HOME/Oracle_BI1/bifoundation/jee/mapviewer.ear/web.war/WEB-INF/log/mapviewer.log

  • dynamically change the video source flv to flv play back...

    Dear friends,

    IAM trying to load flv files in flash using flvplayerback components. IAM using the following code. Initially, iam loadign video1.flv. So I want to load video2.flv when I press the next button. It loads video2 only when I press the next button after completing the full video1. I want to change the source at any time please tell the right way.

    Import fl.video.VideoProgressEvent;
    Import fl.video.VideoEvent;
    PLR.source = "video1.flv";


    plr.addEventListener (VideoProgressEvent.PROGRESS, showmsg);
    function showmsg(event:ProgressEvent) {}
    If (plr.bytesTotal == plr.bytesLoaded) {}
    trace ("Loaded");
    loaderpic. Visible = false;
    }
    }

    plr.addEventListener (VideoEvent.COMPLETE, complete);
    function comple(event:VideoEvent) {}
    trace ("film completed");
    }

    nxt.addEventListener (MouseEvent.CLICK, nxtclick);
    function nxtclick(event:MouseEvent) {}
    PLR. Stop();
    PLR.source = "video2.flv";
    PLR. Play();
    }

    Thanks in advance,

    Syed Abdul Rahim

    The code that show you works fine for me when I put things up to match.  When the button is clicked the first video is stopped and another replaces it.  Maybe you have another code that interferes.

  • Change the video source (even video but better quality)?

    Is it possible to change the video from the source of a project with another video which is exactly the same (same fps, same proportions, same time) video, but with better resolution, where all the changes on the last video source will remain on the new video source?

    My situation is that I found a version 720 p 480 p video, I worked (long) with.

    As Jim said, you can do outdoors.

    Sometimes we run with proxy support and who in the Proxy file with the quality full folder native (or ProRes).  You can either share the folder names, move files or in Premiere Pro, you can take the files offline then back online by right-clicking and choose reconnect media.

    This is the easiest part

    If you've been editing on a timeline of 480 p, then through 720 p images bringing you either have to change the settings for the sequence (you can also create a new sequence with the right settings, then copy/paste) or you need to tell Premiere Pro videos 720 p to 480 p sequence size nationwide.

  • Changing the SQL source region according to requirement

    I have a region of reports that shows the results of some SQL codes. According to the value of a variable to the page I need to run a little different from SQL to get my results. Right now I use 5 different regions and display one suitable and hide others, according to the value of the variable on the page.

    It's a bit messy and I'm looking for a better way to do it. Is it possible to use a single region and change the SQL used as the source of the region after checking my page variable? for example something like this for the source of the region:
    IF :report_type = 1 THEN
    
    SELECT col1, col2, col3 from table1;
    
    ELSEIF :report_type = 2 THEN
    
    SELECT col1, col2, col3 from table2;
    
    ELSEIF :report_type = 2 THEN
    
    SELECT col1, col2, col3 from table3;
    
    END IF;
    .. or something similar?

    Or is there an even easier way to do it?

    Hello

    for "normal" (non-interactive reports), you can provide a block plsql returning a sql query
    as the source of report...

    declare
    v_sql varchar2 (4000);
    Start
    IF: report_type = 1 THEN
    v_sql: = "SELECT col1, col2, col3 from table1";
    ELSE IF: report_type = 2 THEN
    v_sql: = "SELECT col1, col2, col3 from table2";
    ELSE IF: report_type = 2 THEN
    v_sql: = "SELECT col1, col2, col3 from table3";
    END IF;
    Return v_sql;
    end;

    as said - this does not work with interactive reports...

    Best regards

    Carsten-

  • Change the input source

    I can't use Ctrl + space to switch the input source, why?

    because the command is CTRL + space.

  • change the data source

    I two oracle database, we're for the objective test and another is for production, same table, same name of schema structure there... but diff tns. My question is how quick test for the production of simple way? I tried just add two pool of connections under a schema in the physical layer, but it does not seem to work, can anyone help with a this? Thanks in advance!

    Ishmael

    You can have a single Pool of connections for this requirement. Double click the Connection Pool and change the DSN, user id and password and and keep the RPD when you want to pass the tests of production, or vice versa.

  • Change the Image Source programmatically

    Hello

    I have a problem changing my source of image based on a value in a variable.

    The following function gets the shot, but I'm getting a TypeError: Error #1009: cannot access a property or method of a null object reference. error.

    I tried embedding, and the solution you see below (I've found here - as I am chaning to run time http://forums.adobe.com/message/116979#116979), but no luck

    I'm sure its how I am mapping the png, but I can't be sure... any suggestions?  I was banging my head against my desk for centuries on this!

    function (note: track proves that the value to modify the image is correct)

    public void LeversComplete (): void {}

    if (PodContentBase._ProjectDetail.getItemAt (0).) IndustryLeadingMastery is "N")

    trace ("Value" + PodContentBase._ProjectDetail.getItemAt (0).) IndustryLeadingMastery)

    imgIndustry.source = ' / assets/bigcheese.png ";

    else {imgIndustry.source = ' assets/Nocheese.png'}

    }

    Image (note - it is placed as a default - default settings and in fine)

    < mx:Image id = "imgIndustryleadingtechnicalmastery"

    source="assets/bigcheese.png"/ >

    Photo of the Directory Structure:

    path.JPG

    A few questions... The 'id' settings are different in your example.  In your actionscript code, the id is "imgIndustry" but in the mxml the id is "imgIndustryleadingtechnicalmastery".  Pass, how do you know that your image has been created yet, which is often a source of null pointer exceptions.  Whenever I think that this is a problem, I do something like that

    ... AS3...

    [Bindable] public var imageSource:Object;

    ... MXML...

    If in fact the problem is that the image is not created, it will solve it because the image will go and get its source when it is good and ready.

  • Change the audio source

    I have some hearing aids Starkey that my iPhone 6 passes to for a phone call.  Since iOS 10 has been installed, it doesn't seem to be an easy way to stop the streaming so I can put off the phone to someone to hear it.  I used to drag up from the bottom and he gave me the opportunity to move to phone audio, speaker, or hearing aids.  This possibility seems to have disappeared.  Any suggestions?

    Still, you drag to the top of the bottom, and now there are two options, you will need to slide from right to left to the option of audio source.

  • change the video source on the fly

    something like this:

    private function micChanged(event:Event):void
                   {
                        
                        audioPub.stop();
                        audioPub.microphoneManager.micIndex = micSelection.selectedIndex;
                        audioPub.publish();
                   }
    

    but it doesn't work...

    Hello

    You may need to wait that the stream has been removed i.e. listen event StreamEvent.STREAM_DELETE in the audio editor and after that set the Manager of the microphone and then you post.

    Do you use multiple microphones/cameras?

    Thank you

    Hironmay Basu

  • How to change the strong source of size?

    Is it possible to do this?

    That's not scale.

    CTRL + SHIFT + Y = layer--> Layer Properties

    Mylenium

  • I want to change the text of my element a score event

    Hello

    I'm trying to change my hover item text and what event is preferable to put the code on?

    You can use .html or .text

    SYM.$("Text2").html ("test");

    It works, add it to the "mouseover" event

    I hope this helps

Maybe you are looking for