Senior Member
You misunderstood the word "imported". I have attached a sample.
Attached Files
- The right of the People to create Flash movies shall not be infringed. -
Not sure...
what are you showing in the example?...I'm missing the point, sorry...
A bit more on embedded text...seems as if you have a monospaced font in a static textbox...spaced out correctly...select a portion of text and place a URL in the link box...all spacing goes away!...how wonderful is that?!?
So, it looks as if an invisable button is the only way to go...
Senior Member
The only thing I show in the example is how to use the invisible button, so it stays with the text, since that was your problem. i don't care about the font, alias status or whatever in this example.
- The right of the People to create Flash movies shall not be infringed. -
Ah!
Now I understand...ok...
Thanks!
How to translate the asfunction...
when it was dynamic text, I was able to call the function myTest using the asfunction...re: <a href="asfunction:myTest,trtjb.jpg,90,187,1">
How can I translate this to be used on a button?
myBut.onRelease = ???
Thanks and more thanks...
Senior Member
PHP Code:
but . onPress = function ()
{
myTest ( "testmovie.swf" , 100 , 200 , 1 );
};
function myTest ( myMovie : String , pos_x : Number , pos_y : Number , myLevel : Number )
{
_root . createEmptyMovieClip ( "a" , myLevel );
_root . a . _x = pos_x ;
_root . a . _y = pos_y ;
var mc : MovieClip = _root . a . createEmptyMovieClip ( "mc" , 1 );
mc . _lockroot = true ;
mc . _alpha = 0 ;
mc . loadMovie ( myMovie );
//
_root . onEnterFrame = function ()
{
var speed : Number = 2 ;
if ( mc . _alpha < 100 )
{
mc . _alpha += speed ;
}
else
{
delete this . onEnterFrame ;
}
};
}
- The right of the People to create Flash movies shall not be infringed. -
As always...
very cool...thanks, thanks, thanks!
Just can't get it to work...
I have this code on the first frame of the main movie...
clip.createEmptyMovieClip ("clip1", 1);
clip.clip1.loadMovie ("moogie.swf");
function myTest (myMovie:String, pos_x:Number, pos_y:Number, myLevel:Number)
{
_root.createEmptyMovieClip ("a", myLevel);
_root.a._x = pos_x;
_root.a._y = pos_y;
var mc:MovieClip = _root.a.createEmptyMovieClip ("mc", 1);
mc._lockroot = true;
mc._alpha = 0;
mc.loadMovie (myMovie);
//
_root.onEnterFrame = function ()
{
var speed:Number = 2;
if (mc._alpha < 100)
{
mc._alpha += speed;
}
else
{
delete this.onEnterFrame;
}
};
}
moogie.swf gets loaded...I have this code on the first frame of moogie.swf, along with the button called Mybut...the button is seen. but nothing happens when pressed
Mybut.onRelease = function ()
{
myTest ("openpic.swf", 40, 60, 1);
};
I'm pretty sure I'm making a mistake as to where the code goes...
Last edited by Motty99; 07-02-2006 at 05:06 PM .
Senior Member
check _lockroot in the help files.
- The right of the People to create Flash movies shall not be infringed. -
Ah...cryptic!
Ok...from what I read, I would have to tell the loaded SWF to access the main movie's timeline, and not it's own...makes sense...so I tried this...
mc._lockroot = true
in the loaded SWF's timeline...still didn't work...
Scratch that...reverse it...
I think I'm backwards in my expanation...
From what I've been reading, I need to place this into the loaded SWF...
this._lockroot = true;
Sound right?...I can't test until I hit home later...
Senior Member
Either that or clip.clip1._lockroot = true;
- The right of the People to create Flash movies shall not be infringed. -
Nope...
this._lockroot = true; or clip.clip1._lockroot = true; do not work...
again this goes into the SWF with the button?...I have this in that movie...
clip.clip1._lockroot = true;
myBut.onRelease = function ()
{
myTest ("openpic.swf", 40, 60, 1);
};
with the button named myBut...
and the code in the first frame of the movie that does the importing...
_root.a.removeMovieClip ();
clip.clip1.removeMovieClip ();
//
stop ();
clip.createEmptyMovieClip ("clip1", 1);
clip.clip1.loadMovie ("moogie.swf");
//
function myTest (myMovie:String, pos_x:Number, pos_y:Number, myLevel:Number)
{
_root.createEmptyMovieClip ("a", myLevel);
_root.a._x = pos_x;
_root.a._y = pos_y;
var mc:MovieClip = _root.a.createEmptyMovieClip ("mc", 1);
mc._lockroot = true;
mc._alpha = 0;
mc.loadMovie (myMovie);
//
_root.onEnterFrame = function ()
{
var speed:Number = 2;
if (mc._alpha < 100)
{
mc._alpha += speed;
}
else
{
delete this.onEnterFrame;
}
};
}
Any ideas?...
Just spinning...
I post the files in hope that you can sort this out...
Attached Files
Senior Member
You had a lot of mistakes in moogie.fla. Here is the script.
myBut.onRelease = function ()
{
_level0.myTest ("bl.jpg", 40, 60, 1);
};
- The right of the People to create Flash movies shall not be infringed. -
Now I'm confused...but happy!
Senior Member
No if your movie looks like this. If you have other things with _root in that movie add
this._lockroot = true;
- The right of the People to create Flash movies shall not be infringed. -
But I do...?
I do have a _root call in the myTest function...when I was testing this morning (at work now), I was unable to get my mask to work with this (the blue rectangle is masked so the gradent used in the myTest call from moogie.swf (using a test.swf instead of bl.jpg)...if this makes sense...
I did not have time to test a lot, but just wondering if the way the code is written will support a mask to myTest?
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width