Actionscript :: Programmatically Change The Source Of An Image Whose Name Is Ambiguous?
Sep 20, 2009
How do you say or achieve container.child.source = image.png?
I have a hexagon map built by specifying width and height. I draw a wireframe and place a base image for each hex into a canvas. Next, the canvas listens for a mouse click. I then run a calculation to determine which hex the mouse click was closest to. My intent is to change the source of the image that the user clicked on.
I know that mapSlate.getChildByName(mapProperties[closestHex]['baseName']) is the intended hex but I can't quite get to the point of doing a .source as Flex doesn't know that the selected object is an image.
I want to change the image at click event.I change the source of the image on click but its not reflecting immediately it comes when any other event is fired.
I'm trying to programmatically print a movie clip to 8.5" x 11" plain paper regardless of the current paper size setting in the printer. e.g if the user's printer is currently set to use paper size A4, can I change the setting to Letter (8.5" x 11") from ActionScript at runtime? I use PrintJob class for printing the movieclip. According to the ActionScript online API spec [URL], I can only READ the paper size setting after the call to PrintJob.start. I can't believe that we are not allowed to change the setting.
I'm trying to programmatically print a movie clip to 8.5" x 11" plain paper regardless of the current paper size setting in the printer. e.g if the user's printer is currently set to use paper size A4, can I change the setting to Letter (8.5" x 11") from ActionScript at runtime? I use PrintJob class for printing the movieclip. According to the ActionScript online API spec [URL], I can only READ the paper size setting after the call to PrintJob.start. I can't believe that we are not allowed to change the setting.
I am using Flash CS5 as an AS2 and player 7 SWF output.I have a interface that needs to change to another language while the system still matches the users locale.The STRING panel has a "Stage language' combobox that allow me to change this during development.I have a 30 plus languages that are going to be using a series of Flash templates I am making for non-programming movie developers.I am setting it up to use internal language selector and hiding that in other uses and have external language selection change the language (Director, Authorware, other programs).(I will one day go to AS3 when I automate the development process for them)
I have a comboBox component with a CHANGE event listener on it:
dd_chapter.addEventListener(Event.CHANGE, changeFunction); function changeFunction(event:Event):void { trace("changed!"); }
I want to trigger that event programmatically when the comboBox first gets loaded with data. In AS 2, the syntax would be something like "dd_chapter.onChange();". How do I do it in AS 3?
i want to know whether its possible to change the local settings manager of flash programatically?. Earlier when the global settings manager was there i changed the settings by directly editing the .sol file? Will the same work now?
I am changing image through flex every time i change it saved into server directory with same name(which i am referring to show). So when i refresh my page my browser didn't send new request to server since it's already in request.so didn't getting new image.Tip:- when i clear browser history it will come with new image
I am creating an image gallery and the images change but change right back to the original image. I had it working yesterday but today it doesn't work.
I'm developing an Blackberry Playbock app with ActionScript 3.0. I'm very very new with this. I have the following project structure (I'm using Adobe Flash Builder "Burrito"): project
[Code]...
On image folder I have several PNGs images that I want to load programmatically.
I'm working with a UILoader, and I will have it display images; but the images have to be in the library to cut down on overall content size. So I have to somehow refer to images in the library by code to display in the UILoader. How can I do that?
I have two frames in my Flash piece. On one frame I have a combobox called source_id, and on the other frame I also have a combobox called source_id. Now I know I could rename these but I want to keep them the same for various reasons.
I made a .swf file which contains a video player linked to an .flv file (which I had to fill in by Source in the Parameter menu of Flash CS3).But how can I make this source variable so that I can change the source by JavaScript?
I'm working with a UILoader, and I will have it display images; but the images have to be in the library to cut down on overall content size. So I have to somehow refer to images in the library by code. How can I do that? Would the following code work?
var photoURLReq:URLRequest = new URLRequest(photo1:Photo1InLibrary);loader_mc.load(photoURLReq);
or
var photo1:Photo1InLibrary = new Photo1InLibrary();loader_mc.load(photo1);
I've reviewed all the documentation and Google results surrounding this and I think I have everything setup correctly. My problem is that the symbol is not appearing in my app. I have a MovieClip symbol that I've embedded to my Flex Component. I need to create a new Image control for each item from my dataProvider and assign this embedded symbol as the Image's source. I thought it was simple but apparently not.
Here's a stub of the code: [Embed(source="../assets/assetLib.swf", symbol="StarMC")] private var StarClass:Class; protected function rebuildChildren():void { iterator.seek( CursorBookmark.FIRST ); while ( !iterator.afterLast ) { child = new Image(); var asset:MovieClipAsset = new StarClass() as MovieClipAsset; (child as Image).source = asset; }}
I know the child is being created because I can draw a shape and and that appears.
In Flex, how to assign swf as image source at runtime, not embedding it.[Bindable] public var myImg:String;<mx:Image id="intImg" source="{myImg}" width="96%" height="96%" />In my application, I fetch image url dynamically from a web service call, and assign it to "myImg". But until I don't get the response from the web service call, I want to show a loader swf in image control above. I assigned something like:myImg = "assets/AS3.swf";and the path of swf is correct, but it doesn't show up.UPDATE:The code I've shown above works perfectly in a Flex 3 app but the swf does not show up in a Flex 4 app. Is it because Image control has dropped the support for swf in Flex 4 ?
I have an image which its source depends on a bindable property of another object.I'd like to know when this source changes, for example, by capturing the bind event or another related event of the Image control.
I would like to display an Image using a Bitmap as source. I've looked at many websites and most suggest something akin to this but somehow it still doesn't work....img1 works fine... But img2 doesn't load for some reason.
private function onComplete(event:Event):void{ bytes = event.target.data; img1.source = _bytes; /*this last bit works*/[code]....
I want to make a simple .swf file with an image. The source of the image is not fixed but dynamic. It should be a user's profile pic on facebook [URL]. I can get the user facebook id's dynamically with a php file that generates XML. How do I make the .swf extract the image source from the xml?
I did small flash where i exported layers from Photoshop and converted them into movieclips. currently i need to change they image source to other when i click on button.this one is required to make swf file smaller to load files after loading swf file itself. .
share with me a source of Simple XML image slideshow. I just want to see the method of loading pictures and switching between previos and next of the current one.