Movie clips selecting current target
Hi
I am currently stuckon what i think has to be a simple
problem:) the jist of it is as follows.
I have a movie clip on stage that is clickable.
Once clicked I creata new movie clip and attach a movie clip
from the library.
At this stage i also create a text field and add it as a
child to the new movie clip.
now my problem is that i want the movie clip to be clickable
so that a user can maniuplate it. However if the click clicks on
the text field i get an error saying it cant be converted to a
movie clip. As yes i am casting the selcted object as a movie
clip:) I just wondered if anyone could point me in the right
direction of apporaching this, as its drivign me slowly insane.
regards
a
Hi Kglad
thats a very good question:) and im sure where img oign worng
but cant work out how to do this:| Belwo is my code that creates
the new clip once a icon has been clicked on stage.
function addBubble(event:MouseEvent):void {
bubbleNum ++; // increment bubble num to use as name of
bubbles
// add in bubble clip
var bubbleClip:MovieClip;
bubbleClip = new bubble_container()
bubbleClip.name = "bubble" + bubbleNum;
port.addChild(bubbleClip);
// add in text field
var myText = new TextField(); // initiate my text as
textfield - CHANGED FROM DOING AS MOVIECLIP AS TEST
myText.type = TextFieldType.INPUT;
bubbleClip.addChild(myText); // add mytext to bubbleclip
myText.text = "wahoo"; // CHANGED FROM >>> attach
text field form library
myText.autoSize = "left";
myText.multiline = true;
trace(bubbleClip.width);
bubbleClip.x = 20;
bubbleClip.y = 200;
myText.x = 10;
myText.y = 10;
myText.width = 218; //bubbleClip.width; // THIS NEEDS
WORK!!!!!!!!!
trace("width of text=" + myText.width);
bubbleClip.addEventListener(MouseEvent.MOUSE_DOWN,
setSelect)
steSelect does very little at the minute but it here its is
for completion.
function setSelect(event:MouseEvent):void{
SelectedObject = MovieClip(event.target);
All i really wnat to acheive is the following.
user clicks an icon on the stage
this creates a new bubble movie clip which houses a graphical
asset(clip pulled from library) and a text field.
sets up a listerner to see if this has been clicked. (i set
the current target as selctedObject as there may be multiple
bubbleClips)
Once its been clicked it needs to be able to draggable and
also scalable flippable etc(ive got the code on this working), a
double click woud result int he text field inside being editable
(havent got to this buit yet:))
I jsuit cant get my head around casting and the best way to
approach this, it works fine if the user clicks on the bbble
graphic etc.Can u shine any light on this please?
Similar Messages
-
Drop and drop 4 movie clips to single target to navigate to seperate urls
var myTargetName:String = "target" + event.target.name;
var myTarget:DisplayObject = getChildByName(myTargetName);
if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
navigateToURL(new URLRequest(http:// websiteAdress.com));
I am trying to navigate to a new url for each movie clip, problem is im really unsure of how to achieve this I have one target on my page and would like to be able to drop any of these movie clipt o to it?
the movie clips are named:
port1_mc
port2_mc
port3_mc
port_4mc
really appreciate the helpassign a property to each movieclip that indicates the associated url. for example:
port1_mc.urlS="http://www.adobe.com";port2_mc.urlS="http://www.flash.com";
port3_mc.urlS="http://www.kglad.com";
port_4mc.urlS="http:://www.whatever.com";
you can then use:
navigateToURL(new URLRequest(e.currentTarget.urlS));
in your listener function. -
Hi All,
I'm looking for some information on how to take an embedded
flash movie clip and control it through Flex. I want to be able to
manually move through the movie clip, select frames to display etc.
Any information pointing me in the right direction would be
greatly appreciated.
Thanks in advanceFor Flash SWF's:
Inside your componet/app def:
private var movie_clip:MovieClip;
private var myLoader:SWFLoader = new SWFLoader();
onInit() {
myLoader.addEventListener(Event.INIT,loadHandler);
myLoader.trustContent = true;
myLoader.load("../assets/my.swf");
this.addChildAt(myLoader,0);
private function loadHandler(e:Event):void{
movie_clip= e.target.content;
movie_clip.gotoAndPlay(2);
movie_clip.some_custom_as3_method();
For Flex SWF's here is an example:
import mx.events.FlexEvent;
import mx.managers.SystemManager;
import mx.core.Application;
// * gets rid of type checking so we can leave strict enabled
[Bindable]public var _appLoaded:*;
private function
onCurrentApplicationComplete(oEvent:Event):void
_appLoaded = Application(oEvent.target.application);
private function onCompleteAppLoader(oEvent:Event):void
var smAppLoaded:SystemManager =
SystemManager(oEvent.target.content); //get a ref to the loaded app
//listen for the application.complete event
smAppLoaded.addEventListener(FlexEvent.APPLICATION_COMPLETE,
onCurrentApplicationComplete);
// call a custom public method in your application mxml file:
public function setPlaylist(id:int):void {
if(_appLoaded) {
_appLoaded.change_playlist(id);
]]>
</mx:Script>
<!-- <mx:SWFLoader id="player" x="0" y="0" source="
http://...Player.swf"
complete="onCompleteAppLoader(event);" trustContent="true"/>
--> <mx:SWFLoader id="player" x="0" y="0"
source="@Embed('../assets/Player.swf')"
complete="onCompleteAppLoader(event);" trustContent="true"/> -
Using one instance of a Movie Clip to load Graphics from library
Hi all,
another question... How would i go about loading a variable into a movie clip and have it pull different graphics from my library at different spots in the main timeline???
thanks!
PatrickHi NED! thank you for all your help so far!!!
I was wondering about the flexability of loading movies into a movie clip.
Currently, thanks to your help i am well able to load one movie into a movie "loader" clip, but thought maybe there is a way to load additional movie clips into that same "loader" clip, as i am starting to accumulate several different graphics that i need to have be inside movie clips so that i can make them change colors on the same frame when needed.
i shot from the hip and tried this code, but didnt have any luck:
mc_LCD_loader.attachMovie("hilight", "g", 1), ("header", "X", 1);
mc_LCD_loader.g._x = 0;
mc_LCD_loader.g._y = 1000;
mc_LCD_loader."X"._x = 0;
mc_LCD_loader."X"._y = 1000;
- - - where "hilight" is the identifier name of a given movie clip and "header" is the identifier of a given movie clip in the same library...
"hilight" loads fine
i dont fully understand what "g" means to the identifier...
i am just unsure of how or if it is even possible to load another MC into the same MC Loader...
is it possible? if so could you give me a hint?
thank you!
- patrick -
Closing swf loaded into movie clip
I have built a movie clip on my main flash file that I am loading separate swfs into. On the separate swfs I have a close button, but do not know what action script to attach to it to make the movie clip go away? I want these to go away every time you hit the close button on the separate Flash swfs loading into the main movie clip.
if the target movieclip has a non-negative depth and the close button is encoded on the loaded swf's main timeline, you can use:
var tl:MovieClip=this;
path.closeBtn.onRelease=function(){
tl.removeMovieClip(); -
Hello im trying to develop a small swf file that the user can
control a video that gives the impression of rotation and
transparency using arrow buttons. I have a 2 small movie clip files
that are currently spread across the timeline exactly 200 frames.
the videos are controlled by means of fast forward and rewind this
gives the impression of rotation (backwards and forwrds) i have
already got the fast forward and rewind function working i would
like another set of arrows that control the transparency or alpha
of the second movie clip so that when the user presses either an up
or down arrow button the transparency goes up or down. Im very new
to action script so any basic explanation help would be great. The
code for the forward and rewind buttons is as follows (ignore the
play function as this button is hidden off stage):
stop();
play_btn.onRelease = function (){
play();
pause_btn.onRelease=function(){
stop();
forward_btn.onPress=function (){
_root.createEmptyMovieClip("controller_mc",1);
controller_mc.onEnterFrame=function(){
_root.gotoAndStop(_root._currentframe+3);
if (_root._currentframe+3 > _root._totalframes){
_root.gotoAndStop(_root._totalframes);
forward_btn.onRelease=function (){
controller_mc.removeMovieClip();
forward_btn.onReleaseOutside=function (){
controller_mc.removeMovieClip();
rewind_btn.onPress=function (){
_root.createEmptyMovieClip("controller_mc",1);
controller_mc.onEnterFrame=function(){
_root.gotoAndStop(_root._currentframe-3);
if (_root._currentframe-3 < 1){
_root.gotoAndStop(1);
rewind_btn.onRelease=function (){
controller_mc.removeMovieClip();
rewind_btn.onReleaseOutside=function (){
controller_mc.removeMovieClip();
}//button is released and increases the Movie Clip's current
alpha value by 10%
increase_alpha_btn.onRelease=function(){
if(MovieClip._alpha<100){
MovieClip._alpha+=10;
//button is released and decreases the Movie Clip's current
alpha value by 10%
decrease_alpha_btn.onRelease=function(){
if(MovieClip._alpha>0){
MovieClip._alpha-=10; -
Whenever I load a movie clip into the target and test my
movie, the loaded movie clip always loads in the bottom right. I
think this is a registration error but I am not sure how to fix it.
My target is 835px by 635px, same as the movie clip I want to load.
Any help would be much appreciated.Position the blank movie clip in the top left corner where
you want to have
the external movie clip loaded.
Note that if the external movie clip has dynamic content
creation via AS or
different content size on higher numbered frames you may find
it will show
content to the left and top of the blank movie clip because
initial size is
not detectable. In particular if you are loading Flash movie
that you
created that you used a third party tool such as xCelsius. In
this case you
need to MovieClipLoader and once the onLoadInit event fires,
manually
position the blank movie clip which is passed as an argument
for coding
convenience.
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
"northstar_86" <[email protected]> wrote in
message
news:e27cer$5i2$[email protected]..
Whenever I load a movie clip into the target and test my
movie, the loaded
movie clip always loads in the bottom right. I think this is
a registration
error but I am not sure how to fix it. My target is 835px by
635px, same as
the
movie clip I want to load. Any help would be much
appreciated. -
My current os x is 10.9.5, using final cut express vers. 4.0.1. I have imported .mov clips created on a older mac os x (lion) and when I wanted to import them into fce, a quicktime conversion window opened up and converted them (I haven't experienced this in the past). I then imported the converted quicktime clips into my fce project. After doing this I took selected clips and put those edited clips on the fce timeline. When playing the video back in the fce timeline,I noticed
1) the video wasn't playing back smoothly like the original content
2) when looking at the timecode reading of the timeline, the timecode was sputtering as well as the video and audio. I exported to quicktime just to see if that was consistent, it was.
When I play the converted quicktime content independently of fce, it plays normally (no sputtering of timecode, video and audio. Need help to resolve the sputtering playback of converted video content in the fce timeline. I've never experienced this before. Any suggestions?When you say you converted the clips before importing them into FCE, did you convert to AIC or DV and do the converted clips match your FCE Sequence settings exactly? If not, go back and convert the original files again, using the intended Sequence settings as a guide.
-DH -
How do I move an event and keep the favorite clip selections?
Hi all,
I have to move several events from one external hard drive to another. On many of these events I've already started selecting favorite clips. When I moved my first event it erased my favorite selections. Not good. That took a lot of time and work. How do I move events and save the favorite clip selections within each event?
Thanks,
ggbeamerIt would be a good idea to learn iPhoto - the iPhoto '09 tutorials will help - and it would be a worthwhile investment of time to take the iphoto tutorials - http://www.apple.com/findouthow/photos/ - they are very helpful and will save you a lot of time and frustration. and there are iPhoto '11 tutorials under the help menu
A small investment of time now will save a lot of time and lost photos later
LN -
Selecting a frame in a movie clip
Hi,
A little help is required.
I have a movie clip, that i need to display on all frames on
the main timeline. I have animated the movie clip on its own
timeline. However I don't want the movie clip to play intially when
i load the movie. I only want it to play when a button is selected.
Can anyone please help me to get the movie clip to only play once a
button is clicked.
ThanksI have all my movies etc working so that each button plays a
separate movie clip.
Within each movie I have start and stops mid way through the
movie.
What i want to happen is, when a button is clicked once, i
want it to play frame 2-10 then when it is clicked again I want it
to play 11-20. How do I make it recognise its a second click. I was
thinking of using the boolean feature, but i'm not sure how this
would be used.
Can anyone help point me in the right direction? -
How do I precisely select a movie clip in event browser?
I've got a movie in event browser
I'm having trouble putting the mouse on half a second before the end
I know I can take off snapping which will solve my problem (I assume)
Just wanted to know if there was a keyboard method?
Use J, K or L? Just done this. Works OK
Or maybe click in the time field and put the exact time?
How do I get into the time box using just the keyboard?
Thanks
OmarUsing the numeric keypad (only on extended Apple keyboards, not on MacBook's etc) you can use the minus [-] key to set backwards or [+] key to set forwards, then type on the adjacent numeric keys how many frames to move backwards/forwards (using the numpads' enter/return key at the bottom right to commit).
For example: if moving the playhead back 15 frames, I would press they keypad's [-] key then type [1] then [5] on the keypad, pressing the return key at the bottom right to finish. Also, using the keypad's [.] after the numbers, tells FCP to use seconds and not frames. So moving forward by 12 seconds can be done by pressing [+] then [1] then [2] and finally [.] - completing with the return.
With the event browsers clip, I would use the right cursor key to ensure it's the final frame - then using the [-] on the keypad, type in the frames per second used divided by 2; hitting return to move the selection point to the correct position. -
Selecting a random movie clip from array
I know this should be easy, but I can't seem to make it work. All I want is for the variable currentPage to select randomly from an array so that every time the page loads, it displays a different currentPage.
This is what I have so far:
var myImages:Array = new Array("outsource_mc","solutions_mc","staff_mc");
var randomImages:Array = [];
var randomCount:Number = 1;
var r:Number;
for (var i = 0; i<randomCount; i++) {
r = Math.floor(Math.random()*myImages.length);
randomImages[randomImages.length] = myImages.splice(r, 1);
trace(randomImages);
currentPage = the random movie clip;
Thank-you for any help!!Anytime you want to see what something is, use the trace() function... it is an essential code design tool that outputs whatever you ask it to in the Output window.... trace(currentPage);
For the code I showed currentPage would have been one of the instance name String values from the array. If you had taken the quotes off of the names in the array, it would be a reference to the actual instance.
As far as the new code you show, I don't know what you are trying to do, nor what it is not doing that you expect it to, but the last two lines have no relationship to the lines preceding it. -
Target movi clip in separate swf
Hi, i am updating a website and am trying to move the "skip"
button to appear earlier. To do this I have to move the button to
another swf file.
now I can load the swf (dbo.swf) into an empty movie clip
(named empty_mc) easily enough, but I am trying to target different
things to happen inside of the newly loaded swf instead of playing
from the beginning. I tried this:
on (release) {
empty_mc.loadMovie("swfs/dbo.swf");
empty_mc.boxes_mc.gotoAndPlay("quickbuild");
empty_mc.gotoAndPlay("jump_home");
empty_mc.stopAllSounds();
...but it still plays from the first frame of dbo.swf instead
of playing the appropriate movies and frames. any suggestions?When I load in a new .swf file into my main movie, it appears to load on top of the main movie.
This is the load function that we set up:
this.createEmptyMovieClip("target1MC",this.getNextHighestDepth());
this.createEmptyMovieClip("target2MC",this.getNextHighestDepth());
var currMC:MovieClip = target2MC;
target1MC._alpha = 0;
function loadF(y:Number, d:Number) {
otherTargetF(currMC).swapDepths(Math.max(target1MC.getDepth(), target2MC.getDepth()));
mcl.loadClip("floors_swf/"+y+"_"+d+".swf",otherTargetF(currMC));
Is there a way to get the .swf file that gets loaded in to load behind the graphics in my main movie?
It appears to be loading into the target1MC, but I don't see where to set the level that it loads into?
Thanks -
Hello everyone,
I've worked on some code with a little help from some people
here and I've gotten everything to work. The problem I am having
right now is getting my cross fading images to sit inside separate
movie clips that are on my home .swf. The code I have so far is as
follows:
var showTime:Number = 5000 // milliseconds the picture shows
at 100% alpha.
mc_Mon1 = createEmptyMovieClip("img1_mc", 0);
loadMovie("images/home/image01.jpg", img1_mc); // load
picture from the file directory that your .swf is in.
mc_Mon1 = createEmptyMovieClip("img2_mc",
getNextHighestDepth());
loadMovie("images/home/image02.jpg", img2_mc);// load picture
from the file directory that your .swf is in.
img2_mc._alpha = 0; // hide 2nd picture
var duration:Number = 30; // milliseconds per alpha change
(framerate).
var count:Number = 0;
var alphaPhase:Number = 1;
var alphaCount:Number = 0;
function picSwap():Void {
count++;
if(count >= (showTime/duration)) {
alphaCount += alphaPhase;
img1_mc._alpha = 100-alphaCount;
img2_mc._alpha = alphaCount;
trace("img1 alpha: " + img1_mc._alpha);
trace("img2 alpha: " + img2_mc._alpha);
if(alphaCount >= 100 || alphaCount <= 0) {
count = 0;
alphaPhase *= -1;
var intervalId:Number = setInterval(picSwap, duration);
// End of script.
I am trying to make img1_mc and img2_mc sit inside mc_Mon1.
So I am thinking that I would need mc_Mon1 to
"createEmptyMovieClip" named "img1_mc and img2_mc. I thought thats
what I did with the code but so far my cross fading images just sit
up on the top left of the screen. Does anyone have any idea how to
set the target movie clip to load the other movie clips?
Thanks,
Kylehi,
you should make few changes in your code for it to work,
starting with this:
instead of - "mc_Mon1 = createEmptyMovieClip("img1_mc", 0);"
and the
following line, try - mc_Mon1.createEmptyMovieClip("img1_mc",
mc_Mon1.getNextHighestDepth());
mc_Mon1.img1_mc.loadMovie("images/home/image01.jpg");
and then -
mc_Mon1.createEmptyMovieClip("img2_mc",
mc_Mon1.getNextHighestDepth());
mc_Mon1.img2_mc.loadMovie("images/home/image02.jpg");
mc_Mon1.img2_mc._alpha = 0;
and then in picSwap function, it should be -
mc_Mon1.img1_mc._alpha = 100-alphaCount;
mc_Mon1.img2_mc._alpha = alphaCount;
that should do it i think.
just so you'd learn, in your original code, 'mc_Mon1'
actually is variable
reffering to 'img1_mc' (which, if i'm not mistaken, is
created in _level0),
but then 2 lines later you overwrite the refference to
'img1_mc' with a
refference to 'img2_mc' (which is also created in _level0).
one more thing which i didn't check - when you declare you
'intervalId',
don't u need to use 'showTime' instead of 'duration'?
good luck,
eRez
"kypsul" <[email protected]> wrote in
message
news:[email protected]...
> Hello everyone,
>
> I've worked on some code with a little help from some
people here and I've
> gotten everything to work. The problem I am having right
now is getting my
> cross fading images to sit inside separate movie clips
that are on my home
> .swf. The code I have so far is as follows:
>
> var showTime:Number = 5000 // milliseconds the picture
shows at 100%
> alpha.
> mc_Mon1 = createEmptyMovieClip("img1_mc", 0);
> loadMovie("images/home/image01.jpg", img1_mc); // load
picture from the
> file
> directory that your .swf is in.
>
> mc_Mon1 = createEmptyMovieClip("img2_mc",
getNextHighestDepth());
> loadMovie("images/home/image02.jpg", img2_mc);// load
picture from the
> file
> directory that your .swf is in.
>
> img2_mc._alpha = 0; // hide 2nd picture
>
> var duration:Number = 30; // milliseconds per alpha
change (framerate).
> var count:Number = 0;
> var alphaPhase:Number = 1;
> var alphaCount:Number = 0;
>
> function picSwap():Void {
> count++;
> if(count >= (showTime/duration)) {
> alphaCount += alphaPhase;
> img1_mc._alpha = 100-alphaCount;
> img2_mc._alpha = alphaCount;
> trace("img1 alpha: " + img1_mc._alpha);
> trace("img2 alpha: " + img2_mc._alpha);
> if(alphaCount >= 100 || alphaCount <= 0) {
> count = 0;
> alphaPhase *= -1;
> }
> }
> }
> var intervalId:Number = setInterval(picSwap, duration);
> // End of script.
>
> I am trying to make img1_mc and img2_mc sit inside
mc_Mon1. So I am
> thinking
> that I would need mc_Mon1 to "createEmptyMovieClip"
named "img1_mc and
> img2_mc.
> I thought thats what I did with the code but so far my
cross fading images
> just
> sit up on the top left of the screen. Does anyone have
any idea how to set
> the
> target movie clip to load the other movie clips?
>
> Thanks,
>
> Kyle
>
> -
Target a movie clip inside a movie clip
When I go to the symbol editing mode on the first movie clip, I drag the instance of my 2nd movie clip to the stage. I then am duplicating my work, (it is over lapping) not sure what I am doing wrong here? and I am finding that my child movie clip is taking on the parent movie clip properties. How do I stop this from happening? I thought they are to remain independent? Any help is greatly appreciated. TY.
Will the child timeline be independent of the parent timeline. My pend_mc is the child and has taken on the hand_mc properties. Also why is there brackets around some and not the others? Thank you so much for your time.
Maybe you are looking for
-
Using USB 6009 on Ubuntu 12.04
So I've read many forums on this and it seems to be a common issue, which no one has figured out (from what I've read so far). I need to have the USB 6009 working on Ubuntu 12.04 for some field experiments and I don't have alternatives / options. I d
-
I've been stuck with this VI that's supposed let the user set the frecuency and volume of an audio file, and play it. I managed to get the frecuency part working with Play Waveform, but that doesn't let the volume be modified (or the playback to be s
-
Hi experts, the settings are done in sender JDBC channel is done as: Poll Interval: 1800 secs Availability Time: Daily: At 5:00:00 AM for 30 Minutes according to logic, the channel start polling at 5:00:00 and stop at 5:30:00. After that It will not
-
1) Can we declare the variables in the script ? 2)I have two variables in the driver program. Depending on the conditions, i want to perform some arithmatic operations like Addition or subtraction in the script. How to do that ?
-
Need some help in fixed WLAN in my N81
Hi All, I have an N81. When i connect to WLAN, it is getting configured. But when I try to access the internet through that WLAN accesspoint, i get an error message "Connection not available" i am sure the WLAN is working fine, as WLAN is from my ro