logo
  • Home
  • Acerca
  • Autores
  • Faq
  • Rede
  Twitter   Feed-me! RSS!
Jan 13

Depois de 6 anos de Flex, irei migrar para HTML5?

Escrito por riaPT em flash, html5, Javascript, Ria’s Geral @ 01 13th, 2012 | via http://riapt.org | Sem comentários
riaPT
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Regra geral não sou apologista de dispersar conteúdo, nem de fazer posts no riapt em Inglês. Neste caso em específico, visto tratar-se de um assunto que está na ordem do dia, vou abrir uma excepção e duplicar aqui um post que fiz no Google+. O endereço original é este:? https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs

After 6 years doing Flex, am I moving to HTML5?

Short answer: no. But I’m investing in HTML5.
(really) Long answer: see below.

After coming back from the Flex Summit, many people have contacted me asking what was going to happen with Flex and if I was going to “migrate” our projects (like http://airgile.com ) and services to HTML5. After plenty of exchanged emails and dozens of long talks, I decided to write down and share some notes of my first steps in the HTML5 world regarding the development of Enterprise RIAs (or not). These notes are not organized, they have typos, and, as I said above – they are only my first steps so more experienced people might (and will) prove me wrong in some topics.

Background

I founded Webfuel in 2004 and since then we’ve specialized in building long-term (> 6 months) enterprise-grade RIAs that had to scale well and be prepared for constantly changing requirements with a low cost in maintainability, while simultaneously providing a top-notch user experience. We’ve managed to offer our services comfortably with a very limited number resources and small development teams (3-5 persons per project), much thanks to the way we leveraged existing knowledge on Software Engineering and applied it to our platform of choice – Adobe Flex (now fortunately called Apache Flex).
Our decision was purely technical and we have never regret our choice, until it got badly affected by the bad PR around the Flash platform.

Worse PR ever in November 2011

The Flash platform was already in bad shape, much thanks to one year of chaotic PR and there were already some inconsistent signs from Adobe. While disappointed, I was not very surprised when all hell broke loose in November 2011 with Adobe destroying the very last credibility that Flash still had, directly affecting Flex, our businesses and careers. Long story short, Adobe wasn’t able to monetize the Flash Platform and the top managers who don’t really care or understand it’s power simply decided to put the money where their mouth was: HTML5. I happen to strongly agree with the move on investing in HTML5, but they could and should have done it without destroying (the perception of) Flash. Especially because in the meanwhile it had turned into the platform of choice for Enterprise Development.

In December ’11 Adobe has donated Flex to Apache. While this might end up in being the best thing that could happen to Flex, the initial reaction from the Enterprise was that Adobe was getting rid of Flex. Like someone said during the Flex Summit – “it seems to me that Adobe has built the best platform for enterprise-grade application by accident”. Adobe understands design; creativity; marketing; publishing; Adobe doesn’t seem to understand Enterprise. Example #1: Zero Support = the biggest complaint about Adobe I heard for years on the Enterprise. Example #2: the pricing of LCDS.

Did Adobe killed Flex? No! A technology doesn’t have an heart attack and drops dead on the floor. Flex is still alive and the reasons why we chose it are still perfectly valid. Flex didn’t got worse suddenly – it’s still the same robust platform for enterprise RIA development.
What Adobe destroyed was perception of the Flash Platform. And the perception is what matters on business. You can have the best product of the world, but if people believe it’s bad they won’t buy it (and they’ll even be happy on telling everyone how much your product – that they never used – sucks). But if they think it’s good – even if it actually sucks – they’ll probably buy it (and complain later). Perception. That’s what sells. Perception.

Will the perception around Apache Flex ( http://incubator.apache.org/flex/ ) improve? Most likely, yes. In 9 days, there were more than 1.4 thousand emails exchanged on the Flex Mailing List ( http://incubator.apache.org/flex/mailing-lists.html ) ! It’s pretty impressive the number of people that are now involved in pushing Flex forward and this number will most likely keep raising. But Apache Flex still relies (or, at least for now) on the Flash Platform and I’m not seeing the bad perception on the Flash Player changing in a near future. Of course there’s still AIR, but what concerns me are browser applications

We are desktop-developers-working-on-the-web

An important side note, is that I see Webfuel as a team of desktop developers working on the web. In another words, we use desktop development paradigms, best-practices and design patterns borrowed from the JAVA world and we’ve applied them to build applications that happen to run inside the browser. Our work consists normally in building at least two loosely coupled applications, connected by an RPC API: a client application (running inside the web-browser) and a server application that only exposes services and is not aware of the client application.
Most Flex developers out there think on themselves as web-developers, but in most cases the mindset of a Flex developer is closer to a desktop developer than to a web developer. IMHO, this is the most single-most-important reason on why we, Flex developers, dislike so much the “normal” web development approaches.
We work with “views”, web developers work with “documents”. We do old-school MVC, DI, loosely coupled approaches, dependency management, RPC, code coverage, continuous integration [...], and when we’re forced to do web-development these are the first concepts that we try to investigate and replicate… before we get frustrated and enter in “denial”.
To be good at typical web-development, we have to change our mindset.

Is “HTML5″ ready?

According to Twitter, online magazines, blogs, Apple, Microsoft and even Adobe, HTML5 is the silver-bullet for everything. In can be used to build websites, webapps, games, software, mobile applications, doing laundry and cooking. The focus is all on HTML5 right now. Is it the right moment to use it?

From the point of view of a web-developer – of course it is!!! For a typical web-developer, HTML5 means more tools, more power and much better cross-browser compatibility than what they had before. If you’re working on the web, HTML5 and the storm of JS frameworks is simply the best thing that has happened to the web since…. humm… Flash. :o ) Bottom line, HTML5 is for sure a giant step forward.

From the point of view of desktop-developer-working-on-the-web – hell no! WTF? We work on the enterprise and enterprise means stability. We can’t afford to have too many moving pieces all the time. We can’t afford to deal with un-structured languages. If you’ve used Flash or Flex for the last 5 years, you’ll feel that in HTML5 there’s nothing new or better than what you already have. Worse, you’ll feel that there still are hundreds of needed capabilities and tools missing. Exception to the rule, happens if you’re targeting the browser of Mobile devices, where HTML5 is king.
It’s quite understandable that a Flex developer feels frustrated. You feel you’re going backwards 4 or 5 years. It happens that, as Ted Patrick stated ( http://tedpatrick.com/2011/11/12/living-in-the-future/ ) , we were living in the future…

Ignore the shit storm. Ignore fanboys. Choose the right tools. Ask the right questions to the right developers

People like to take sides. If I like and use something, for sure it’s because it’s the best thing ever, and all the rest sucks or is dead. That’s how it works for most fanboys.
Newsflash: if 10.000 persons say that something sucks, it doesn’t really mean that it really sucks. It means that they believe it sucks. Like they believe in a religion. The irony is that developers should be pragmatic people, but we often see them becoming fanatic about their technology choices. “Infidel, infidel”, they yell with their pitchforks in the air when you say the name of a “competitor” technology. WTF?

For me, technologies are just tools. Obviously I would like to have as many good tools as possible so I can be able to choose the right one for each task. Be it Flex, HTML5, Javascript, Actionscript, JAVA, PHP, whatever.

Bottom line: ignore the shit storm and the bad PR. Ignore fanboys. Choose your tools based on logic. You wouldn’t choose a hammer to cut wood, would you?

Last year, when I started digging seriously into Javascript, I had many questions. I took for granted that someone who defends a technology with so much conviction, probably understands it pretty well. So I placed several questions to these guys expecting to learn new stuff and understand their best practices. It happens that I haven’t learnt shit. It was like if me and them were from different planets, speaking different languages. Even similar words have different meanings (their MVC is not our MVC. their dependency management is not our dependency management… etc).

I’ve sent a couple of emails to mailing lists of HTML5 and JS development asking people what they were using for MVC, IoC, Unit Testing, Code Coverage, Compiling, Continuous Integration, etc, etc. The answers were like “WTF dude, IoC? What are you talking about?”. I now know that I was doing the wrong questions, as you’ll see below.

Since I couldn’t get (or understand) answers from the gurus of the JS world, I started trying to find people who were doing both large-scale Actionscript and Javascript. They would understand me. :o ) It happens that there aren’t many and most of them were more or less at the same point I was. The best single advice I got was: “accept web dev for what it is and don’t try to change it. Don’t do RIAs. Do simple web development. Then improve.”. Good advice!.

Redefining our focus

As I said above, technology-wise, Flex is still perfectly valid. But it’s perception is at it’s lowest level and clients are quite confused and started asking us to use HTML5 to build the same type of solutions we were building with Flex.

So we had to rethink our business, and considering our desktop-developers-working-on-the-web mindset, we’ve decided to:

  1. return to our roots: desktop development. That’s what we’re good at and we can still keep using Flex to build AIR applications, either for the desktop or mobile. Since we can embed the AIR runtime, those applications will be future-proof to any other crazy-game-changing decisions made by Adobe.
  2. increasing our investment in developing (simple) HTML(5) webapps, while accepting the web for what it is: broken. In another words, we have to be humble about what we can provide on the web. It’s too hard and expensive to build the same type of applications we were building, so we’re starting with just simple webapps.

We won’t be accepting huge enterprise-grade projects if they’re meant to be built in HTML(5). This is actually the hardest problem to manage. There are expectations from clients. They’ve got used to our beautiful RIA applications, with almost no waiting times, with beautiful and pixel-perfect interactive user interfaces. And now they want the same, but in HTML5, because Flash is “dead” and HTML5 will also run on their Mobile devices (all of them), faster and without consuming battery. At least, it’s what they heard…. The solution for this problem is to say “No, we are not ready to develop it in HTML5″. We’ll be restricting us to simpler web-apps, until we feel that we (and the web) is ready.

First steps in JS and HTML5

During 2011, I’ve read A LOT? about JS frameworks, libraries, approaches, etc. Sometimes, after finishing reading something, it was already outdated and a better library was available.

My first impression was that most docs were “meh”: in most cases you have an excellent “Getting Started” guide, but as soon you start getting your hands dirty in more complicated scenarios, things start falling apart and you’ll see no or outdated advanced documentation.

Another trend that I hated in my readings was the lack of objectivity: instead of the typical docs saying “this framework does A,B,C,D” , I saw a lot of “THIS IS THA MOTHA-FUCKA FRAMEWORK THAT WILL SAVE UR LIFE!”, “MEGA-HYPA-SHIZZLA-FRAMEWORK”. Feels awkward.

I’ve also seen several frameworks being dropped in favor of others, which was actually what scared me the most. I felt insecure choosing the “right” libs and frameworks, so most choices I did at start were the safe ones, as you’ll see below.

Another irony was that most of the JS frameworks exist to overcome the limitations of the web development (normally, the crossbrowser issues). Coming from an environment where a framework tries to abstract application concepts, it felt weird to me to use frameworks to abstract technical limitations. Today, I’ve learnt to enjoy and welcome these frameworks. Accept them for what they are, because the technical limitations actually exist? and without those frameworks you’re screwed.

In October 2011, I decided to start a medium sized real-life HTML5 webapp with a partner company, so we could test the knowledge I gathered. (A medium-sized project in the point of view of a web-developer; as a desktop-developer I see it as simple stuff #notbeinghumble? ). I’ve allocated two developers to the project – being myself one of them. Below are the choices we did.

Knockout.js

Despite having read about Backbone, Spine and other complicated frameworks, I’ve decided to start small and simple with Knockout.JS . I just wanted simple data-binding to start with, so I could get some separation between the data model and the view. Later, when we were more experienced, I would re-evaluate the choice of the framework and choose between Backbone, Spine, or another.

My choice has proven to be worthy since Knockout is actually quite simple – but far more complicated and intrusive than the ultra-easy and powerful binding we’re used to in Flex.

The documentation of Knockout is quite good, with plenty of tutorials available. On Google you won’t find as many resources on Knockout as you would like, but fortunately the website covers most of the important topics. The mailing list is pretty good, despite not being as active as the MLs I’m used to in the Flex world with dozens or hundreds of experts. Anyway, in the Knockout ML, there are always one or two persons kind enough to point you on the right direction, which is great.

jQuery

I had already a good impression on jQuery, but even still it turned up to be even better than what I expected. jQuery not only hides a lot of the crossbrowser issues – not all -, but also boosts up a lot your productivity with dozens of shortcut functions to most of the stuff people normally need to do on the web. Use it (can you live without it?).

SaaS

Managing CSS can easily turn into a pain especially if you need to do many changes to an existing stylesheet with hundreds of CSS declarations. When Googling for best practices, I met SaaS. SaaS is actually pretty simple: it let’s you define CSS stylesheets with declaration hierarchy, variables and mathematic expressions, saving them on a scss file. Then you start a command line task that listens to changes to your scss file and converts it to a CSS file on the fly.

I haven’t looked at Less, so I don’t really know which one is better.

Lab.JS

I also discovered (in the hard way) the pain that it can be to manage dependencies in Javascript. I was used to having all class definitions packaged for me in a single SWF and the Flash VM would take care of embedding and managing dependencies for me (pretty most like all bytecode VMs do). In the Javascript world, there’s nothing taking care of this for you. You start by setting in the HTML file the location of the scripts needed, but then you cannot control the order they are loaded and run. So you can be calling a function myFunction() in fileB.js that was defined in fileA.js that was not loaded yet – resulting in errors.

I’ve chosen Lab.JS to solve the issue of loading dependencies on the right order. I’m also making sure that any initialization code only runs AFTER all the needed files are loaded.

I’ve found a problem with Lab.JS: if your code throws exceptions, they will be swallowed by the library and nothing happens. My workaround (read: ugly hack) was to do a ” setTimeout(initialize, 1); ” after the scripts are loaded. This way exceptions are now caught by the browser, as you would expect.

IDEs

This was one of the biggest disappointments at the beginning. The biggest problem of JS is that due to it’s dynamic nature it’s hard to be tooled around. For building large scale complex systems, especially in a team environment, I needed good refactoring capabilities. It happens that refactoring doesn’t exist in the IDEs I tried.
Ok, there is something called “rename” in WebStorm but it works for very simple cases and I’ve seen it resulting in unexpected results (so I always use the “preview”).

Flash Builder is a complete beast (in a good sense). I’ve seen many people ranting on Flash Builder and even I had some disappointments a couple of years ago. But after FB 4 it just got awesome, with it’s serious refactoring capabilities, find usages, metadata completion, autocomplete, inline docs, content assist, etc. Most of the best tricks from the JAVA world are available on FB. If you expect to find those in JS editors, I have bad news for you.

I’ve started with Aptana. It’s free. It’s based on Eclipse, so I felt at home at least with the shortcuts and the structure of the IDE, but with a black editor (wtf? is this the “fashion-color” for supa-dupa-web-developers?). Anyway, after two months I got tired of it. I couldn’t do refactoring. I couldn’t jump properly to a function definition with CTRL+click (and this was REALLY annoying). It didn’t have decent auto-complete. I’ve tried making the debugging work but it only worked properly 15% of the time.

Then I’ve decided to give PHPStorm a try – which is the same as WebStorm, but also supports PHP. At first, I was scared: I couldn’t find half of the stuff I needed. After one day, I was pretty comfortable with it and now I feel it’s actually pretty well built. Ok, it’s NOT Eclipse, but even still it’s quite powerful. What those guys did was to implement really well? the things you use most while developing and packaged all of them in a clean and objective interface. Kudos to JetBrains ( http://www.jetbrains.com/ )!
In PHPStorm, refactoring “sorta” works in simple scenarios. If you complicate too much (like when you try to mimic packaging for your objects), it won’t work. Click and jump to a function definition works. Debugging… works!! Autocomplete works a lot better than I expected. Actually, it works quite well. The catch: comparing to Aptana, it’s not free.
Coming from Flash Builder, will you be happy with PHPStorm? No. But currently it seems to me that it is probably the best IDE for Web development.

Debugging

I feel ashamed to say that I couldn’t debug properly during the first two to three weeks. Every tool I tried didn’t work as expected. It happens I was using the wrong tools, browsers and approaches.
I ended up using the debugging capabilities of both Firebug (in Firefox!) and PHPStorm. Firebug is also pretty helpful to inspect the DOM of the document, something you’ll be doing every 5 minutes. Both Firebug and PHPStorm allow you to place a breakpoint in JS code and then run your code step by step, as expected. PHPStorm looks more comfortable to me, also because it’s where I’m writing my code.
Bottom line: If your debugging is not working, don’t blame JS: you’re simply using the wrong tools.

Javascript

This was probably my biggest pain point. I’ll start with the conclusions: accept Javascript for what it is and don’t try to mimic your common OOP techniques and classes. There.are.no.real.classes.in.javascript.
Of course, you can try? to mimic them – I’ve read half of a book teaching how to do that. But I’ve come to the conclusion that the complexity that you’re adding to get you closer to your comfort zone ends up not being comfortable at all…
You have objects in Javascript. Some might argue that they’re not “real objects”, but wtf, they are what they are and bitching around all the time won’t turn them into real objects. They are objects. Its the definition of “real” that is subjective :o )

The problems with JS:

  • Silent errors. They happen. Get ready for them.
  • Hard coupling everywhere. It’s pretty hard to do loosely coupled architectures. It’s quite easy to end up with a web of dependencies between different objects. I’ve read there are techniques to avoid hard-coupling, but I haven’t had time to dig up more, so this might be my fault.
  • Uglyness. I’m used to a HUGE-ULTRA-CLEAN separation between classes, libraries, modules, components and applications. In the webdev world, get ready to see PHP spitting HTML with JS that spits more HTML… Or function a() that creates another function in object b, that knows about object c and changes how c behaves. Things like that. In many known js libraries.
  • It’s not built for team work. At Webfuel we normally don’t need to talk much with each other about development. Half a dozen guys can be working together for half a year on the same project, commiting code every 5 minutes to the same SVN, without breaking the code of others. This was quite easy to achieve much thanks to the structured nature of Actionscript, on top of some very simple practices borrowed from the JAVA world. Enter Javascript and you’ll see your code breaking the code of someone else. While developing JS in a team, it’s normal that developers need to talk a lot about what each one is doing, warning the other to be careful about X or Y, or asking the other “where did you put the code for…”. Actionscript makes teamwork a joy almost since moment zero – there’s no rocket science for a healthy teamwork environment. In Javascript, the trick is to put people working in very different unrelated parts of the projects and use techniques to encapsulate their code – I have yet to learn them, but I will soon. I’ve asked some JS developers about this but the ones I know are all lone-wolves so they didn’t understand what I was talking about (apart from the reaction “SVN?? WTF?? Use GIT!”.. hum… that wasn’t my question…)
  • Unpredictable. In AS3, the “this” refers to the instance where the method is defined. In JS, “this” can mean pretty much anything (remember AS2?). This was one of my biggest pain-points at first. Another problem is guessing by looking at the code the properties and functions of an Object. You can’t. A function in an object can be defined pretty most anywhere. It’s up to you (and your team; and your partners; and your library-providers) to make sure that you keep your house clean with everything organized in the right place.
  • Code practices. These are completely different from everything you know. I taught everyone here at Webfuel to not be afraid of writing many lines of code. I want them to write self-explanatory code, like if they were writing English. Enter Javascript. And cry. By some weird reason, people like to write as much code as possible in a single line, making it not only very hard to read, but also very hard to maintain. I’ve got used to seeing the #(‘huge’).line(of: code, that: function() looks() ).like(‘a’).train(); . And this practice is everywhere, pretty most all examples, libraries and worse: in books! One of the books I read had one line that took me around 5 minutes to understand! The fun part is that I had the book with me in San Francisco on the Flex Summit and I showed that line of code to several people just to scare the shit out of them. It worked!

Bottom line: if you’re a OOP purist, with many years of experience on software engineering on Flex and/or JAVA, you’re going to be scared. The mindset is different. The problems are different. The solutions are different. Even the slang is different. The good part: no compiling times. Which is actually a very good part…

There’s so many people betting in JS, shouldn’t it be good?

This is actually the question that confuses me the most. I simply don’t have an answer… Some people seem to be able to pretty much do anything they need. But at the same time the language certainly has it’s fundamental problems that can scare the shit out of you if you’re doing a one-year-project.
One thing is for sure: it’s being pushed forward and you can’t deny that.

CoffeeScript

I haven’t tried yet CoffeeScript. After reading a bit about CoffeeScript, I’ve learnt that you still need to be comfortable with Javascript to use CoffeeScript properly. And that’s what I’m doing. On the next project I might give CS (or other language that cross-compiles) a try.

Layouting and the DOM

This was actually my biggest disappointment. Flex (>4) is amazingly simple and powerful on what it comes to pixel perfect skinning and layouting. You have pretty most no constraints in Flex in what it comes to layouting, giving you imense freedom in creating perfeccionist user-experiences. You don’t think “how am I going to implement this?” because there’s not much to know with Spark skinning: it’s really powerful and simple.
The HTML world is different. You have to be aware of the constraints before creating the design and setting the user experience. I wasn’t aware of these constraints so we had to change the designs of the product we’re building a couple of times on the middle of the project to turn them into something possible/easier to achieve in HTML. I really hate constraints that end up affecting the user experience.

You have also to be prepared to accept small (and big) cross-browser rendering differences. They will happen. A lot. But that’s another topic…

Optimizations/Preloading content

Coming from the Flash world I was used to have to build one single application (the SWF) that has all (static) assets embedded. This results in pretty small files (yes, a SWF is smaller than it’s HTML+JS+CSS+Assets equivalent, even after minimization and gzip, and etc), only one request to the server (which results in a very low load on the server), and the assumption that all the content you need is available at runtime since moment 0. If you want to achieve a similar result in JS, you have to do it by hand – there’s nothing taking care of that for you. You have to join and minify Javascript and CSS files and resort to image sprites to reduce the number of requests to the server and the user perceived speed.

An image sprite is simply one PNG file with all the images and icons you use in your webapp. Then you simply apply that image as the background image of your UI component, using CSS to set a translation so it shows the icon/image you need. It’s quite simple, but make sure you load this image before your content appears on screen. The same applies to other content, in case you don’t want the user to see “glitches” on the layout while things load.

During loading I am hiding most divs (display: none) in the DOM, showing a preloader and after all content is ready (JS files through Lab.JS, Image Sprite, etc), I’m using jQuery to show stuff. It’s quite simple, actually, but of course, Flex did take care of all that for you… BTW, I saw this today, but I haven’t tried it yet: https://github.com/thinkpixellab/PxLoader

I’ve started today looking for a Javascript minifier. I need something that can automatically watch a folder with several JS files and merge them in a single minified file. If possible, assigning a revision number to the generated file. I haven’t yet found anything, but I’ll update this post if I have positive results.

HTML(5), JS and Mobile

If you think you’re going to build something in HTML(5)+JS that will work seamlessly and without problems in desktop AND mobile browsers, think again. Document based websites usually work without problems on both types of environments. But if you’re doing a more or less advanced user experience that relies in some CSS and JS magic, then be prepared to be disappointed when you open your content in your Mobile device. Not that the mobile browsers are bad – they’re actually pretty good. The problem is that the Mobile experience needs to be thought from the start – people will be using their huge clumsy fingers to interact, the screen will be smaller and the hardware resources are more limited. So at the end, you have to implement at least two different user experiences and switch between them according to the device capabilities using Media Queries. I haven’t yet tried Media Queries, so there’s not much I can say about this. I just mentioned this topic because I’ve seen several people migrating their Flash applications to HTML expecting them to work right away on iOS – without thinking that it’s probably cheaper to keep the Flash version on the desktop and building a dedicated version for iOS.

UI Components

DateChooser, NumericStepper, TextInput, DropDownList, RadioButton, Panels, Accordions, HGroup, Charts, Lists with Renderers, DataGrid, etc, etc, etc, almost all types of components you can imagine are available in Flex. And they are extendable and completely skinnable. You have great control in your hands. In the HTML world, either you go with the limited browser components – that are not extendable and are hard to skin but they integrate with the browser and the device -, or you have to choose a component library like jQuery UI, ExtJS or zkoss, among other – that are more or less powerful, but don’t integrate with the browser or device.

After exploring dozens of options, all of them with their cons and cons, I felt unsecure on choosing one option, spending time and money learning it and teaching it to my team, to later conclude that I might have chosen the wrong one. So I’ve decided NOT? to try any component library – apart from the limited jQuery UI -, simply because there are too many things changing right now and it’s very hard to predict which libraries will succeed and which ones will not. I’m going to be lazy (also because I can’t study thousands of stuff at the same time) and wait to see what other Flex developers will choose. In the meanwhile, as I said above I won’t be using HTML(5) to build RIAs, but only simple webapps. And for that, jQuery UI is up to the task (with some quirks here and there).

Crossbrowser issues

Heck, this is my biggest nightmare. I tremble everytime someone says the world “web browser”. Ok, I’m exagerating a bit. Crossbrowser issues exist, they are a PITA and they will consume at least? 30% of your time in a project. But to be honest, at first I was expecting it would be a lot worse. Don’t take me wrong here, crossbrowser issues are? a nightmare. Simply, they’re not as scary as I thought. If you follow me on twitter ( https://twitter.com/#!/joaosaleiro ) you’ve probably seen me cursing some web-browsers (hint: has two letters, starts with an I, ends with an E). Get ready to having to test something in several browsers and to change plans in the middle of the project because your approach doesn’t work as expected in one or two major browsers – especially if you’re building edge-cases and using HTML5 stuff.

You can’t miss this article: http://www.joelonsoftware.com/items/2008/03/17.html

We had one crossbrowser issue this week that almost killed our current project. We needed to override the browser URL while the user was navigating the application and we couldn’t rely in simple URL hashes. We were hoping that history.pushState was up the task, but it happens that it is not. Erratic behavior in Safari, doesn’t work in IE, worked in Android until 2.3.3 and stopped working in 3.0 and 4.0 (WTF?)… Fortunately, I’ve found History.js which was built exactly to fix our problem and reduce (not fix) the cross-browser issues. See, the good thing is that crossbrowser issues happen to everyone, so you’ll likely find a workaround on the web.

If you’re doing HTML5 you probably know about http://caniuse.com/ . If you don’t, go there.

Productivity

Our productivity is pretty bad right now – but we are getting better! We’ve spent 11 weeks of two resources to build something in HTML(5)+JS that we would have built in 3 weeks with the same resources in Flex, without any stress at all. Of course, I take a big part of the guilt here: we’re still learning and during the first weeks there were a lot of readings, plan changes, tests and bumps on the road.
The real issue is how tight the relation between productivity and your experience with the tech is: the bumps on the road are there, they happen to everyone and you won’t be able to predict them, so the only solution is be experienced and be aware of those issues. They will simply happen, you’ll curse them, search the internet for hours, fix/hack them and the next time you’ll meet them, THEN, you’ll be ready and productive.
You’ll end up implementing workarounds and hacks (on top of other hacks) constantly. Coming from the Flex world, you’ll feel ashamed of your hack – don’t be. It’s normal. Most of the times, you won’t have another choice but to accept the hack and move on.
Coming from a rapid development environment as Flex, productivity in JS and HTML can be quite frustrating until you get used to the bumps on the road. After you’re experienced, it will get better, but I don’t expect it to come any close to Flex development in a near future.

Conclusions

The first conclusion is that we’ll keep using Flex in long-term enterprise RIAs projects. Neither the open-standards nor we are ready to build the same type of experiences that our clients expect us to do.

At the same time, we’ll be accepting smaller webapps. At this point, after three months, we’re already pretty comfortable building web experiences, so it’s a matter of raising the bar slowly, webapp after webapp. But I don’t think we’ll be able to do the same type of RIAs we were doing with Flex at least in the next two years. Also, maintainability and it’s cost scares the shit out of me. And all the moving parts of HTML5 – new libraries appearing, others disappearing, browsers dropping support of features, etc. There are lots of “ands”.

I know I’ve missed a half a dozen topics above and I know I’ll have dozens of other topics to write about in a couple of months. Actually, there are no real conclusions here – only open subjects. There’s much to be investigated and learnt. I’m sure I’m not completely right in some of the above topics and I would love to get your feedback, pointing me on the right directions where I got it wrong. I can only hope that most of the stuff I pointed above won’t look as bad in a couple of months as it looks now. Or that browser vendors shake hands and decide to stop fragmenting the web. Maybe they could all be friends and adopt the same rendering engine and VM (_giggles_). For example, Google Dart. (_yeah, right_…)

Original post:? https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs? (please try to keep comments on the original post, of possible)

Jan 12

The future of the Flex framework

Escrito por Fabio da Silva em .NET, 1, 2.0, 4, 6, Adobe, app, AR, BI, blog, Blogs, C#, camp, Flex, for, framework, futuro, Google, int, mg, O, on, Ria’s Geral, S+S, web @ 01 12th, 2012 | via http://fabiophx.blogspot.com | Sem comentários
Fabio da Silva
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Mihai Corlan postou informações interessantes sobre o futuro próximo do Flex.

Veja mais neste post.

Ele mostra ainda em outro post que o Tour de Flex agora está disponível para iPad.

Jan 9

Gravação da minha palestra na Android Conference 2011 – Gerenciamento de memória

Escrito por Stefan Horochovec em 1, 2.0, Android, AR, C#, Desenvolvedor, Gravação, O, on, Palestra, Pessoal, RIA, Ria’s Geral, S+S, UI, Ved @ 01 9th, 2012 | via http://www.horochovec.com.br/blog | Sem comentários
Stefan Horochovec
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Olá pessoal! Primeiramente quero desejar a todos um Feliz 2012! Espero que esse ano seja de muito sucesso para você desenvolvedor! O primeiro post de 2012 é sobre algo de 2011 (ironia do destino ). Foi publicado no Youtube a gravação da minha palestra na Android Conference 2011 sobre Gerenciamento de Memória em dispositivos Android. [...]

Jan 6

Veja o suporte dos browsers às novidades de html5, css3 e javascript

Escrito por Kelps Sousa em .NET, 1, 2.0, 4, 6, Android, AR, BI, blog, browser, C#, comparação, css, css3, Desktop, Dicas, engine, filtra, for, Google, html, html5, ide, IE, if, image, Java, Javascript, Links, lista, map, mg, mobile, News, novidade, Novidades, O, on, Outros, problema, procura, pt, Ria’s Geral, S+S, site, SmartPhone, UI, window, windows, XP @ 01 6th, 2012 | via http://kelps-sousa.blogspot.com/ | Sem comentários
Kelps Sousa
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Hoje eu reencontrei um site muito útil que eu já havia visto algum tempo atrás mas havia perdido o link. O site se chama “When can I use…” e contém diversas tabelas comparativas mostrando o suporte dos principais browsers ? s novidades de CSS, HTML5, SVG, Javascript e outros.

When can I use rodando no IE9

Clicando nos links das funcionalidades é possível ver as tabelas comparativas de suporte dos browsers e também é possível mudar os filtros para exibir outras funcionalidades.

As tabelas de comparação contam também com alguns browsers de smartphone, mas o Windows Phone não consta na lista (tem apenas iOS, Android, Opera Mini e Opera Mobile). Mas isso não é um problema pois o IE do Windows Phone usa a mesma engine de renderização do desktop, com a única diferença de que não suporta plug-ins, então basta olhar a versão do IE normal na lista para ver se suporta a funcionalidade desejada. O IE do Windows Phone 7.0 (versão lançada na Europa e EUA em 2010) usa a engine do IE 7 e o Windows Phone 7.1 (Mango, lançado em 2011, inclusive no Brasil) usa a engine do IE 9.

tabelas de compara??o com filtros expandidos, permitindo filtras as funcionalidades e browsers procurados

Se você estiver trabalhando em um projeto usando HTML5, este site com certeza será muito útil para ajudar a identificar os pontos críticos do projeto do ponto de vista de suporte e portabilidade entre plataformas.



Jan 6

Olá, mundo!

Escrito por Ved em AR, C#, O, Ria’s Geral, S+S, Sem categoria, Wordpress @ 01 6th, 2012 | via http://www.vedovelli.com.br | Sem comentários
Ved
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Bem-vindo ao WordPress. Esse é o seu primeiro post. Edite-o ou exclua-o, e comece a publicar!

Jan 6

Livro Adobe Air em Ação a caminho

Escrito por Daniel Schmitz em 1, 2.0, 4, 6, Adobe, Adobe Air, Air, app, AR, Banco de Dados, busca, C#, class, control, CRUD, dados, Flex, for, game, Google, Gráfico, if, lite, Livro, mg, MXML, NaN, O, on, Outros, pagamento, RIA, Ria’s Geral, S+S, SQLite, Tema, UI, XML @ 01 6th, 2012 | via http://flex.etc.br | Sem comentários
Daniel Schmitz
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Para quem acha que o Flex simplesmente morreu pode estar dando um tiro no pé. Está na hora de abrir a mente e continuar a estudar. 2012 já começou e estamos a todo vapor criando o livro Adobe Air em Ação.

Este livro será um pouco diferente dos outros, pois contará com prática, que é o que precisamos para aprender algo. Nada se aprende apenas na teoria, e hoje em dia a teoria está no ? google, a um click de uma boa busca.

Estamos criando um pequeno sistema financeiro, que terá Swiz, SQLite e gráficos, e iremos mostrar passo a passo toda a sua construção. Para matar um pouco da curiosidade, algumas telas a seguir do nosso “sisteminha”. Veja algumas telas a seguir:

Tela de estabelecimentos
Os arquivos até agora no projeto Adobe Air
Aplicação mxml principal, com o Swiz configurado
Tela para controlar o CRUD de estabelecimentos
AppManager controla o banco de dados, incluindo a sua criação
Tela de lançamentos
Tela de Centros de Custo
Tela de formas de pagamento

Jan 5

Adobe doa o Flex SDK à Apache Foundation – ponto de situação

Escrito por riaPT em Flex, Ria’s Geral, Ria's Geral @ 01 5th, 2012 | via http://riapt.org | Sem comentários
riaPT
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Para os mais desatentos, a Adobe anunciou a doação do Flex SDK ? Apache Foundation? em Novembro de 2011. Em Dezembro, a Adobe promoveu um evento em São Francisco – Flex Summit – com o objectivo de elucidar a comunidade e obter feedback em relação ? doação. Os vídeos do evento estão disponíveis na AdobeTV? e estão repletos de informação útil (e se olharem com atenção podem encontrar-me a mim e ao João Fernandes sentados na assistência ou a dizer parvoíces :) ).

No dia 31 de Dezembro, o Flex foi finalmente aceite pela Apache Foundation e está agora em processo de incubação (um género de “processo de passagem da Adobe para o Apache”).

As Mailing Lists oficiais do Apache Flex foram criadas no dia 3 de Janeiro e entretanto já foram trocados 349 emails (em 2 ou 3 dias!) – o que demonstra o elevado interesse da comunidade, com um nível de participação muito acima do esperado.? Os arquivos da mailing list estão disponíveis aqui:? http://mail-archives.apache.org/mod_mbox/incubator-flex-dev/

Para se inscreverem na mailing list do Apache Flex podem fazê-lo com as instruções disponíveis em? http://incubator.apache.org/flex/mailing-lists.html

As discussões ? têm sido extremamente interessantes, mas quem não tiver paciência para ler os 349 emails pode sempre visitar este URL para ver um resumo dos tópicos discutidos: http://blog.teotigraphix.com/2012/01/05/apache-flex-flex-dev-summaries/ .

Uma página temporária para o Apache Flex foi criada aqui: http://incubator.apache.org/flex/? . Ainda não tem muita informação, mas? irá evoluir ao longo do tempo.

O SVN do Flex SDK está a ser migrado da Adobe para a Apache, tal como o JIRA. Este é um processo que deverá demorar entre uma a duas semanas (digo/espero eu).

Continua em aberto a minha sugestão de se realizar um evento de Q&A para vos elucidar (ou ? s vossas empresas/”chefes”) em quaisquer questões que tenham, mas como há a possibilidade da (antiga) Flex Team vir a Portugal, esta sugestão fica on hold durante mais alguns dias.

Entretanto podem enviar questões que tenham relativas ao processo de transição e ao futuro do Flex para a Mailing List do riapt

Jan 5

Novo sistema de Suporte

Escrito por Daniel Schmitz em 1, 2.0, 6, AR, C#, class, email, Flex, IE, image, lista, Livro, mg, O, on, RIA, Ria’s Geral, S+S, Sem categoria, Tema, UI @ 01 5th, 2012 | via http://flex.etc.br | Sem comentários
Daniel Schmitz
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

A partir de hoje estaremos implementando um novo sistema de suporte, para agilizar o nosso atendimento. Os suportes por email serão desativados gradativamente.

Para participar, basta acessar o endereço a seguir, criar uma conta, e enviar a dúvida de acordo com o livro listado na página principal.

O endereço para o suporte é:

http://www.danielschmitz.com.br/suporte/

Jan 4

Mac OS X do Snow para o Lion… lentidão

Escrito por Erko Bridee em .NET, 1, 2.0, 4, 6, action, Adobe, Adobe Flex, Air, api, aplicacao, Aplicativos, app, apple, AR, back, blog, Blogs, C#, cache, chrome, class, Desenvolvimento, Dica, Dicas, Eclipse, err, exemplo, firefox, Flex, for, git, Google, Hibernate, html, ide, IE, if, image, JPA, library, Mac, menu, mg, O, on, Oracle, Outros, padrão, Partilha, problema, RIA, Ria’s Geral, S+S, servidor, Software, Tech, UI, web @ 01 4th, 2012 | via http://blog.erkobridee.com | Sem comentários
Erko Bridee
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

Um post r?pido para compartilhar algo que pode ser ?til a mais algu?m…

Recentemente fiz o upgrade do meu Macbook Pro do Mac OS X Snow Leopard para o Lion, depois de todas as atualiza??es de software, no uso do dia a dia notei que o Lion estava absurdamente lento, Google Chrome, Mozilla Firefox, o Eclipse (esse estava de chorar e desanimador de t?o lento que estava)

Lendo os blogs, achei 2 dicas que resolveram o problema:

1 – Verificar e reparar as permiss?es de acesso ao HD

Caminho: Finder > Applications > Utilities > Disk Utility

Selecionar o drive que representa o Mac, depois clicar no bot?o: Verify Disk Permissions, esperar finalizar e depois no bot?o: Repair DIsk Permissions

Link do post com as dicas: Speed up Mac OS X Lion

Desde post tamb?m revisei as configura??es do Spotlight.

2 – Limpar os caches

Abrir o Finder > Menu: Go > Go Folder | ou executar o atalho: Shift + Command + G

Digite: ~/Library/Caches

Apague o conte?do deste diret?rio

Caso n?o tenha total seguran?a se deve apagar todos os arquivos e diret?rios, fa?a um backup, copiando o conte?do da pasta para outro diret?rio. Obs.: esse passo n?o ? necess?rio, mas caso queria alguma garantia de o que fazer se algo der errado ter? as c?pias.

Aten??o: alguns diret?rios e arquivos n?o ser?o exclu?dos pois est?o em execu??o, por exemplo, cache referente ao Finder e a alguns outros aplicativos do Mac OS X.

Reinicie seu Mac.

Link do post com a dica: OSX Lion – Clear your caches!

Feito estes procedimentos, os aplicativos e o Mac OS X Lion passou a ter uma performance e resposta aceit?vel, assim como tinha no Mac OS X Snow Leopard.


Veja também:

  • Oracle XE : Mudando a porta padrão HTTP
  • Como jogar Call Of Dudy 4 MW em servidores do Brasil?
  • WebLogic 10.x + Hibernate 3 (JPA) e base Oracle 9+
  • [Adobe Flex] Definindo o foco na aplicação
  • [Adobe Flex] comparando datas de maneira rápida e fácil
Jan 3

SharedObject com Flash Media Server

Escrito por Leonardo França em .NET, 1, 2.0, 4, 6, action, Actionscript, ActionScript 3, Actionscript 3.0, Actionscript3, Adobe, Air, Aplicativos, app, AR, BI, botão, browser, C#, class, cliente, código, Cookie, Curso, dados, demo, Download, err, event, EventListener, events, exemplo, Ferramenta, filter, flash, flash media, Flash Media Server, Flash Player, Flex, FMS, function, Geral, git, Google, handle, html, ide, IE, if, image, instalação, int, live, mg, O, on, Outros, Partilha, player, pt, referencia, RIA, Ria’s Geral, RTM, RTMP, S+S, server, servidor, swf, TAT, UI, uint, update, Ved, web, window @ 01 3rd, 2012 | via http://www.leonardofranca.com.br | Sem comentários
Leonardo França
? X
  • Bookmarks

Blinkbits BlinkLists BlogLines Blogmarks Buddymarks CiteULike Co.mments Del.icio.us Digg Diigo

Fark Feed Me Links Furl Google Linkagogo ma.gnolia Mister Wong Newsvine Propeller Rawsugar

Reddit Rojo Simpy Sphinn Spurl Squidoo StumbleUpon Tailrank Technorati Yahoo

More »

SharedObject é um recurso que dar ao Flash Player a capacidade de salvar dados localmente para poder ser usado posteriormente em sua aplicação, a grosso modo é como um cookie. Com o Flash Media Server, foi introduzido a possibilidade de usar o SharedObject Remote, no qual os dados são salvos no servidor Flash Media Server e compartilhados para todas as instâncias de uma conexão entre o Flash Player e o Flash Media Server. Isso possibilita a criação de aplicativos em real time como Dashboards, chats e o que mais a imaginação permitir.

O uso do SharedObject Remote pode ser usado de duas maneiras em conjunto com o Adobe Flash Media Server.

  • Somente pelo lado cliente, através do Flash Player/AIR
  • Em conjunto com ActionScript Communication, linguagem de servidor do Flash Media Server

Vejamos o primeiro caso:

Através do lado cliente, através do Flash Player/AIR

Caso você não tenha conhecimento para usar a linguagem Server-side do Flash Media Server, é possível utilizar o SharedObject Remote somente pelo ActionScript 3.0. Vamos a um exemplo clássico sharedBall, onde o objetivo é compartilhar as posições da bolinha a atualizar nos outros clientes conectados a mesma instância.

  • Vá até o diretório de instalação do Flash Media Server e procure pela pasta “applications”, lá crie um diretório chamado “sharedBall”, dentro dele um arquivo chamado “main.asc”
  • Abra o main.asc no seu editor de textos de preferencia ou pelo próprio Flash e digite: trace(“sharedBall…”);
  • Vamos testar esse arquivo, abra o console do Flash Media Server, geralmente fica localizado no diretorio de instalação/webrrot/swfs. Você pode abrir pelo browser ou o swf diretamente.
  • Clique no botão “View Applications” e em seguida procure o nome “sharedBall” no combobox logo no canto inferior esquerdo onde está escrito “New Instance…”
  • Selecione “sharedBall” e deveremos ter na aba Live Log algo como na imagem abaixo:

  • No Flash, criei uma bola com as ferramentas de desenho e converti para MovieClip dando o nome de “mc_ball”.
  • Estamos prontos para começar a integração entre o Flash e o Flash Media Server. Crie um layer para o ActionScript e abra o editor apertando F9 ou “Window->Actions”
  • Nosso código começa com a conexão com o servidor Flash Media Server
PLAIN TEXT
ACTIONSCRIPT3:

  1. import flash.net.NetConnection;
  2. import flash.events.NetStatusEvent;
  3. var nc:NetConnection;
  4. function init():void
  5. nc = new NetConnection();
  6. nc.addEventListener(NetStatusEvent.NET_STATUS, handlerNetStatus);
  7. nc.connect(“rtmp://localhost/sharedBall”);
  8. function handlerNetStatus(evt:NetStatusEvent):void
  9. trace(evt.info.code);
  10. init();

Feito isso, podemos testar o swf apertando Ctrl+Enter, se tudo correr bem, deveremos ter a seguinte mensagem no output do Flash:

NetConnection.Connect.Success

Com a conexão feita, podemos instanciar o nosso SharedObject Remote para compartilhar as posições de x e y da bolinha.

PLAIN TEXT
ACTIONSCRIPT3:

  1. if(evt.info.code == “NetConnection.Connect.Success”)
  2. so = SharedObject.getRemote(“so”,nc.uri,false);
  3. so.addEventListener(NetStatusEvent.NET_STATUS, handlerNetStatus);
  4. so.addEventListener(SyncEvent.SYNC, handlerSync);
  5. so.connect(nc);

O handlerSync é responsável por atualizar os dados de x e y pegaremos do SharedObject Remote:

PLAIN TEXT
ACTIONSCRIPT3:

  1. function handlerSync(evt:SyncEvent):void
  2. mc_ball.x = so.data.x;
  3. mc_ball.y = so.data.y;

Daremos a opção de ao clicar na bolinha, que ela possa ser arrastável, em seguida atualizaremos as posições de x e y no SharedObject Remote:

PLAIN TEXT
ACTIONSCRIPT3:

  1. mc_ball.addEventListener(MouseEvent.MOUSE_DOWN, handlerSharedBall);
  2. mc_ball.addEventListener(MouseEvent.MOUSE_UP, handlerSharedBallOut);
  3. function handlerSharedBall(evt:MouseEvent):void
  4. this.addEventListener(Event.ENTER_FRAME, update);
  5. mc_ball.startDrag();
  6. function handlerSharedBallOut(evt:MouseEvent):void
  7. mc_ball.stopDrag();
  8. function update(evt:Event=null):void
  9. so.setProperty(“x”,mc_ball.x);
  10. so.setProperty(“y”,mc_ball.y);

Segue o código completo:

PLAIN TEXT
ACTIONSCRIPT3:

  1. import flash.net.NetConnection;
  2. import flash.events.NetStatusEvent;
  3. import flash.net.SharedObject;
  4. import flash.events.SyncEvent;
  5. import flash.events.MouseEvent;
  6. import flash.events.Event;
  7. var nc:NetConnection;
  8. var so:SharedObject;
  9. function init():void
  10. nc = new NetConnection();
  11. nc.addEventListener(NetStatusEvent.NET_STATUS, handlerNetStatus);
  12. nc.connect(“rtmp://localhost/sharedBall”);
  13. function handlerNetStatus(evt:NetStatusEvent):void
  14. {
  15. trace(evt.info.code);
  16. if(evt.info.code == “NetConnection.Connect.Success”)
  17. so = SharedObject.getRemote(“so”,nc.uri,false);
  18. so.addEventListener(NetStatusEvent.NET_STATUS, handlerNetStatus);
  19. so.addEventListener(SyncEvent.SYNC, handlerSync);
  20. so.connect(nc);
  21. }
  22. function handlerSync(evt:SyncEvent):void
  23. mc_ball.x = so.data.x;
  24. mc_ball.y = so.data.y;
  25. mc_ball.addEventListener(MouseEvent.MOUSE_DOWN, handlerSharedBall);
  26. mc_ball.addEventListener(MouseEvent.MOUSE_UP, handlerSharedBallOut);
  27. function handlerSharedBall(evt:MouseEvent):void
  28. this.addEventListener(Event.ENTER_FRAME, update);
  29. mc_ball.startDrag();
  30. function handlerSharedBallOut(evt:MouseEvent):void
  31. mc_ball.stopDrag();
  32. function update(evt:Event=null):void
  33. so.setProperty(“x”,mc_ball.x);
  34. so.setProperty(“y”,mc_ball.y);
  35. init();

Veja uma demostração em funcionamento:

Download sharedBall

« Entradas anteriores | Entradas recentes »

ACERCA

O que é o RedeRIA ?

O redeRIA não é nada mais que um agregador de feed's que disponibiliza o conteudo de varios blogs e autores ao redor do mundo RIA, actualmente agregamos mais de 2791 entradas vindas de 53 blogs especializados em ria’s, pelo que só fica a ganhar em assinar o feed ou seguir a comunidade no twitter.

Se acha que o seu blog ou um blog de um amigo é interessante e util para os leitores o redeRIA, faça a sua submissão aqui.

Feed: assine já
Twitter: siga-nos

GOOGLE

Votação


Deveria o RedeRia agregar conteúdo em inglês?
Ver Resultados

AUTORES


Eduardo KrausAlexandre TadashiBindableCognitiva SoluçõesDaniel LopesDaniel SchmitzDanielPedrinhaDClick TeamEbercomEdgard DavidsonElvis FernandesErko BrideeFabiel PrestesFábio Batista da SilvaFabio da SilvaFabriccio BernardesFelipe BorellaFlavia MoreiraGabriel VersalliniGabriela T. PerryIgor MusardoJanderson CardosoJoão AugustoJose Carlos FielKelps SousaLeonardo FrançaLucas MarçalLuis MessiasLuiz TarabalMario JuniorMário SantosMauro MartinsPablo SouzaPedro ClaudioreneRia BrazilriaPTRicardo CerqueiraRobson FernandesRodrigo Pereira FragaSaintBrSamuelFacchinelloSergio SouzaSilva DeveloperStefan HorochovecTech CaffeTecinforThiago BuenoVedVinícius SandimWillian ManoXAML Cast

PUBLICIDADE








Powered by Wordpress & msdevstudio.com