ActionScript 2.0 :: AttachMovie ObjName Outside Of Function?

Jul 10, 2008

I am currently developing an interactive location map of the UK for a client. Every region of the map is a button that, when click, zooms in towards the viewer whilst all the others fade in the background.This i can do fine with a single function. However the movieClip that is loaded with attachMovie contains buttons that I simply cannot target for any other function. I believe it is something to do with the attachMovie ObjName not being accessible outside of the function they're created in. I have been trying _global variables but still I cannot assign actions to the buttons.

when I click any of the buttons in the attachMovie I at least get a trace function to work.I have attached my complete actionscript but the section I'm struggling with is displayed below.

Code:
//zoom in
function focus (target_mc:MovieClip, scale_mc:Number, sec:Number, target_x:Number, target_y:Number, focus_mc:String) {[code]......

View 2 Replies


Similar Posts:


HitTest Function Not Working With Attachmovie?

Oct 5, 2009

I can't seem to get the hitTest to work for my script shown below. I have tested using movieclips created on stage during design time and made to collide during run-time. hitTest works fine in this situation.
 
But if I use the attachmovie command and create a movie on stage during run-time, that clip cannot hitTest with other movieclips. The hitTest simply doesn't work.

The script below is basically, to create instances of enemymc, and it will fall vertically, hitting a movieclip target_mc which is placed during design-time.

var enemyTime:Number = 0;
var enemyLimit:Number = 20;
onEnterFrame = function()
{

[Code].....

View 3 Replies

ActionScript 2.0 :: Calling Function From AttachMovie?

Aug 4, 2005

I have a button and when you press it it attaches a MC and calls a other function called showProductInfo().

Code:

_root["pod"+i].sub.pinfo.onRelease = function(){
_root.attachMovie("popup", "popuper", i);
_root.popuper.showInfo(i);
}

And in the popop/popuper MC I have the function showInfo(id) in the first frame. But I can't get it to work.

Code:
function showInfo(id){
this.txt.text = id;
}

View 8 Replies

ActionScript 2.0 :: SetInterval On Attachmovie Function With X And Y Loc?

Apr 28, 2008

I have a function on my script that attaches a movieclip on a specific position and then it duplicates it several times. This movieclip has a code in order to move across the stage randomly. When I try to use SetInterval to repeat this function two weird things happen: the movieclips don't duplicate over that specific location (they appear on x=0,y=0) and if I set the location only one duplicates and the rest don't. My question is: what can I do to repeat the function every 2 seconds exactly as it is the first time it runs, without the objects not duplicating or moving from the original location?

Here's the code:
meteoros = function () {
this.attachMovie("asteroid","asteroid_mc",this.get NextHighestDepth());

[code].....

View 2 Replies

ActionScript 2.0 :: Function For AttachMovie With Switch/Case?

Aug 4, 2011

I have multiple movieclips (ml1, ml2, ml3 and ml4) to which I attach various clips out of the library to. Each movieclip uses a switch statemtent then attaches the appropriate movieclip from the library... so I got thinking, why can't I do a function rather than all this scripting? And I must have had a really long weekend because whatever I try just isn't working. Here's my code at the moment....

Code:
switch (supp1) {
case "bu" :

[code].....

View 2 Replies

ActionScript 2.0 :: AttachMovie Function Not Working - Omitting Labels

Feb 10, 2009

The lineholder code below draws tickers on an axis for every 12th data point. It should also attach a year label every 12th data point. For this I have tried to use attachMovie. I've used it before and it's worked fine, but this code draws the line and omits the label (gives no error).

Code:
for (var a:Number = startPoint; a<_root.dataPoints[0].length; a++) {
if (b==12) {
//should attach date label
var myYear:MovieClip = _root.attachMovie("mc_dateLabel","mc_"+a,_root.getNextHighestDepth(),{_x:500, _y:300});
[Code] .....

View 1 Replies

ActionScript 2.0 :: XML + AttachMovie - Make All Of Instances Fade Out With A Function

May 15, 2008

I'm making a gallery using XML data and loading the information into a mc instance that are in turn being attached to the stage via linkage id. My question is this: I need to make all of those instances fade out with a function, and I have created a for loop to do this, however it is not working.. Any suggestions on how to make it work?

[Code]...

View 2 Replies

ActionScript 2.0 :: Make A Button Made With AttachMovie Function As A Button?

Sep 6, 2011

I created a button using the following code,

Code:
on(release) {
attachMovie ("my_btn", "my_btn", _root.getNextHighestDepth(),{_x:34, _y:158});
}

Now I am trying to make the button gotoAndStop on a scene on release. I tried this code,

Code:
onEnterFrame
my_btn.onRelease = function() {
gotoAndStop ("SettingsPanel")
}

View 9 Replies

AS2 - Target An AttachMovie Mc?

May 14, 2009

Through attachMovie I have loaded an mc from the library onto the stage into "holder_mc".

myButton.onRelease = function () {
if (currentWork != "holder_mc.myWork1_mc") {
holder_mc.attachMovie("myWork_mc","myWork1_mc", getNextHighestDepth());
currentWork = "holder_mc.myWork1_mc";
}
}

This works.

However, there are a couple of buttons (mc) inside "myWork1_mc" which skips through a few slides in the myWork1_mc clip that I cannot target. I thought using:

holder_mc.myWork1_mc.buttonName_mc.onRelease = function () {
trace("MC_pressed");
}

... would work. My curser doesn't even change to the hand symbol. How do I target an dymanically loaded MC from the library which is inside an empty holder MC on the stage via attachMovie? What am i missing? Believe me, I have spent hours trying to google it.

Note: at this stage there is no other script on "holder_mc", but there will be at a later date, but I'll cross that bridge when I get to it. Also, the buttons work when I place the MC onto the stage and not use attachMovie.

View 6 Replies

IDE :: Variables With AttachMovie?

Oct 3, 2009

i was wondering if it is possible to use attachMovie with variables using flashvars from html. im kind of new to AS and would like to know if anyone could help me out here

i need to make a single SWF in wich some movieclips can be replaced by others through the html code without editing the swf file.

i already know how to enter the variables on the html, but i dont know how to apply this to attachmovie command in the flash file.

View 3 Replies

IDE :: Add Code To AttachMovie?

Dec 23, 2009

So a clip is attached to a clip, and that works fine, but how do I get code on to the attached clip? I've tried duplicateMovieClip...but it's not working...

View 1 Replies

Flash :: Delegate Function (Function).toString() Prints Function Function() {}?

Nov 1, 2010

I've got a Vector of ViewToActionMap objects, which have following constructor:

public function ViewToActionMap(_forModule:eModule,
_forAction:eViewAction,
_toFunction:Function,

[code].....

View 1 Replies

ActionScript 2.0 :: CS3 MC AttachMovie In Scrollpane

Oct 8, 2009

for (i=0; i<policy.length; i++) {
newOpt = Stocklist_MC.attachMovie('Option', 'Option'+i, i);

I've got a ScrollPane on the root stage. This loads a MC called 'Stocklist_MC' (this also has a linkage/export name of 'Stocklist_MC'). When I try to use '.attachMovie' to the movieclip (Stocklist_MC) inside the ScrollPane nothing appears. All the AS is on frame 1 of root. Everything works when I use '.attachMovie' with _root. for (i=0; i<policy.length; i++) { newOpt = _root.attachMovie('Option', 'Option'+i, i); Also, if I drag Stocklist_MC to the stage I get everything working but list gets cut off at bottom, which is the reason why I need it in a scrollPane.

View 1 Replies

ActionScript 2.0 :: AttachMovie Is Not Working?

Aug 11, 2010

the traces get triggered, which means so should the attachMovies, but nothing else seems to happen?[code]

View 3 Replies

ActionScript 2.0 :: AttachMovie Not Working The On Web?

Aug 24, 2010

I've been battling this project, and finally got it all wrapped up and working, and was feeling pretty proud of myself, and then I went and posted the exact same .swf on the web and it doesn't work anymore.Specifically, there are a bunch of icons which are placed into the FloorMC which then attachMovie a copy of themselves into a LegendMC and UtilityRefMC, but they dont seem to be attaching anything when I run it through a browser.[URL](I'd love to attach the swf and fla to this message, so you could take a look at those, but apparently that would be crazy.) thought perhaps it had to do with me using _root, but I went through and changed them all out to _globals and _parents and it still no likey. Furthermore the Comment Box in the bottom left gets triggered by _root commands form all sorts of different levels, and it seems to work fine, both on the web and off.

View 6 Replies

Use A Variable Within An AttachMovie Statement?

Sep 11, 2009

What I'm trying to do is simply this:
 
<variable> = mvcShip
var ship1 = _root.attachMovie( <variable>, shipName + _root.getNextHighestDepth(), _root.getNextHighestDepth() );
 
What i am trying to attempt here is to make the variable equal to the name of an item in my library. (Im using this to use different ships in an old arcade-style vertical shooter).  This is meant to make a ship appear on stage.
 
When <variable> is replaced with a library item (eg. mvcShip), it works fine, but if the variable is in place, i get a trace value of ship1 as "undefined", and the ship doesnt show up on the stage.

View 9 Replies

ActionScript 1/2 :: Attachmovie Not Working?

Jul 20, 2010

BTN_2.onRelease = function() {  gotoAndStop("ans2");  Comments_txt2.text = title[2].comments[0].nodeValue;  toolName_txt2.text = "Tool Name: " + title[2].hidden[0].nodeValue;  mclip.loadClip(title[2].image[0].nodeValue,

[code]....

View 3 Replies

ActionScript 2.0 :: AttachMovie On Flash CS4?

Jan 22, 2010

I am using this simple line:

ph_out.attachMovie(ensembles,ensenbles1,1);

where "ph_out" is an mc that receives the movie"ensembles" is an mc that I want to load in ph_out and it has as linkage name: "ensembles"

View 2 Replies

ActionScript 2.0 :: Looping & AttachMovie?

Mar 26, 2010

I have a linked movieClip in my library with the identifier "arrow" i want to run a for loop and attach this clip to movie clips on my stage named blank0 blank1 blakn2 and so on.

[Code]...

View 1 Replies

ActionScript 2.0 :: For Loop - AttachMovie And XML

Mar 3, 2011

I am trying to create a pair of custom drop down menus (one for states, and then one for each states counties). I have an XML doc that contains all this info, which I am parsing out into an array(sc). What I would like to happen is when the user rolls over the states drop down arrow(stDropArrow_mc) that I run a for loop which attaches some movie clips to a states movie clip already on stage(states_mc), fills in the state name in a display text field(display_txt) within the attached movie, within the "states_mc" on stage(root timeline). so essentially(states_mc."NEW ATTACHED MOVIE CLIP NAME".display_txt.text) Here is a code sample that I am using...

[Code]...

View 1 Replies

ActionScript 2.0 :: AttachMovie On Da Roots

Nov 14, 2003

When you attach a movieclip taken from the symbol library to the Stage, by using the attachMovie function and its Linkage name, do you have to - previously - place a dummy instance of the mc anywhere on that Stage to get it works ?

View 5 Replies

ActionScript 2.0 :: AttachMovie External Swf?

Apr 17, 2005

I am trying to revise the very first flash project I ever did and it's become a complicated mess. I have created an interactive atlas. I am using my favorite map zooming and panning tools supplied by Senocular which can be found here: http:[url].....For the panning/zooming/drawBox tool to work the map features must be buried deep within several movieclips. There is one level at which you can put buttons that aren't effected by the code for the panning/zooming etc. Buttons have to go on this level or higher if you want them to work.

The way my atlas is set up - there is a main interface that has these tools plus the menu system. The menu (xml; created by Lost and Sen - brilliant, thank you) loads in two external swfs - one is the map itself and the other is a set of "controls" for that particular map (radio buttons, check boxes, text links, etc.).I have a couple of external swfs that have buttons on them that do things when you roll over and off them. If I have these buttons sitting on the map then when it gets loaded into the main interface they no longer work. So I am trying to use attachMovie to attach them to an MC within the zooming tools in the main interface at a level they can be active.But it's not working.I am guessing it's because the code to attach them is being fired before the external can be loaded into the interface. So I'm not really sure where to fire the attachMovie code. Does it go with the external? Does it go with the controls for the external?

I can supply code if needed though like I said, this file is a mess. There are 15 external maps with 15 "control" files. Plus the main interface, plus some other miscellaneous files.

View 10 Replies

ActionScript 2.0 :: Delaying With AttachMovie?

Aug 13, 2005

I have a loop and in it i am attaching a movie clip (basiccly its just a row with data). The movieclip has a alpha fade in it. Now I want to delay each attachmovie function so that the movies are attached one by one rather then trow them all on the screen at once. (plus it looks better with the alpha fade).

I tried the setInterval but it wont work (ex.:Interval is 1 sec, and if im going to attach 6 MC, flash wait 6 * 1 sec, then show them all)

And is it possible to attach a movieclip inside a othermovieclip thats not on the same frame (the other MC is on frame 10)?

View 1 Replies

ActionScript 2.0 :: For Loops And AttachMovie

Apr 9, 2006

I want to attach a MC dynamically so that I have 12 rows and 12 columns of _mc box on the main stage:[code]I think it can be done only with a nested loop but so far, well, my head's in a loop!

View 11 Replies

ActionScript 2.0 :: Attachmovie() To Loadmovie()?

Jun 21, 2006

ode:
_root.curenemno=1;
_root.curenem=[["clam",5]];

Then when as a current temporary sort of arrangement i attached this using the attachmovie function:

Code:
_global.enemies = _root.curenem;
_global.enDataArray = [[]];
popped = _global.enDataArray.pop();[code]....

View 1 Replies

ActionScript 2.0 :: InitObject With AttachMovie()?

Jul 21, 2006

I want to attach a preloader to the main stage of my site to load in external JPEGS and SWF's and to do this I need to pass certain parameters to my preloader, such as the preloaders width and height. How do I make use of the initObject parameter for attachMovie()? I know I need to either define a constructor or somehow access the current movieClip's constructor, but I have no want to create a custom class for my preloader movieclip, I just want to be able to get certain information when I attach the preloader. Do I really need to create a custom class that inherits from movieClip?

View 3 Replies

ActionScript 2.0 :: AttachMovie With Duplicated MC

Sep 26, 2006

Is there a way to link duplicated movieclips to the library? Because I need to attach these duplicated mc's to an other mc. So my problem is that I don't have a linkage identifier?

View 8 Replies

ActionScript 2.0 :: Referencing A MC From AttachMovie

Mar 23, 2007

I'm confused as to how to reference a movieclip after using the attachMovie method. Here is my code:

[Code]...

View 1 Replies

ActionScript 2.0 :: Alternative To AttachMovie??

Apr 16, 2007

Is there an alternative to attachMovie that I can use to put my movieclips on to the stage. Here is my problem, I have 2 frames total in my fla file, and in each frame I have buttons that when you click on them it attaches the corresponding image from the library. Problem is when you click to go to the next frame, the attached image stays.

I basically want it to stay attached only until you hit the next frame.

View 4 Replies

ActionScript 2.0 :: AttachMovie Then Drag It?

May 1, 2007

I'm new to attachMovie and have a question (or 2).I have a button that when pressed, will load a movie that I can then drag around.here's the actionscript on my button ("FFC_frame" is the name and Identifier name of the movie clip I'm loading, FFC_frame2 I think is the new movie it actually loads, then i have a startDrag that works fine, and a stopDrag that doesn't work at all):

on (release) {
attachMovie("FFC_frame", "FFC_frame2", 1);
FFC_frame2._x = 100;

[code]....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved