Got CS5. Opened one of my main projects......tried to compile.......can't find classpaths. No big deal, check my classpaths in the system variables and that's still there. Follow the warning to which classes it can't find......the LOCAL "IN THE SAME FOLDER" classes!!
So, it can't use the "." to find as3.Document.as anymore? WTF?
And then I find out code hinting still sucks. What a joke. If I paid for this software I'd be pissed.
Why are you not finding classes right beside the document anymore? Fuck you.
that's odd, I had no issues with paths.
hmmmmm.
I think our IT dep't has everything fucked up on these computers. I had issues compiling in Flex too.
idiots
did you get my PM yesterday?
yeah - had similar probs with CS5
i had to manually enter my most common locations/paths under the AS prefs
Actually, mine had no problem finding my framework classes from the variable set in the window's classpath variable field.
It's the local classes sitting beside the .FLA that it doesn't find in CS5. So, any project that has local as files borks the compiler.
FLA -folder 'as3' -class.as
import as3.class;
chokes my CS5 installation. Anything I can try? '.' is there everywhere. In the preferences and in the document publish properties too.
hmmm ... aside from having to manually point to the directories as mentioned above (note this was only necessary when opening existing docs) i haven;t had any problems with things like my local styles.as or other class files on new docs.
wish i could be of more help :(
no worries. I just don't want to rely on hard paths. I'll try a new document and see if that works for local classes. Thanks! 
[edit] my mistake. One of the local classes had an inheritance thing from the main classes. So CS5 wasn't actually getting to the main classes. I had to manually add the Classpath folder to the CS5 preferences and everything was fine.
Weird that it no longer reads the Window's Classpath variable though. That was kind of our standard. I've relied on that since the beginning to map the compiler's classes.
Oh well. It's fixed. Sort of.
[edit edit] I will admit. I guess Adobe must be developing for Windows first versus the old days of Mac software ported to Windows. I demo'ed CS5 on my Mac but it runs way smoother on this Windows machine at work. Way smoother on less RAM and less processor.
I'm just going to keep a list of things I find to be ODDITIES because I'm tired of Flash and code on the hopes someone can help.
I have a custom drop down MC. Line 1 works no problem. Line 2 onward do nothing. This, to me, is an oddity.
b_open.addEventListener(MouseEvent.CLICK, openHandler); b_open.addEventListener(MouseEvent.MOUSE_MOVE, checkMouseMenuPosition); this.addEventListener(MouseEvent.MOUSE_MOVE, checkMouseMenuPosition); stage.addEventListener(MouseEvent.MOUSE_MOVE, checkMouseMenuPosition); MovieClip(stage).addEventListener(MouseEvent.MOUSE_MOVE, checkMouseMenuPosition);
On the custom drop down MC, a button lives that is the click. Standard Op for a Flash app. But neither the button, the stage, or the drop down MC itself ever report a Mouse_Move event.
What have I done wrong? There's nothing covering it on the stage. THis is one of those things that you assume just works whether you attach it to b_open, this, stage, MovieClip(stage), or whatever. It never traces any Mouse_Move to show mouseX. Ever. This is why we pull our hair out.
First of all, casting stage to MovieClip will throw an error. Stage isn't a MovieClip or derivative of MovieClip , so that's not going to work.
Secondly, are you assigning the event handler to stage from within the constructor of a MovieClip before it's been added to the stage? This will fail because stage doesn't get set on a MovieClip until 1 frame after it's been added with addChild();
Thirdly, with the new display list in as3, MOUSE_MOVE events are only fired when the cursor is within the bounds of the clip it's assigned to, as opposed to as2, where a handler was fired stage wide no matter where it was assigned.
None of the five produce an error. None of the five work. Even when moving the mouse within the bounds of the clip it is assigned to. I'm in strict compile mode too. Nothing. Nothing either way. One of those five should work. The MovieClip(stage) idea came from an example in Adobe's own help files. I just don't get why I can't produce ANY mouse move event even moving the mouse within the button.
import statements
Ok, so I thought CS5 improved the code hinting to at least show they're trying to keep up to other better code products (FD).
I don't even get code hints in CS5 for import statements.! Is this just for me or did they still not really improve much for code hinting?
This is an example of what leaves me brain-dead, tired, frustrated with AS3. I see the benefits of it, but I feel like Adobe half-assed certain things. And as a result I spend HOURS tweaking things that should just work (in my head they should at least).
So.....as a result....I'm begging for help and to convince myself that I'm not crazy and that Adobe isn't as shoddy as they seem.
I've been working on a project here that is a complete listing of courses available. It could be anything. It's all SOAP web services and I have to parse the XML. We're now 1.5 years into this project and someone decides to implement a new feature and I'm fucking tired of examples such as this.
Ignore all the other data streams going on but to display the courses, the web service controller at the root listens for the WSEvent and stores the resulting XML in a variable called CourseListXML:XML. This has worked fine for a year and a half without ever failing. The MC that displays the courses graphically loads and reads CourseListXML from the root and builds its list (all graphics are custom...it doesn't go to a DataGrid or anything).
So, the change was......"Let's display a message such as 'Too Many Records. Please refine your search.' if the search retrieves more than 400 courses." No problem I said. I asked the .NET guy to add an attribute to the main node that I could use as a Boolean.
eg of a list that works:
| | etc </Data
It reads how many modules and builds graphics. Simple Flash 4 stuff.
The .NET guy decided NOT to return the 400 and empty the XML if the limit is reached. The resulting XML is this:
And everything dies. Here's what happens and I'd like someone to help me sort this out. I can't use trace() to get at things, so I have to build my own trace box and output a string to 'read' the XML. It's a limit of how I'm allowed to work here in the security at this place. I can't run anything local in the debugger. The fact is the debugger has never worked in how they've installed the software. But I digress.
If I trace (to my op.text on the root) the XML from the root event listener to my op text box, I can read it no problem.
op.text = wse.wsResult.attribute("Limit").toString();
op.appendText(wse.wsResult.toXMLString());
If I try to read what the child MC grabbed from the root I get NOTHING. Zero. Zilch. Even though the child has no problem reading the full XML when CourseListXML is full of data! So, here's my question.....
Is it showing nothing because it simply can't output to a String for me to read or does it not actually exist as XML in the child MC's eyes?
In theory, if it's XML on the root, the child should be able to read that format as XML too. I am not understanding the difference. So, what should take me 2 minutes to convert the string to a Boolean now takes me hours to figure out and try multiple format conversions of a String or XML to make shit like this just work.
Advice? Guidance? Help? Cuddles followed by the words "It's going to be ok."
cuz I lose my fucking mind when shit doesn't work the way I think it should work. XML on the root is no different than XML in a child. The whole app has been built around the child reading the root's XML and it has worked for a year and a half but I've spent a full day on this stupid little change.
When I first jumped into AS3, I just thought it was me not 'getting AS3' when these things popped up. But now that I'm more than 2-3 years of AS3 now I'm getting really tired of this shit happening regularly where I have to rewrite code just to do simple hacks and round-abouts to make things work how I think they should. But I want to give Adobe the benefit of the doubt. But XML is XML. And this is only one example of my pain.
can you share the code where the mc looks for the attribute in the xml?
i
sure....I've tried a multitude of variations but this is how it sits now.
var overload:Boolean;
if(xml.attribute("Limit").toString() == "1") {
overload = true;
} else {
overload = false;
}
I just can't get xml to trace anything though.
And here's my op.text from the last trace from both levels.
Web Service Result passed. The Limit as read from the root timeline is: 1 The XML that the root timeline saw was:
This is the XML that the child MC reads from the root:
Because I run into these 'oddities' so often I will admit I do wonder whether the IT dep't here has created a scenario where my compilers just don't find everything and that's the reason my apps break with weird things all the time. I never really know whether I'm yelling at Adobe or the techs here. Is it possible their custom Windows OS builds creates any scenario where my apps compile with oddities? Is it possible I could take this exact code, go home on my machine and the oddities would not happen?
I do have other issues with the infrastructure here too. But as two years have gone by now in this job I'm at a point where I go crazy figuring out AS3 oddities such as this and you see my stress reflected in 12s fairly often with rants against Adobe.
that should be working. is that snippet inside any code or called by any block that is itself inside a conditional which looks for child XML nodes to exist? You may be getting a silent stop on an undefined looking for a child node that would only show up in the debugger, which you can't see because of the setup requirement.
I just got the .NET guy to add a child to the result. Without changing any code in my app......here's the trace result:
Web Service Result passed. The Limit as read from the root timeline is: 1 The XML that the root timeline saw was:
This is the XML that the child MC reads from the root:
NO CHANGE of code. And now I see the XML.
Here's kind of the procedural path (from exerpts)
var FullListXML :XML; FullListXML = MovieClip(root).CourseList; disp(FullListXML, allCoursesHolder);
function disp(xml:XML, holderObj:Sprite) {
var xPos:uint = 0;
var yPos:uint = 0;
MovieClip(root).op.appendText("This is the XML that the child MC reads from the root:\n"+xml.toXMLString()+"\n-----\n");
// THIS above is what reads as empty before anything else
// I MAY have changed and screwed up code below trying to get
// all this to work before I went back to find the problem
var overload:Boolean;
if(xml.attribute("Limit").toString() == "1") {
overload = true;
} else {
overload = false;
}
try {
if(overload) {
mc_overload.visible = true;
} else {
for each (var item:XML in xml.ParentModule) {
// then it does it's building thing from here
that IS frustrating.
and you say this works when the root node has children.
this should be working.
:/
Yup it all works now that there's a child node there. Thanks for your help. It always helps to have someone to discuss stuff with so it is appreciated.
This kind of thing happens at least once every two weeks for me since I started with AS3. I had the techs re-image my setup when I was gone two weeks ago, but I'm too drained mentally when I get home to bother doing any AS3 at all.
For me this should have taken 4 seconds and it took two days. So, since I was doing AS2 before I started here and AS3 since starting here I'm not sure who I'm really made at. But from my perspective I see AS3 as buggy and miserably frustrating. Had I worked from home on my own setup for the last two years there's a chance me and AS3 would be great friends. But for now, I'm mentally tired, I'm salty around the edges, and I'm ready to do blow my programming brain out and do nothing but Photoshop for the rest of my life.
Thanks persist.
When tracing a node of xml, it displays the contents of that node, not the node itself, which is why you're not seeing anything when tracing the xml without children. That doesn't mean that your values aren't there.
var source : XML = trace (source); // will trace as empty, as there are no children.
var isAtLimit : Boolean = source.@Limit == "1"; trace ( isAtLimit ); // true
var modules : XMLList = source..Module;
if ( modules.length() < 1 ) { trace ( "No modules..." ); }else if ( isAtLimit ) { trace ( "Overflow..." ); }else { // do what you will with this.modules; }
// edit snarky comment removed by lithium
Flash couldn't read the attribute until the child was added though. :shrug:
var isAtLimit : Boolean = source.@Limit == "1"; In AS3, I have been unable to assign a Boolean variable from a string ever. Yet another thing that has bugged the crap out of me, so I have a toBoolean class now reading the string and returning a Boolean to assign it. This has been since day one for me in AS3.
Question..... var modules : XMLList = source..Module; Why are you suggesting converting it to an XMLList now? What is the advantage?
Flash couldn't read the attribute until the child was added though. :shrug:
It doesn't need to have a child to read that attribute. If you run that code you'll see it traces fine without having any children.
As far as the advantage of working with XMLList is concerned, simply put, E4X rocks, and it's the only way i'll deal with xml in as3.
[latetotheparty]It doesn't have to be XMLList to use E4X processing. ?? [/latetotheparty]
It doesn't need to have a child to read that attribute. I'm telling you....on my system IT DOES need the child and I'm asking why. Serious. Weird. I don't think I was being unclear on that fact.
[newparty]
So, I was asked by the .NET guys for a simple one page .SWF that they could throw in their containers (frames of frames and pages and redirects and different server paths and blah blah). Because there were so many different ways of implementing training SWFs they had no real standard right now on variables from the DB.
They gave me a list of possible variables they just want to see if there is a result for it as a FlashVar and post that in a page. Instead of one big long string of shyte, they want to be able to see if that particular variable was actually present or not in that case. (They are moving everything onto one big giant server so trying to make sure everything is readable for any training piece when they stop doing the frame within a frame thing. They can't lose a JS variable or shit will fly.
So, in AS2 I would just make a text box for each with a label and it would just ignore what it didn't see.
In AS3 it fucking borks if it doesn't see something. Why does it have to stop processing FlashVars just because it didn't find a userId instead of UserID variable? Is this just something stupid with the compiler? I just want it to ignore what it doesn't find and move on, but it seems to stop processing when it doesn't 'see' something. Fucking just move on you stupid piece of shit.
I know "programmers" didn't want things failing 'silently' but c'mon. That's ridic. Is there a way around this?
[/newparty]
Do you mean like loop through and collect existing flashvars?
package net.justinfront.generic {
import com.yahoo.webapis.maps.utils.ExternalInterfaceBuffer;
import flash.display.*;
import flash.events.*;
import flash.external.ExternalInterface;
import flash.net.*;
import flash.text.*;
import net.justinfront.events.FlashVarEvent;
import flash.utils.Timer;
import flash.events.TimerEvent;
/**
* generic class for External Communication
*
* @author Justin Mills
* @since 25.07.2008
*/
public class ExternalCommunicator extends EventDispatcher
{
/** Yahoo External Interface Buffer */
private var _EIBuffer: ExternalInterfaceBuffer;
/** Holds the flash vars that are loaded */
private var _allFlashVars;
/** An Object to hold the organised into Object of Array tidied flashvars */
private var _tidiedFlashVars: Object;
/** No longer used?? TODO: Remove */
private var _jsonData: String;
/** No longer used?? TODO: Remove */
private var _data: Array;
public var _level0;
private var _timer: Timer;
//var _txt;
/** TODO: Remove */
public function get data(): Array
{
return _data
}
/**
* Constructor initializes the yahoo interface buffer
*/
public function ExternalCommunicator( level0_ )
{
_level0 = level0_;
//_txt = level0_.txt
_EIBuffer = ExternalInterfaceBuffer.getInstance();
}
/**
* Sets up a timer to check for existance/population of FlashVars
* @see isReady
*/
public function processLoadVar():void
{
_timer = new Timer( 40, 0 );
_timer.addEventListener( TimerEvent.TIMER, isReady );
_timer.start();
}
/**
* checks inside FlashVars for content
* For timer loop setup of this
* @see processLoadVars
*
* @see loadvarReady
* for processing of the FlashVars
*/
private function isReady( e: TimerEvent )
{
// special line used to access flashvars
_allFlashVars = LoaderInfo( _level0.loaderInfo ).parameters;
var notEmpty: Boolean = false;
for( var all in _allFlashVars )
{
notEmpty = true;
break;
}
if( notEmpty )
{
_timer.stop();
loadvarReady();
}
}
/**
* Loops through flashvars and makes them into an
* arrays of content within an object based on there names
*
*/
private function loadvarReady():void
{
var all: String;
var stem: String;
var temp: Object;
var no;
_tidiedFlashVars = {};
var count: int;
for( all in _allFlashVars )
{
count++
trace( ' flash var count ' + count );
temp = getStemIndex( all );
stem = temp.stem;
no = temp.no;
//_level0._txt.text += all + ' : ' + _allFlashVars[ all ] + '\n';
if( no != '' )
{
if( _tidiedFlashVars[ stem ] == undefined )
{
_tidiedFlashVars[ stem ] = [];
}
_tidiedFlashVars[ stem ][ int( no ) ] = _allFlashVars[ all ];
trace( all + ' ' + _allFlashVars[ all ]);
}
else
{
_tidiedFlashVars[ all ] = _allFlashVars[ all ];
trace( all + ' ' + _allFlashVars[ all ]);
}
}
dispatchEvent( new FlashVarEvent( FlashVarEvent.FLASH_VARS, true, false ) );
}
/**
* works out if a FlashVar should be part of an array
* and extracts name and array number from the flashvar
* @param str name of a flashvar
*/
private function getStemIndex( str: String ):Object
{
var arr: Array = str.split('_');
return { stem: arr[ 0 ], no: arr[ 1 ] };
}
/**
* Getter for the tidied Object of Arrays ( restructured flashvars )
*/
public function get vars(): Object
{
return _tidiedFlashVars;
}
/**
* A setter for the tidied flashvars, used for injection
* of a class based flashvar internal player testing
*/
public function set vars( val:Object )
{
_tidiedFlashVars = val;
return _tidiedFlashVars;
}
/**
* Used to call external javascript methods
*/
public function externalCall( meth: String, dat: String ):void
{
_EIBuffer.addCall({ method: meth,
data: dat });
}
/**
* calls a function to load a new web page
* @param info URL to go to
*/
public function clik( info )
{
externalCall( 'getLinkUrl', info );
}
}
}
package net.justinfront.events {
// see moock 226 for example
import flash.events.*;
public class FlashVarEvent extends Event
{
public static const LOADED_EXTERNAL: String = 'loadedexternal';
public static const FLASH_VARS: String = 'flashvarsloaded';
public function FlashVarEvent( type: String,
bubbles: Boolean,
cancelable: Boolean
)
{
super( type, bubbles, cancelable );
}
public override function clone():Event
{
return new FlashVarEvent( type,
bubbles,
cancelable
);
}
public override function toString():String
{
return formatToString( 'FlashVarEvent',
'type',
'bubbles',
'cancelable',
'eventPhase'
)
}
}
}