PDA

View Full Version : flex help


ubernew
05-04-2007, 10:32 PM
I recently bought a book "programming flex 2" and am trying to go thru the examples with flex.

so, I'm trying out the part to stream media with flash. the book mentions rtmp that is used with FMS. however, i've seen other premade flash mp3 players that can play mp3s just by an xml playlist. so, how can i build an app that can stream mp3s without FMS?

Also, there is an example about using compc to add external classes to a swc file for compiling.
I keep getting this-- Error: could not find source for class com.oreilly.programmingflex.

I've saved the class as com.oreilly.programmingflex

the file contains:

package com.oreilly.programmingflex
{
some sample code from book
}

Since I'm new to programming, I don't know if class files need some special name or if there is something missing within the file... I know to build the final swf I would compile "something.mxml"

by the way, I'm using the free flex2sdk and a regular text editor on linux. I compiling via command line.

ubernew
05-07-2007, 05:36 PM
ok, found out i should save it as a .as file.

so I saved that class as program.as

inside the file is:
package com.oreilly.programmingflex
{
some sample code from book
}

but when I run
compc -source-path . -include-classes com.oreilly.programmingflex -output program.swc

I get this error:
Loading configuration file /opt/flex_sdk_2/frameworks/flex-config.xml
Error: could not find source for class com.oreilly.programmingflex.

what could the problem be?

jsebrech
05-08-2007, 09:52 AM
I haven't toyed that extensively with AS3, but what I assume is this:

You're defining a package com.oreilly.programmingflex. This means that when your program is compiled, it will start looking for a subdirectory of your class path named com/oreilly/programmingflex, and inside of that it will look for a file named someclass.as, where someclass is the name of the class (in the same case) as is defined inside your as file.

You're probably best off to read up some more in the livedocs (or in your book) about packages, classes and paths with respect to compilation.