If you can, implement in Flash at the top of your code:

_lockroot = true

If that doesn't work, try putting that code creating elements into a movie 
clip or component itself; running code on _root is bad anyway.

...frankly, I don't think this "functionality" is supported; I don't know 
what Flex is doing, if anything, to protect it's package paths from being 
overrwritten by the Flash MX 2004's framework; they are very similiar, yes, 
but... also different.  Your mileage may vary; load with caution.

----- Original Message ----- 
From: "kredding.geo" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 21, 2005 7:57 PM
Subject: [flexcoders] loading a flash component




If you use mx:Image to load a swf file, should the swf file work
exactly the same as it does in flash, or does the actionScript in the
Flash file take on new meaning once it is embedded into the Flex
application?  I am asking because I have the following script in my
flash file.  It works great in flash, but doesn't work at all in
Flex?  Is it just a depth issue?  if so, how do I fix the depth to
get it to work?  What the code does in Flash, is it keeps creating a
text input field everytime you put the cursor down. The field lets
the user enter text and then create a new field.

import mx.controls.TextInput;

this.createEmptyMovieClip("card_canvas",10);
card_canvas.width = 20;
card_canvas.height = 20;
var i:Number = 1
var nextDepth = 0;
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
card_canvas.createTextField
("mytext"+i,nextDepth++,card_canvas._xmouse,card_canvas._ymouse, 0,
0);
card_canvas["mytext"+i].type = "input";
card_canvas["mytext"+i].autoSize = true;
card_canvas["mytext"+i].multiline = true;
card_canvas["mytext"+i].border = true;
card_canvas["mytext"+i].background = true;
card_canvas["mytext"+i].selectable = true;
i++;
};
Mouse.addListener(mouseListener);








Yahoo! Groups Links








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to