Flex Image is not loading Dynamically - image

I am making a mobile app that will show users an image. Image is appearing witout a problem with this code:
<s:Image id="img" width="100%" source="assets/images/2.jpg"/>
But when I try to set the source property of Image like this:
function button1_clickHandler(event:MouseEvent):void
{
img.source = "assets/images/2.jpg";
}
<s:Image id="img" width="100%" />
the image is not appearing without error.
I don't know what I'm doing wrong, I just want to change image's source at runtime.

Problem solved after restarting Flash Builder

Related

NEXTJS - public images not showing on dynamic routes

I have a problem with serving a static image from my public/images folder.
It correctly displays in the files I've been working on so far EXCEPT the dynamic file [itemId].js (shown in the picture below)
The most interesting clue I have is this error in the console.
http://localhost:3000/items/_next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=1920 404 (Not Found)
It tries to serve from /items, which is not what I want at all...
Does anyone know what's the trick behind this? If you need more informations, let me know.
// in components/Header.js (which is wrapping all of my pages)
import bannerBig from "../public/images/banner-big.png";
// then i use it this way with the Image component from next/image
<Image src={bannerBig} alt="midnight city" width={1920} height={800}/>
The img generated by the <Image /> component looks like this and is the same accross all of my pages:
<img alt="midnight city" src="_next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=3840" decoding="async" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" srcset="_next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=1920 1x, _next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=3840 2x">
so I finally fixed the problem by adding a '/' before my static image path so it's always being served from the root
<Image
src={"/" + bannerBig.src}
alt="midnight city"
width={bannerBig.width}
height={bannerBig.height}
/>

HTML:Image won’t display

My image won’t display for no reason. I am a noob but I can’t figure it out. The image loads from the url so I know it’s not that. So I’m pretty sure it’s my problem with the coding.
<body>
<img src=https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?dl=0
Height=300Width=250>
</body>
Your URL is pointing to non-image resource. It's actually pointing to an HTML document.
In URL, change www by dl and remove ?dl=0.
This is valid image URL :
https://dl.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG
Alternatively, you can replace dl=0 to raw=1. This is also valid image URL:
https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?raw=1
Not always required but as a good practice I'll suggest using quotes for values. Also as mentioned in comments seperate attributes from each other with white space.
<img src="https://dl.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG"
height="300" width="250"/>
<!--OR-->
<img src="https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?raw=1" height="300" width"250"/>
source : Mickel's Tutorial
I hope, you must use the url of image, But you are referring the url preview pane of dropbox.
It is the actual url for image.
You also need some improvisation with your code, as below
<body>
<img src="https://uc215f04ebb05efbc98d874fefb2.previews.dropboxusercontent.com/p/thumb/AA767gGwgVfZ9rVS7PJbtIOR3eQsWN4mrXjNjVJH3JKjhI5eE7JOd-eQJwydUx1gPkpE3zkAnMSN3-1KEtFN86x-CdWnREg0mQ6hm7APBCuifux1ECDivRuLkrikn1sY_r20EmBWucKHyy-Ps5VPB8ehkUB6x0y9kSb3QzYpP8fOo7IeyR6IaCYZ66mxrJiUiUtzTAV3ddESpRV7lSRaumsSyVPc4k1RbUBS3-_JDnP8Qv6M42x2g7bZDy9vdhhIOZaO585_XQHegapCJ-8bnwLGt-VEy9nud0avi_gzMSpXxx3EXt_NYTWMfFqfstb2HFMVb7WK7jxkSRSX5eE5ck3Q0bdEPAKp1aPnClU2KqI-OgUea6ApGp4G0H4Q3l3UyOjfomtn-SndAAaUzPbaU1HK/p.png?fv_content=true&size_mode=5" height="300" width="250" />
</body>
It will work without any issue. You are not referring proper url that the actual issue.
Also, keep tag properties in quote "" if required.
Like
<img src="url" height="200" width="300" />
Thanks.

Header image on SAPUI5 application

I am just trying to add the image on index.html. I have create a folder of images under webcontent and add the image in images folder. I am calling it in the following way:
<HBox >
<Image
src="{./images/abc1.jpg}"
width="100%"
height="100%"/>
</HBox>
But it is showing nothing on browser. Please advice.
You use curly brackets when you are trying to bind data from a model.
Since you are not using a model to bind data. You can remove it and try.
Code for the same is as mentioned here:-
<HBox>
<Image src="./images/abc1.jpg" width="100%" height="100%"/>
</HBox>

JPG not showing

![enter image description here][1]I've tree jpg to show. Here's the html:
<img id="carrossel1" class="imagemCarrossel" src="/images/home/fundo_carrossel1.jpg" />
<img id="carrossel2" class="imagemCarrossel" src="/images/home/fundo_carrossel2.jpg" />
<img id="carrossel3" class="imagemCarrossel" src="/images/home/fundo_carrossel3.jpg" />
The first one is rendered fine. The two other not.
The image folder have:
fundo_carrossel1.jpg
fundo_carrossel2.jpg
fundo_carrossel3.jpg
The 2nd and 3rd don't show up in Chrome of Firefox...
Maybe your CSS is modifying the elements resulting in a change of display behavior. Can you post the CSS you are using to further try to help?

replace image with a video embeded

Hi I'm trying to modify a web page so that it loads faster.
Since I have some videos embeded (blip.tv but can change it to youtube if it helps) I was wondering if you could load an image where the video should be and on click replace the image with the video and start playing (without reloading the whole page).
I think I've seen this before, but can't find it anywhere anymore!
right now the code to embed I use is:
<object data="http://blip.tv/play/gYMo_vAmAA" type="application/x-shockwave-flash" height="500" width="600"><param name="src" value="http://blip.tv/play/gYMo_vAmAA"><param name="allowfullscreen" value="true"></object>
Thanks
Quick and dirty: you could just set the embed code as a global variable somewhere:
<script type="text/javascript">
var embedCode = '<object data="http://blip.tv/play/gYMo_vAmAA" type="application/x-shockwave-flash" height="500" width="600"><param name="src" value="http://blip.tv/play/gYMo_vAmAA"><param name="allowfullscreen" value="true"></object>'
</script>
Then put the image in a container div and replace the container's innerHTML onclick:
<div id="videocontainer">
<img src="yourimage.jpg" onclick="document.getElementById('videocontainer').innerHTML = embedCode;" height="500" width="600" />
</div>
There's a Google code project called SWFObject, which is perfect for what you need. It's a cross-browser javascript library for loading flash - and you could use it to replace your image with the flash video when someone clicks on the image, for example.

Resources