Creating and editing CSS in Flex3 Air - css

I need to create a CSS file via the Flex 3 Air application. I need to create and edit the CSS file and access individual styles by class name. Please give any examples or related links of which you aware.

I don't use Flex that much, but it seems you need to load the CSS file via URLLoader/HTTPService/etc and write a class to parse.
You can probably start from the one that comes with the framework, or have look online and adapt one for your needs. The first this that I found was this. Obviously there could be better alternatives.

Related

How to start to implement foundation 3 css framework?

I am planning to use foundation 3 css framework, but has no idea where should I start.
I got the jpeg mock up from designer, which design from scatch. Does the mock up need to be designed based on the founcation's grid?
Best if you take a look at the documentation for Foundation here: http://foundation.zurb.com/docs/grid.php
It doesn't necessarily have to be designed by keeping the grid in mind. Any thing can be achieved with the grid system. This is basically way to create a responsive website and also helps in maintaining uniformity through out the page.
I also suggest the following:
1) get a template you like form the foundation 3 website and then start with that. Try to see how the html structure is and then.
2) try to change the backgrounds, colors by adding properties inside app.css (ITS BEST IF YOU DO NOT MAKE CHANGES TO foundation.css file).
3)Use tools like firebug or the inbuilt "inspect element" in browsers to find out which css property is being used and you can change it.
4)You need to explore it for atleast a couple of hours.
cheers!!

Best approch to upgrade css classes in asp and aspx pages

I am working on website upgrade project (UI only ). This website has more than 5000 pages and 200 css files.
Basically In this project I have to replace old css classes with new css classes but this is not straight foreward. For some changes I have to modify HTML code with css class to achieve new UI look and fill.
I have identified type of changes required to migrate old page to new page. Total type of changes required are near about 15.
I am thinking about automating these 15 type of changes. Is there any tools(like html editor with regular expression support) available which will help me to achieve this functionality.
I am also thinking about developing c# based tool which will help me in achieving above changes but before that I want to know if any such kind of tool exists which will help in achieving the same.
Also if anybody worked on such kind of project then please share any other ideas.
Thanks in advance.
I think you could accomplish this by using the find-and-replace function in your code editor.
You could also keep the existing class names and replace their properties with your new class properties. With this method, you wouldn't have to edit anything but the CSS file itself.

Few basic questions on flex/AS

Guys i have struggling with flex since a day or two.I havent found a nice short tutorials.Actually i also have been struggling with FLEX IDE too.Please indicate a nice good tutorials for this
I basically have questions like
Cannot use Alert in AS
Including a AS file in mxml file
org.com.structure and the as file in it.Why do we need to say pacakage org.com inside the as file
You can use flex Alert class. In pure AS, unlike JavaScript, there is no alert().
<mx:Script source="script.as"/>. But script.as will not know about MXML file, it's better to use class defined in as file as a control in MXML.
Because packages are compiler-enforced design decision, and who we are to discuss it.
Flex in a week!
http://www.adobe.com/devnet/flex/videotraining.html
This video series helped me a lot..

flex newbie: can MXML be generated on the fly

Flex newbie question: can MXML be generated on the fly, like HTML is generated by a server?
If yes, is it ok to do so or am I missing an important Flex architectural principle.
Sort of... but it still needs to be compiled. MXML is not rendered directly, it is first compiled into ActionScript 3.0, and then into a typical SWF... so, you cannot serve your users with MXML. However, like almost all programmming languages, you can use automatic code generation to ease development tasks.
There is IIS/Apache component given by adobe that can generate your mxml -> html+swf using on the fly compilation, and it also caches the last compiled file.
However its not recommended for bigger projects as it has certain problems that you cant make libraries of your code and organize code accordingly. Namespace usage is very limited.
MXML is just a way of describing user interface layout and scripts. This information is then "compiled" into ActionScript, then converted to SWF format for use in the Flash player.
So, yes, you can generate MXML on the fly, in that you can create a text file that contains valid MXML syntax, then use mxmlc to compile it, but there's no way (that I'm aware of) to create MXML and "add" it to your current movie such that the information appears as it would were it compiled.
It is not officially supported but there is a few similar projects doing stuff similar to this.
as3Query let you create things with xml.
Using createComponentFromDescriptor() maybe can get what you want.
Should be more as I remember, but can't find it out at this moment... Searching for "MXML runtime dynamic compilation" or something like that should be helpful...

How to create/use themes in a Flex project

I just started out with Flex, and while I have worked with Actionscript2 for a few years, I'm still getting my head around Actionscript3. I've been diving into Flex for the past week, and can't figure this one thing out.
I am looking into the best way (or 'a' way) to allow me and other folks working on this project to easily create new themes for kind-of an video player. I show two videos, and need to be able to reposition them, style them, add images and anything else, really. I'm not looking to create a full-on templating engine, but if I could have a separate file/folder for each template, that would totally make my day.
I imagined having a solution in which I would have a folder inside src/templates/, and inside that folder I would have view.mxml that contains everything I need to display the videos. I would then be able to add other files such as images and such to make this template look the way it should.
Which template should be used should be defined by a variable in the main video file. This will either be provided to the swf file on playback, or provided by the video loading an external configuration file (but this is not part of my question :).
So, in short; How do I include mxml files that are inside one or two sub-folders inside src, and how do I do this in a way that the file I wish to include can be chosen via a variable.
Thanks so much in advance!
-Dave
You'd be surprised to what degree a Flex application can change its appearance through styling. Check out the following project:
http://www.fillcolors.com/
If you need more flexibility still, you could have an application with multiple views, one for each theme you want to show. An easy way to do this in Flex is to make use of the ViewStack component which basically layers view displays, showing only one at a given time.
As a very simple example, you could have something along these lines:
<mx:ViewStack selectedIndex="{currentIndex}">
<themes:CustomTheme1/>
<themes:CustomTheme2/>
<themes:CustomTheme3/>
</mx:ViewStack>
Here, currentIndex is a variable bound to the ViewStack, determining which of the three children is currently visible, each of which represent a custom MXML component (in your case, a theme).
Response to comment:
Yes, the above example is designed to do exactly that, but it's really not a feature of Flex, but of AS3. The CustomThemeX components are located using the themes namespace. The namespace is defined within the parent components root tag. In this example, the parent is a Canvas component:
<mx:Canvas xmlns:themes="themes">
This tells the compiler to look for these custom components within the themes sub-folder of your application; in other words, the src/themes folder, which contains the CustomThemeX components.
If the preceding paragraph didn't really sense to you, I'd recommend picking up a book/reading through the documentation about AS3/Flex and learning more about some of the core concepts of AS3 and object oriented programming. I wish I could help out more, but this question is starting to get a little too broad. I hope you understand. :)
I'm not an expert on Flex. But I've seen a tutorial on skins in Flex on gotoAndLearn.com. Maybe that kan give you some hints: Introduction to Flex: Part 3

Resources