Linux上用ActionScript 3(Adobe FLEX 3.0 SDK)开发Adobe Flash应用
Flex 命名空间

Flex 3 sdk command line development with example on Linux

marz posted @ 15 years ago in flex , 1762 readers

This post shows how to do Flex 3 development using command line compiler mxmlc under Linux
The example uses a basic actionscript 3 class and an mxml file using the class defined in the .as file.

Step 1:
Download and extract flex 3 sdk to /opt/flex_sdk_3

Hence my flex_sdk_home is /opt/flex_sdk_3

Add /opt/flex_sdk_3/bin to environment path variable.

Create project folder in workspace /home/asantoso/workspace/flex/

With project name example: actionscript

The final directory structure is:
/home/asantoso/workspace/flex/actionscript/
/home/asantoso/workspace/flex/actionscript/src/
/home/asantoso/workspace/flex/actionscript/bin/

Step 2:
Copy flex-config.xml from ${flex_sdk_home}/frameworks to /home/asantoso/workspace/flex/actionscript/flex-config.xml

cp $flex_sdk_home/frameworks/flex-config.xml /home/asantoso/workspace/flex/actionscript/flex-config.xml

Edit flex-config.xml:
vi $flex_sdk_home/frameworks/flex-config.xml

Important step:

${flexlib} is a special config file variable used by the compiler and the value refers to the directory of the sdk. in this example ${flexlib} points to /opt/flex_sdk_3/frameworks. Since you are using flex-config.xml in a different folder, you need to correct the values of external library path elements, library path elements, namespace manifest path. You can statically set the paths manually, or append ${flexlib} to external library path elements, library path elements, namespace manifest path.

Now, uncomment the source-path element, and add a path-element child in the source-path element, which points to the root src folder of our project.
<path-element>/home/asantoso/workspace/flex/actionscript/src/</path-element>

save flex-config.xml


Step 3

:

 

Create actionscript file: /home/asantoso/workspace/flex/actionscript/src/com/example/quickstart/Greeter.as



package com.example.quickstart
{
public class Greeter
{
public var name:String;
private var secretValue:Number;

public function Greeter(initialName:String=”Agus”)
{
name = initialName;
}

public function sayHello():String
{
var result:String;
if(name!=null && name.length>0){
result = “Hello there, “+name+”.”;
}
else{
result=”Hello there, anonymous.”;
}
return result;
}
}
}


Create mxml file: /home/asantoso/workspace/flex/actionscript/com/example/quickstart/Greeter_mx.mxml



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initApp();">
<mx:Script>
<![CDATA[
import com.example.quickstart.Greeter;
private function initApp():void{
var myGreeter:Greeter = new Greeter();
output.text=myGreeter.sayHello();
output.text+="\n";
myGreeter.name="Harold";
output.text += myGreeter.sayHello();
}

]]>
</mx:Script>

<mx:Text id="output" width="100%" textAlign="center"/>

</mx:Application>


Step 4:

Create a file /home/asantoso/workspace/flex/actionscript/compile

 

vi compile

#!/bin/bash
mxmlc -load-config flex-config.xml ./src/com/example/quickstart/Greeter_mx.mxml -output ./bin/Greeter_mx.swf

make the file executable: chmod 755 compile

./compile

or compile them manually as follows:

optional step, compile actionscript class file (just for testing):
mxmlc Greeter.as

Compile flex's mxml file:
mxmlc Greeter_mx.mxml

To test the example swf:
Open /home/asantoso/com/example/quickstart/Greeter_mx.swf in Firefox

 

ref:asantoso.wordpress.com/2008/05/18/flex-3-sdk-command-line-development-with-example-on-linux/

  • No match
  • No match
Felix said:
4 years ago

Thanks for sharing this link to the article 'Flex 3 SDK command-line development with an example on Linux'. diamonds rings for cheap I think the Flex 3 server can be started manually from the command line. This can be done on any version of Linux.

zaiya said:
4 years ago

I was just about this one. Reading this was too easy for me to know about the Flex 3 SDK command-line development. garage door spring repair newport beach i hope that you are also good at these command line. I used to learn it from here.

jiyaaf said:
4 years ago

It is very useful to get information about such programs and codes. I think this can help me to get to know about the codes in deep. cbd oil for pain And please do add some kinds of running snippets with it.

kibn said:
4 years ago

From here you will be here getting lots of information regarding the programming code.So this website is coronavirus vaccinespecially made for the programmers and those people who are working in the IT development sector

jovnil said:
3 years ago

Almost all people are familiar with the Linux operating system. This website provides some examples and comes with online development with Linux software. If you are interested in you can go through this and also it’s will be helpful for your study purpose and Mechanic Tallaght share it with your friends

meidir said:
2 years ago

Quest to find him while keeping the missus in the dark about the whole situation, with some cute sidekicks a long the way and a bat sh*t crazy Ken Jeong. 二手Macbook

meidir said:
2 years ago

Nicely I definitely loved learning it. This particular topic procured by a person is very efficient for accurate preparing. محامي في جدة

meidir said:
2 years ago

wonderful points altogether, you simply gained a brand new reader. What would you recommend about your post that you made a few days ago? Any positive? محامي

meidir said:
2 years ago

So if the whole Rashard Lewis thing is true, then God must really hate LeBron James.|Only_Lightning| المكتب العربي للقانون

meidir said:
2 years ago

I dont think Ive read anything like this before. So good to find somebody with some original thoughts on this subject. cheers for starting this up. This blog is something that is needed on the web, someone with a little originality. Good job for bringing something new to the internet! ابحث عن محامي

meidir said:
2 years ago

In this awesome design of things you’ll secure a B+ for hard work. Exactly where you actually misplaced me ended up being on your specifics. You know, it is said, details make or break the argument.. And it couldn’t be more true at this point. Having said that, let me tell you precisely what did give good results. Your authoring is actually quite convincing and that is most likely why I am making the effort in order to opine. I do not make it a regular habit of doing that. Next, despite the fact that I can see the jumps in reasoning you come up with, I am not necessarily certain of just how you appear to unite your points which in turn make your conclusion. For the moment I will, no doubt subscribe to your issue but wish in the near future you connect your dots better. مكاتب محاماة في جدة

meidir said:
2 years ago

I will right away grasp your rss feed as I can not find your e-mail subscription hyperlink or newsletter service. Do you’ve any? Kindly allow me know so that I may just subscribe. Thanks. china expat health insurance

 

================

 

I loved as much as you’ll receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get got an nervousness over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly a lot often inside case you shield this increase. 747 Live

meidir said:
2 years ago

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. 메이저사이트

 

=============

 

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! 여우알바

meidir said:
2 years ago

i can see that most mobile phones today are equipped with cameras and stuffs** 바카라사이트

meidir said:
2 years ago

I am glad to be a visitor of this arrant site ! , appreciate it for this rare info ! . vps hosting

meidir said:
2 years ago

Did you publish this particular report by yourself? ? ? 마사지

meidir said:
2 years ago

Thanks, a really interesting read – added to bookmarks so will check back for new content and to read other people’s comments. Cheers again. 메이저바카라

meidir said:
2 years ago I consider something really special in this website . 바카라사이트
meidir said:
2 years ago

Your posts continually include much of really up to date info. Where do you come up with this? Just declaring you are very resourceful. Thanks again 슈어맨

meidir said:
about 1 year ago

What refreshing delight your posts are. I understood this should be here yet I ultimately became fortunate and the search terms worked. Getting more people to be part of the discussion is actually a positive thing. Help desk support singapore

meidir said:
about 1 year ago

Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your website? My blog is in the very same niche as yours and my visitors would genuinely benefit from a lot of the information you provide here. Please let me know if this okay with you. Thank you! auto transport companies

meidir said:
about 1 year ago

Hello I want to to talk about a remark right here concerning you to definitely be able to let you know just how much i actually Liked this particular read. I have to run off in order to aTurkey Day time Supper however wanted to leave ya a simple remark. We saved a person So will end up being coming back subsequent work to see much more of yer quality posts. Keep up the standard work. printer servicing

meidir said:
about 1 year ago

Thanks for the interesting article. I must query a couple of details. Can I post them here or should I personal mail you. cancer

meidir said:
about 1 year ago

Shame on you for making an additional great submit! Awesome stuff, keep up the superior work. I see a lot of potential! I wonder if you are an active user with any social networking web sites like Digg or Stumble Upon? AI Agent Collaboration Tools

jnanabhumiap.in said:
about 1 year ago

JNANABHUMI AP provides all the latest educational updates and many more. The main concept or our aim behind this website has been the will to provide resources with full information on each topic jnanabhumiap.in which can be accessed through the Internet. To ensure that every reader gets what is important and worthy about the topic they search and link to hear from us.

Meidir said:
9 months ago

I would like to thank you for the efforts you’ve put in writing this website. I am hoping the same high-grade website post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own blog now. Actually the blogging is spreading its wings quickly. Your write up is a great example of it. john spencer ellis mug for camera

 

 

==================

 

 

Have you ever thought about including a little bit more than just your articles? I mean, what you say is valuable and all. But think of if you added some great photos or video clips to give your posts more, “pop”! Your content is excellent but with images and video clips, this blog could certainly be one of the greatest in its field. Wonderful blog! john spencer ellis pictures

Clay Lowe said:
5 months ago

This is very interesting content! I have thoroughly enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great. custom chocolate wrappers

Matthew Wade said:
2 months ago

Really enjoyed this post about career growth. The insights are incredibly valuable. ruby woo mac

Matthew Wade said:
about 1 month ago

I have been reading out many of your articles and i must say pretty good stuff. I will surely bookmark your site custom shopify website design

Jackson said:
24 days ago

There’s noticeably a bundle to learn about this. I assume you made sure good points in features also. Custom Awards

Jackson said:
9 days ago

It hard to find knowledgeable individuals on this matter, however you sound like you understand what you are talking about! Thanks SAU

Jackson said:
3 days ago

Just article, We liked its style and content. I discovered this blog on Yahoo and also have now additional it to my personal bookmarks. I’ll be certain to visit once again quickly. electric gate repair near me


Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter