Runtime problems after migrating from Flex3 to 4 in compatibility mode
Asked Answered
R

1

19

We are migrating our Flex-3.2 application to Flex 4.1, mainly to take advantage of the new text flow/engine features. In a first step we decided to go with compiling for MX-only and in Flex-3-compatibility mode.

Thanks to some helpful resources (

http://www.adobe.com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html

Any Flex 4 migration experience?

http://www.adobe.com/devnet/flex/articles/flex3and4_differences_02.html

) I am able to compile our application.

But I find myself surprised about the amount of runtime differences ranging from the problem that I cannot cast ResultEvent.currentTarget to HTTPService ( which apparently was introduced in 3.5 ) to many layout problems to differences in event dispatching ( e.g. one of our legacy components listens to the add event which it just doesn't seem to get anymore ).

It seems there is very little documentation on this. I'd like to find a list with detailed changes so that we don't have to rely on QA to stumble across hopefully all issues.

This documents lists some, but doesn't seem exhaustive. Does someone have a better list of documented changes?

Thanks Stefan

PS. List of concrete examples I have found so far:

1) In Flex 4 the add event is not fired:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" minWidth="955" minHeight="600">

    <fx:Script>
        <![CDATA[

            private function notFired():void
            {
                trace("ADDED");
            }

            private function fired():void
            {
                trace("COMPLETE");
            }
        ]]>
    </fx:Script>

    <mx:TextArea add="notFired();" creationComplete="fired();"/>

</mx:Application>

Now do the same in Flex 3 and you'll see both events fire.

Apparently, this is a bug. Might be possible to work around this but certainly decreases my level or trust substantially.

2) Dialogs/popups show all content mirrored.

A bug as well. Easy to work around, but how could something that obvious slip?

3) Problems with injected "Ôª" chars.

See post here.

Rosana answered 19/8, 2010 at 17:26 Comment(7)
You'll have better luck if you ask specific questions to address specific problems.Promotion
The question is: is there an all inclusive list of changes from SDK 3.2 to 4.1. Given the concrete problem that the add-event just doesn't fire as it used to and observing many differences when running my app in 3 compared to 4 (with compatibility ) I fear I otherwise have to run through all execution paths to find all potential problems which is quite a task.Rosana
@Rosana - that is after all the reason for unit testing :), I know it's not always easy or even possible with all the parts of Flash functionality and the fact that a lot of it is going to require visual inspection but this is a regular growing pain of switching versions, things are fixed and features are introduced and regression bugs pop-up occasionally. adobe.com/devnet/flex/articles/flex3and4_differences.html bugs.adobe.com/jira/secure/…Inadequate
Probably your best bet is using that Jira page to try and narrow down to issues that might affect you but really using something that is fresh out of the box and just hasn't undergone as much usage/fixing as the previous version is going to just naturally run into these issues, I understand your concern but as previously stated this is why it's good to create as many unit tests as possible.Inadequate
@Inadequate - thanks for your thoughts. I disagree though even though I am all for unit testing. The problems we encountered would not have been spotted by unit tests. IMHO providing tests for all UI interactions to spot 1) and 2) is a waste of time due to UIs being in flux. 3) is more like a Flash Builder issue. Nevertheless we continued as we wanted to use the new text layout features. Here we filed bugs with Adobe but responses have not been overly helpful either. But we have reached a state we are happy with and will sure continue with Flex 4. Yet I feel it was released too early.Rosana
@Rosana I agree this was probably released to early, I understand about the pitfalls of unit testing the front end but was speaking directly to this comment: "I fear I otherwise have to run through all execution paths to find all potential problems which is quite a task". Was just saying this is the reason to create unit tests, for whatever you can, so as to reduce the amount of execution paths you have to take manually in order to see it's a problem and unit tests are small and can be done in lulls of development, anyhow didn't mean anything negative by it.Inadequate
Hmmm - apparently even as owner I cannot just close this question. But I don't want to delete it either as some people marked it as favorite. How do people on Stackoverflow deal with this? A link to a complete list of Flex3 to 4 changes would not help me personally anymore but might be of help to others. Yet after 6 months I don't think this will ever be answered.Rosana
S
1

Let's see some of your doubts...

1) add never was a reliable event since flash player 9 release. It's a common bug. Try to create a movieclip out of displaylist and add a child in it that have the Event.ADDED listener. In some situations (don't know exactly what situation) it doesn't work (Adobe Fail). But, instead the "add" flex event, use the "added" or "addedToStage" once you want to detect if it's already in your applications display list.

2) Fail. Check the layout manager source-code of the framework.

3) I've never seen this. (Even in compatibility mode). Can you show an example? Did you check if the application encoding is the same you're using on your strings? Maybe the string table could be doing some confusion due to the characters encodings (or maybe your editor). Try other editors and verify the code file contents on a linux shell with SED. With a find and a sed you can fix it easily.

Salutatory answered 16/3, 2011 at 12:8 Comment(2)
Thanks for your input. 3) might have to do with copying code from other sources such as Komodo into Flex Builder, which then started causing problems in Flash Builder 4. As I opened this request for a full list of changes about 6 months and we eventually successfully moved our application to Flash Builder 4 I am closing it now.Rosana
You look up the correct ANCII character code and try entering it in the code by holding ALT key and typing the character number with number keys. For instance ALT + 0128 produces € sign.Campobello

© 2022 - 2024 — McMap. All rights reserved.