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

Flex 3 sdk command line development with example on Linux

marz posted @ Aug 11, 2010 03:16:59 AM in flex , 1675 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:
Mar 15, 2021 11:25:55 PM

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:
Sep 10, 2021 01:05:56 PM

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:
Sep 14, 2021 10:47:35 PM

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:
Sep 19, 2021 02:12:16 PM

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:
Apr 07, 2022 03:13:36 PM

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:
Dec 06, 2022 03:47:38 AM

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:
Dec 13, 2022 09:07:01 PM

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

meidir said:
Dec 13, 2022 09:07:17 PM

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:
Dec 13, 2022 09:07:39 PM

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

meidir said:
Dec 13, 2022 09:07:59 PM

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:
Dec 13, 2022 09:08:14 PM

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:
Dec 17, 2022 09:18:51 PM

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:
Dec 21, 2022 11:09:29 PM

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:
Dec 23, 2022 12:21:32 AM

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

meidir said:
Dec 23, 2022 11:11:56 PM

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

meidir said:
Dec 24, 2022 01:01:22 AM

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

meidir said:
Jan 07, 2023 01:22:31 AM

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:
Jan 10, 2023 05:44:54 PM I consider something really special in this website . 바카라사이트
meidir said:
Feb 18, 2023 06:38:05 PM

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:
Apr 19, 2023 12:13:32 AM

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:
Apr 27, 2023 09:10:59 PM

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:
Jun 08, 2023 02:42:55 PM

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:
Sep 20, 2023 10:50:37 PM

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:
Jan 20, 2024 10:00:17 PM

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:
Jan 22, 2024 02:34:32 PM

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.


Login *


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