ActionScript 3.0 :: Passing Buttons Names To External .as File?

Jun 5, 2011

I am working on a project where I have on the stage 8 movie clips, and when hovered, they are to shake. I have made this into a class, and placed the code as an external .as file.

Each movie clip is named shaker_mc - shaker_mc7

I have also gone in and changed all of the button movie clips base classes to ShakeButton.

Right now I am getting a couple of errors, and I believe all i need to do is pass the buttons names to the class in the external .as file, but I am not sure how to do that? I had everything working without the external script, but I did not want to have to create the effect for each button.

The erros are:

1120: Access of undefined property shaker_mc.

Here is my code for the ShakeButton.as file

ActionScript Code:
package{ 
import flash.display.Sprite; 
import flash.events.MouseEvent; 

[Code]......

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Passing Dynamic File With Different Names To SWC Object?

Nov 4, 2009

I have a flex application that reads from external XML file(URL loader) and displays graph. My xml file is dynamically generated using PHP and the filename=currentloggedin user name(i.e. username.xml).How should I load the xml into SWC? Will Flashvars work? I have a HTML page that has PHP code to get username and the same file embes the swc. How to pass the PHP varibale to my SWC?

View 0 Replies

ActionScript 2.0 :: Pass URL String From External File To AS Variable (dynamic File Names)

Nov 17, 2004

I have a movie player that works fine when i hard-code the url value in the video function, but when i try to pass that url/file path from an external file, the video doesn't load. I suspect that there is something i'm doing wrong with the quotes. What am i doing wrong?

[Code]...

View 5 Replies

ActionScript 3.0 :: Have An External XML File Which Holds A List Of Names?

Dec 5, 2011

I've done some googling for the past hour, but I can't seem to find what I need.Maybe I'm overlooking something.I want a very simple, basic thing. But I have no clue how to do this.I have an external XML file which holds a list of names.I want these names to be pushed/added to an array so I can access it based on it's position in the array. (A for loop is used to read a different XML file and the child[i] is named after the same array spot, childName[i]

View 10 Replies

ActionScript 2.0 :: Passing Parameter To .exe File (external)

Apr 18, 2004

I have a .exe file (it is a player) i need to pass a parameter to this player so it could play a specific file ( the parameter is the name of this specific file ).

now what i do in windows is

Start>run ( <full-path-to-.exe-file><space><parameter> )

now that works perfictly on windows.

what i need is to be able to start this application ( the player ) and pass the parameter to it, all through a flash button (from the flash player )

View 3 Replies

ActionScript 3.0 :: Loading An External Swf File And Passing It Some Variables

Oct 30, 2010

I'am trying to load an external swf file and passing it some variables. He is my code:

[Code]...

When i load a simple swf, it work fine, but when i try to give him some variable it does not work anymore.(i'am also muting sound)

View 1 Replies

ActionScript 2.0 :: Passing Variable From External .txt File To Field Name

Jan 19, 2008

probably a hugely embarrassing beginner question, but I can't seem to find an answer anywhere. I think it's probably (hopefully?) just a syntax problem I'm loading the content of a dynamic text box from an external .txt file and I'm trying to find a way to change the content from a link in the .txt file (if that makes sense). The code I'm using to change the dynamic text box at the moment is:

[Code]...

View 1 Replies

ActionScript 2.0 :: Load Variable Data From An External XML File And Dynamically Displays The Item Names In A Menu - Arrays - Functions

May 18, 2005

I have been working on a Flash movie that loads variable data from an external XML file and dynamically displays the item names in a menu which may then be clicked to display other dynamically-loaded content that corresponds to the menu item that was clicked. I have now come to a standstill in the project as there is something I'd like to achieve but simply cannot work out how. This is my first attempt at working with XML in Flash and one of my early attempts at using variables. What I'm trying to achieve is; once the user has viewed the item's content, they can simply click "next" and "previous" buttons to display all of the content for the next or previous items in the XML document.

I know it probably sounds simple and I'm sure some of you could achieve this in 5 minutes (!) but I can't get my head around some of the coding. I assume previousSibling and nextSibling would come into play here as well as some sort of functions which access arrays of data for the previous and next items, but I'm just not sure how to correctly put these things to use. Rather than post my code and example images of the stage up here on the forums, I've created an html page here: [URL]

View 2 Replies

ActionScript 2.0 :: Passing Instance Names Into An Array

Jun 30, 2010

How do you pass instance names into arrays? I've got a bunch of movieClips of states.

They all have instance names.. alabama, arkansas, delaware, florida, georiga, etc..

I am trying to send them all to an array because I need to be able to disable the movieClips all at once and I don't want to call each one separately. I setup an array and a "for" loop, and it properly gets each value in the array:

ActionScript Code:
states = new Array(alabama, arkansas, delware, florida, georgia);
stateslength = states.length;

[Code].....

View 9 Replies

ActionScript 2.0 :: Passing Variable Names As Arguments For Functions?

Sep 24, 2008

Is it possible to pass variable as arguments for a function? I wish to update a boolean variable via a function, by passing the name of the variable to the function, like so:

Code:
function ENVSegment(curSegment:Boolean, nextSegment:Boolean) {
curSegment = false;
nextSegment = true;
} var attackSegmentIsRunning:Boolean = false;
var releaseSegmentIsRunning:Boolean = false;
[Code] .....

Much shorter, and easier to understand. Also, less repetition of the same blocks of code over and over...

View 1 Replies

IDE :: Passing Instance Names To A Function Turns Up Error Message?

Feb 24, 2010

I made this function,that is supposed to create a bunch of slides based on a parameter. That parameter should be the instance name:

Code:

function createSlide(instName:Object){
trace(instName);
this.createEmptyMovieClip(instName, this.getNextHighestDepth());[code]....

In the script I call the function with

Code:
createSlide("mySlide");

After execution, this error message appears: Error: A 'with' action failed because the specified object did not exist.The trace statement returns the instance name -"mySlide"- When I replace instName with a stringtype name like "mySlide", it works fine.But I don't want that 'cause in that case I have to write a specific function for each slide.

View 2 Replies

ActionScript 3.0 :: Buttons Using External AS3 File?

Jan 20, 2010

ive been trying to get some buttons to load into my main movie called rules.swf using an external actionscript file. Ive got the buttons to load into the movie but now i cant get the buttons to load a new movie,Heres part of my code

package{
import durationSymbol;
import exit2Symbol;[code]......

View 0 Replies

ActionScript 2.0 :: Buttons Within The External Swf File Do Not Work?

Jan 16, 2009

I built a flash site. The site's navigation is an external swf file. The file loads fine. However, the buttons within the external swf file do not work. I have a simple goto webapage behavior attached to each of them.

I'm assuming it has something to do with paths. I do not know what the proper code is in order to make a button inside an external swf file change the web page.

View 5 Replies

ActionScript 3.0 :: Loading Buttons In MovieClip As External SWF File

Jun 27, 2009

I am working on a website, its a project, I built custom buttons and used there own AS3 to make them play on hover. There is one problem thou, in my main scene or timeline I created this function:

about_but.addEventListener(MouseEvent.CLICK, function(){
var aboutURL:URLRequest = new URLRequest("about.swf");
})
contact_but.addEventListener(MouseEvent.CLICK, function(){
var contactURL:URLRequest = new URLRequest("contact.swf");
})
cat_but.addEventListener(MouseEvent.CLICK, function(){
var galleryURL:URLRequest = new URLRequest("catalogue.swf");
})
port_but.addEventListener(MouseEvent.CLICK, function(){
var portURL:URLRequest = new URLRequest("port.swf");
})

Ok but it had the navigatetoURL function but I took it out. Reason is because I want these buttons to load in a movieclip (mc_loader) as external swf files. I am not sure as is to linking these buttons to the loader movieclip.

View 9 Replies

Can't Set Different Names For Buttons

Nov 20, 2011

When I add two or more the same buttons and changing the name of one, the name of the others also changes. How to set different names to each button? I tried creating buttons by copying, duplicating and nothing...

View 6 Replies

ActionScript 2.0 :: Loading Named Buttons Onto Stage With Coordinates From An External File

Jan 15, 2005

i have 20 buttons, and i want to design an external file that holds the coordinates for each named button.

how would i go about this, since the external file would be read as a string by flash?

View 3 Replies

ActionScript 2.0 :: Loading Named Buttons Onto Stage With Coordinates From An External File?

Jan 15, 2005

i have 20 buttons, and i want to design an external file that holds the coordinates for each named button.how would i go about this, since the external file would be read as a string by flash?

View 3 Replies

Change The Names And The Hyperlinks Of The Buttons?

Nov 12, 2009

[URL]

how to change the names and the hyperlinks of the buttons given in this file...

View 1 Replies

Actionscript 3.0 :: Give Names/attributes To Buttons?

Aug 8, 2009

I have an XML-file.I want to base an menu on my website om this information.Let us say that I have info in the XML-file with the names "About Me", "Articles" and "Video".Then I want three buttons with the text above on them. This is successfully done.The problem is, that I don't know what button I am pressing. To go to the nest page I need to know what button I am pressing.

I've tryed the following:

Code: Select allprivate function buildMenu():void
{
for (var i:int = 0; i < menuArray.length; i++)
{

[code]....

The result is that all the buttons get the name of the last entry in the XML-file. In the case above all the buttons would get the name "Video".

View 4 Replies

Flex :: How To Assign Auto Incremented ID Names To Buttons

Mar 25, 2011

I am amateur in flex, and started my final year project in flex to learn it, I am stuck in place where I have to create rows of drop down lists when the user pressed add more, E.g.: like the ones in mail attachments. I think I have found a way to generate rows, I am not even sure whether it is a correct way, how I generate the rows:

<mx:states>
<mx:State name="newRow">
<mx:AddChild relativeTo="{cityDropdown}">
<s:DropDownList id="newbutton" creationComplete="hotelDropdown_creationCompleteHandler(event)" labelField="Name">
<s:AsyncListView list="{getAllHotelResult.lastResult}"/>
</s:DropDownList>
</mx:AddChild>
</mx:State>
</mx:states>

Now when I generate more rows the dropdownlist ids will conflict, so I want to know a way to generate ids, I think I cant even call a function in there.

View 2 Replies

ActionScript 3.0 :: Dynamically Create Buttons And Assign Them Names To Use Later

May 11, 2010

How to dynamically create buttons and assign them names to use later on in the code.? For example:

ActionScript Code:
If(a==3) {
create three buttons:

[Code]...

And then assign some functions for these buttons - like:

ActionScript Code:
but1.addEventListener.....

View 9 Replies

ActionScript 3.0 :: Add Instance Names Of Buttons To Array / Add To Event Listener?

Jul 12, 2011

I was wondering if I had say 10 buttons and I wanted to add them to one event listener, is there a way to set up an array and attach them all to one event listener to cut down on code?

View 1 Replies

ActionScript 3.0 :: Losing Scope - Changing Both The Buttons And Mc Instance Names To No Avail?

Oct 23, 2008

I have a mc with simple btns inside. the mc is on every frame except one,in which I swapped a similar mc (different colors).I have tried leaving the instance name for the mc the same and also changing the instance name to something else but anytime I navigate to that frame, the buttons quit working.I have tried changing both the buttons and mc instance names to no avail.This is on my main timeline:

CrclMnTp_mc.CAbout_btn.addEventListener(MouseEvent.CLICK,
AboutNav, false,0,true);
CrclMnTp_mc.CSamples_btn.addEventListener(MouseEvent.CLICK,[code].....

View 3 Replies

ActionScript 3.0 :: External Swf Loses All Instance Names?

Aug 10, 2009

I load an external swf with some buttons into another swf.Now the buttons have lost their original instance names. A trace reveals their new names to be "button1", "button2", etcetera. If I run the external swf on its own, the same trace displays the original instance names.

View 7 Replies

ActionScript 2.0 :: "Target Not Found" - Building Stacks Of Buttons Dynamically Then Labeling Them From An External Text File

Dec 2, 2008

So I'm trying to get cute again by building stacks of buttons dynamically, then labeling them from an external text file. The code I have so far is as follows:

[Code]...

But I keep getting the error message: Target not found: Target="undefined" Base="_level0" I'm not sure what this means.

View 3 Replies

ActionScript 2.0 :: Duplicating Buttons Passing URL?

Dec 21, 2011

I want to display photos and load them dynamically.What I have is pretty basic .[URL]I have this much done and normally I would just manually add the URL to each button (boring and tedious) and I am learning to import variables and images and all of that...I want to be able to click the thumb to see the actual image:

Main Stage:

code:

onClipEvent(load){
_xscale=1000;
_yscale=1000;

[code]...

my problem is that I want to pass a value to the button based on 'i'

code: _root.mc_picGroup.mc_picGroupA["btnPic"+i].strURL = i;

Then the image name would be 0.jpg,1.jpg,2.jpg etc...I was displaying the images based on an MC

_root.mc_picGroup.mc_picGroupA["mc_picHolder"+i].gotoAndStop(i);

That worked but I thought it would be easier to place it in the button.(That didn't work...) I will just use the image mc but my real roblem is passing the value to the button.

code:

on (release){
getURL(strURL+".jpg","_blank");
trace(this._name);
}

returns "mc_picGroupA" instead of the button I am clicking.I know its ugly, but I just thought it would be a cool way to display some photos.[URL]

View 2 Replies

New AS File Won't Recognize Instance Names

Jul 15, 2009

I get the error "Access of undefined property menu_bar" when menu_bar is an instance name directly on the main timeline. I'm not sure how I would call it in the other class. It also isn't exported for actionscript is that the problem?

I have it imported to my document class as:

var mouseClicks:MouseClicks = new MouseClicks();
addChild(mouseClicks);

Then the class looks like this:

Code:
package{
import flash.display.MovieClip;
import flash.events.*;

[Code]....

View 2 Replies

ActionScript 2.0 :: Create A Loop That Will Put A List Of Names From External Sources Into A Number Of Arrays?

Jul 3, 2006

i am trying to create a loop that will put a list of names from external sources into a number of Arrays .so what i did is :

Code:
for (i=0; i<4; i++) {
this["loadVarsText"+i] = new LoadVars();
this["loadVarsText"+i].onLoad = function(success) {

[code].....

and i dont understand why it is not working, and how can i fix it?

View 3 Replies

ActionScript 2.0 :: Buttons Lose Focus Passing Data

Jun 7, 2006

Very strange. I'm using the following function to pass characters to 2 text input components, but sometimes (and much more often with the "Password" field), after I click a button, the button loses focus and I have to move the mouse to regain the rollover state and be able to click the button again. When I've lost focus, if I click the mouse, it just changes the button to the rollover state but doesn't pass the value...

Here's the code:
var Focus:String = "";
function KeyPadButtonClick(_id:Number) {
// default the focus to the UserID
if (this.Focus == "") {
this.Focus = "UserID";
[Code] .....

View 3 Replies

ActionScript 3.0 :: Calling File Names From An XML Document

Aug 12, 2009

I've calling file names from an XML document, for example: <file>thisGraphicab.swf</file> Then when I call the graphic, the graphic with the matching file name does not exist, but similar named files do exist. For example: thisGraphicab does not exist but thisGraphicbb does exist. Flash will load the thisGraphicbb.swf file in place of the file actually called.

Is there a way to remedy this? I want flash to fail when the file requested does not exist. When you type the name graphics/thisGraphicab.swf into the browser address bar, the file name is changed by the browser to be thisGraphicbb.swf, and it displays, but here again I need it to fail when something like this happens. I know this seems odd, but there's more to it in the end. Anyway, this is what I need to take care of now.

View 6 Replies







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