Using swf for source of spark image
Hi, I'm not sure if something changed in flex 4.5.1 but I have a published version of my app from earlier (flex 4.0) that uses a spark image control and I'm able to assign a swf as the source and it displays no problem. I just tried in my newest version and I recieve an error "Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@e523f91 to flash.display.Bitmap". I'm not trying to access any properties -- just setting '.source = abc.swf'.
Anyone have any idea why I can't assign a swf to an image control anymore?
Yeah, it was harder than I thought it would be. I got it to display with this subclass of BitmapImage, but I didn’t beat it up so there might be other issues:
package
import flash.display.Sprite;
import flash.display.LoaderInfo;
import spark.core.IGraphicElement;
import spark.core.DisplayObjectSharingMode;
import spark.primitives.BitmapImage;
import mx.events.FlexEvent;
public class MyBitmapImage extends BitmapImage
private var imageWidth:Number;
private var imageHeight:Number;
override protected function measure():void
super.measure();
measuredWidth = imageWidth;
measuredHeight = imageHeight;
override public function canShareWithPrevious(element:IGraphicElement):Boolean
return false;
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
super.updateDisplayList(unscaledWidth, unscaledHeight);
override protected function contentComplete(content:Object):void
var loaderInfo:LoaderInfo = content as LoaderInfo;
// For untrusted content we must host the acquired Loader
// instance directly as our DisplayObject.
displayObjectSharingMode = DisplayObjectSharingMode.OWNS_UNSHARED_OBJECT;
invalidateDisplayObjectSharing();
// Create a content holder to use as our display object.
var contentHolder:Sprite = new Sprite();
setDisplayObject(contentHolder);
contentHolder.addChild(loaderInfo.loader);
// Retain our source image width and height.
imageWidth = loaderInfo.width;
imageHeight = loaderInfo.height ;
// Update
if (!explicitHeight || !explicitWidth)
invalidateSize();
invalidateDisplayList();
// Dispatch ready event
dispatchEvent(new FlexEvent(FlexEvent.READY));
Similar Messages
-
Can I use OCR for just a single image in a text document?
Hi All
I have a 37page pdf document that is mostly recognised text. i think this document was created in MS word then converted to PDF. I did not make this document.
There are images inserted on some pages that are scans from another document. The document has footnotes, page numbers, title, text paragraphs on the pages with the images i want to ocr. I have already used the highlight an sticky note functions for some of the recognised text and don't want them lost.
I have tried using OCR for the whole document but it doesn't work (renderable error).
Can I use the OCR function just on a selected image within a document that has renderable text for the most part?
thanks.Read what it says on the ATT page
http://www.att.com/ipad/?fbid=s18K8c1ujw3
Cheers, Tom -
Hi,
I'm trying to fix the orientation of an UIImage in my app (iPad 2, iOS 7). I'm using the method described here: https://gist.github.com/alex-cellcity/1531596, but a huge memory spike appears when CGContextDrawImage is called. The image size I'm trying to fix is 2848x4288.
Anybody knows any algorithm to avoid this huge spike?
Thanks,
Roberto.While I never done iOS code it appears that the code you link to basically does the following:
takes a large image A
generates a transformation matrix by doing rotation in 90 degree increments and by mirroring
creates a large image B
draws image A into B using the transformation matrix
releases memory for image A
goes on using image B
This results in a memory peak as you have two large images in RAM, until image A gets deallocated, which can't be done until B has been drawn.
I can see two possible solutions to this, both which probably require you to explicitly modify individual pixels:
1) Try to simplify the solution - if 180 degree rotation and mirroring is enough to solve your image issues, then a simple in-place (same bitmap) pixel swap could be done.
2) Find more memory - if you need 90, 270 or arbitrary degrees of rotation as well, you could instead keep either image A or B on disc.
Keep image A on disc: read pixels from disc and place appropriately in image B. This may require you to first load image A and write it back to disc as ARGB data (one byte for each color) for easy access.
Keep image B on disc: get pixel from image A and place it at the right location in image (file) B - this will require pre-creating a file of the correct size for Bs ARGB data and then moving the insertion point for writing around. When done dealloc image A and load image B.
Keep image A and B on disc: combine using disc for image A and B - this will minimize RAM usage but will probably be the slowest solution and will increases disc (SSD/flash) load and wear. -
Use bitmap for texturing a vectorial image
How can i use a bitmap tile for texturing a vectorial image ?
Select-bitmap> Modify> Bitmap> Trace Bitmap
detailed settings make flash crash so be careful. This converts bitmap to vector if thats what you were looking for. -
Using isetup for source and target instace being same.
Can we use isetup to create a replica of existing operating unit and the modules connected with it?
Ahmed,Yes, Yes. Very much. You can have a look at 'Financials Operating Unit Level Setup' selection set to achieve what you are looking for. Here is the step to do:
1) Create an Extract using 'Financials Operating Unit Level Setup' selection setFinancials Operating Unit Level Setup' selection set
2) After successful completion of Extract, transform the Extract using Transform module. During transform you can change the Operating Unit name.
3) Load the Transform to same instance.
Make sure that you have all mandatory patches applied on your instances. I have documented the required patches on each release in the announcement section.
Thanks
Mugunthan. -
Use DW for mouse over button images but won't validate
Hi All,
I've done this three times and give up. Here's the link http://pooledesignstudio.com/wendysawesomeart/
I used the Rollover Image icon on the common tool bar and created my nav bar.
When I try to validate I get 24 errors and they are in the code that DW generates to make the rollover switchout happen. I have no idea how to fix it.
Please help.
Thank you,
KathPooleThe simplest fix is to change the DOCTYPE.
You're using a XHTML Transitional DOCTYPE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
If you replace it with a HTML5 DOCTYPE
<!DOCTYPE HTML>
you'll eliminate most of those "errors".
http://bit.ly/fEEVZk -
Hi All,
While testing a website which uses SWF for photo uploading, I
was able to upload the photos on test server. But on LIVE several
people were not able to upload photos, also many people could. it
was not an issue with flash plugins. But many user could not just
view the button "Upload" button. Mostly imac users. any idea why it
happened?
Th whole photo uploading functionality is in flash.
Please suggest/advice.> Please suggest/advice.
Try asking your question on a Flash forum -
How to use swf file for Spark Skin
Hi all
I have little confuse about how to use swf file with Spark Skin,
in Flex3 , i use Flex Skin Design Extension for Flash to deal with skin ,
so basically , I just create a swf file and import to the project , then everything is ok
but , seem that not working in flex4 , spark skin.
1` I can't find the Flex Skin Design for the FlashCs4
2` I try to use FlashCs3 version to import the skin art to the project , but seemed not working.
3` I Google and check the Flex4 Help , seemed Spak skin need the Skin-Class , which I don't know how to use that with swf file
what I have searched is how to use FXG , or some jpg file in that skin class, none of them are use swf file.
so , is there any way that let user use the swf file to deal with the skin?
is the Flex Skin Design can use in Flex4?
ThanksHello,
I'm new to Flex, but have come to it from Flash Pro. I'd like to know the same thing. I think I found the answer here:
http://www.flashallys.com/blog/spark-button-skinning-with-flash-symbols/
However my question is now: Is this a good approach to use?
99% of the googling I've done tells me to skin components with fxg files. I've tried that by creating graphics and exporting from flash, but using swfs containing lots of graphics is much faster so I'd rather use that.
The other thing I've done is to create custom components using these helpful tutorials:
Creating component in flash:
http://www.webkitchen.be/2008/12/12/video-tutorial-make-flex-components-with-flash-cs4/
Dealing with Resizing with method overrides for your flash component:
http://www.psyked.co.uk/flex/creating-flex-components-the-easy-way-for-flash-ide-converts. htm
This allows me the flexibility of Flash Pro design with the layout, transistions, data binding etc from Flex.
So my question is: Is this approach (skinning spark components with swfs, and using custom swc components made in flash) a bad idea for any reason? E.g. does it create slow mobile apps?
Cheers
Chris -
Spark Image can't scale embedded SWF symbols?
Can anyone help me make sense of this?
Using Flex 4.5.1 (Spark only compile) I've found that the new Spark Image control works inconsistently when loading SWF at runtime and embedding SWF symbols. See these two situations:
1) OK - Spark image loads a whole SWF in runtime. Swf loads OK and scales up to desired size with perfect smooth anti-aliased edges
2) Not OK - Spark Image loads an embedded swf symbol as follows:
<s:Image source="@Embed(source='embedded/GeneralSymbols.swf' , symbol = 'komodoDragon')" x="250" y="35" height="200" />
( or using a bindable class )
And the image is pixelated and totally unusable.
It seems unfortunately that when embedding Swf Symbols ( which is a big element of the Adobe Flex - Flash - Illustrator workflow ) the "vector" images are reduced to bitmaps at their original size and don't scale.
I know spark swfLoader is a possible option - but surely it's too heavy for loading many images?Hi Ged_mc.
Did you find the answer to this?
I'm using Flex 4.6 SDK and having the same problem. It's kind of dumb, isn't it?
Especially since I'm migrating an application from Flex 3 to 4.6 and it worked perfectly in the previous version.
Thanks! -
Use Web API url for loading an external image in a report
Hi there,
I am trying to host an image in a report, which is coming out of a Web API. I am able access the image through a URL in a browser:
https://companytest.com/api/TestFormImage?id=10358&EntityId=6719&imgMetadataName=TestDiagram
Can anyone please help me how to include this in a report ? I have tried to include this as an external image with the URL embedded as a string like:
=string.Format("https://companytest.com/api/TestFormImage?id=10358&EntityId=6719&imgMetadataName=TestDiagram")
NOTE: the output of the Web API is an image of MIME type PNG.
Thanks in advance!
Regards, LaksTo add an external image
In report design view, on the Insert tab, click Image.
On the design surface, click and then drag a box to the desired size of the image.
On the General tab of the Image Properties dialog box, type a name in the
Name text box or accept the default.
(Optional) In the Tooltip text box, type text to display when the user hovers over the image in a report rendered for HTML.
In Select the image source, select External.
For an image on a report server in native mode, type a relative path to the image in the
Use this image box—for example, ../images/image1.jpg.
For an image on a report server in SharePoint integrated mode, or any other Web site, type a full URL to the image in the
Use this image box—for example, http://<SharePointservername>/<site>/Documents/images/image1.jpg.
For more information, see Specifying Paths to External Items (Report Builder and SSRS).
(Optional) Click Size, Visibility, Action, or
Border to set additional properties for the image report item.
Click OK.
Andy Tauber
Data Architect
The Vancouver Clinic
Website | LinkedIn
This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
"Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread. -
I have a MacBook Pro Retina (2,3 GHz Intel Core i7 - 8 GB 1600 MHz DDR3 - Intel HD Graphics 4000 1024 MB). I use KompoZer for my website, but after installing OS X Yosemite it doesn't work right (I cannot see images in the website).
It's beta open source software so I'm not surprised. It does't look to be too active a project, so I don't know if it will help or not but you might be maybe better off posting a bug report on their Sourceforge page here: http://sourceforge.net/projects/kompozer/
-
Can you use a swf file like a background image
The header has a css background image and the spry menu bar
lays over it. Is it possible to attach a swf file as the background
image in css or even in html?
Maybe as a background-attachment somehow? Or simply in the
html code?
I am using CS4 but I believe the website was created with
CS2.I don't know anyone, that knows what they are doing, that uses flash for websites anymore
There are a few holdover gaming sites that still use it, but even those guys are making the move to JavaScript, HTML5 and CSS3.
@bretC,
There are far too many people using mobile & tablet devices that don't support Flash (iOS, Android, Blackberry, etc...) It's not good business to ignore those people.
In terms of alternative technologies, look at HTML5, CSS3 and JavaScript animations made with Edge Animate. These are well supported on all modern devices. Edge Animate is part of the Creative Cloud plan. Products | Edge Animate | Adobe TV
Nancy O. -
I have a Spark Image component that is displaying thumbnails. There are a few thumbnails that were exported to FXG. I'd like to use those FXG thumbnails sometimes. Is there a way to use those FXG thumbnails in the Spark Image component?
The spark Image should act the same as BitmapImage. Check out this article for an example of how to do it: http://blog.flexexamples.com/2010/10/10/displaying-an-fxg-file-in-a-spark-bitmapimage-cont rol-in-flex-4/
-
I am running 10.6.8 and using iweb for my web site. After several SEO analysis they all indicate I need H1-6 header tags. After looking at the source code I see there are none in iweb. Are they necessary to add? Why would one add these tags and how do I add H Tags to iweb? And are there examples to look at? I am slowly learning about simple web design and assumed that iweb was stand alone without having to write code. Is this one of the reasons iweb is no longer supported? Thanks for looking at this!
A simple text page like this:
Heading
sub heading
text paragraph ....
Is traditionally represented by html tags like:
<h1>Heading</h1>
<h2>sub heading</h2>
<p>text paragraph ... </p>
I would guess that the use of h1-h6 tags helps search engines to understand the structure of a page as the tags imply a certain structure.
This can be compared to more generic tags like <div> that could represent any kind of content - and may be what iWeb uses (you'll have to check yourself).
I would generally recommend that you use some kind of up to date blog/site building tool, perhaps Wordpress or Squarespace (I haven't used either one myself) that support current web technologies - this should reduce your SEO issues and make it easier to properly support mobile/tablet users. -
I am trying to connect a Macbook Pro to a projector for a Powerpoint presentation. When I use a VGA cable, the color of the projected images are not good. When I use a USB cable, the projected image includes the presenter notes on my computer screen?
To move an iPhoto Library to a new machine:
Link the two Macs together: there are several ways to do this: Wireless Network,Firewire Target Disk Mode, Ethernet, or even just copy the Library to an external HD and then on to the new machine...
But however you do choose to link the two machines...
Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
Then hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
and select the Library that you moved. That's it.
This moves photos, events, albums, books, keywords, slideshows and everything else.
Your first option didn't work because you imported one Library to another. Every version and thumbnail is imported like a distinct photo, you lose all your Albums, Keywords etc., the link between Original and Previews is destroyed, the non-destructive editing feature is ruined and so on. In summary: it's mess.
Your second option didn't work because you simply referenced her library on the old machine.
Regards
TD
Maybe you are looking for
-
I updated to iTunes 11.4 when prompted. I can no longer connect to the Store. Tried all troubleshooting, checked Firewall, and my internet connection is fine. I re-downloaded iTunes and selected the "repair" radio button. Still has not resolved "
-
Is it possible not to update Product Stock Quantity upon ADD TO CART event?
Greetings, Is it possible that the Product Stock Quantity (In Stock) not to be updated on Add to Cart event or when the basket still exist? And the updates/decrease of quantity will only happen when the customer have successfully paid or checked out.
-
New to Express 9, can't hear any of the effects when selected only clean.
Just got Express 9 had Garage Band and it worked good. Have a good Interface. No matter what effect, plug-in or how I change the sound I only hear the same guitar sound that sounds like it has no effects just clean. Also, my Apple Loops work fine. Al
-
Best way to set up ten iPads for school classroom?
What is the best way to set up ten new iPads for my wife's classroom where they all have the same content and sync the same apps?
-
Little arrows by the side of music and playlists
Does anyone know how to remove those little arrows in iTunes 8? I could get rid of them in older versions but in the new version i can find that option. Does anyone know if its still available and how to do it? Thanks