Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Why The Thumbnail Urls Are Being Assigned Correctly But Everything Else Is Not



Hi

I have a problem with a script which has been bugging me for days now. I have cobbled together a script below from various tutorials to adapt it to my needs, which displays a thumbnail bar of images using xml. The xml has several attributes which tells the action script what to do if an image is clicked. Everything loads ok and works as expected except... The thumbs load in from the for loop ok as they should the first traces display the loaded xml as it should be. However when I try to create the text fields for each indivdually created movie clip somewhere it is going wrong as all the text fields display the last childNodes attribute as opposed to attribute for each specifc node! This is also affect the onRelease function as it populates again with the last childnodes attribute. I have been pulling my hair out here and believe me I can't afford to be pulling out anymore! I can't understand why the thumbnail urls are being assigned correctly but everything else is not. Any help appreciated.


ActionScript Code:
import mx.transitions.Tween;import mx.transitions.easing.*;var my_fmt:TextFormat = new TextFormat(); my_fmt.font = "Myriad Pro";my_fmt.size = 15;my_fmt.color = 0x333333;var myGalleryXML = new XML();myGalleryXML.ignoreWhite = true;myGalleryXML.load("navigation.xml");myGalleryXML.onLoad = function() {    _root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;    _root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;    _root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;    _root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;    _root.myImages = myGalleryXML.firstChild.childNodes;    _root.myImagesTotal = myImages.length;    _root.action = myImages.attributes.action;    _root.variables = myImages.attributes.variables;    _root.market = myImages.attributes.market;    _root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;    _root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;    _root.full_x = myGalleryXML.firstChild.attributes.full_x;    _root.full_y = myGalleryXML.firstChild.attributes.full_y;    _root.action = myGalleryXML.firstChild.attributes.action;        callThumbs();    createMask();    scrolling();};function callThumbs() {    _root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());    container_mc._x = _root.gallery_x;    container_mc._y = _root.gallery_y;    var clipLoader = new MovieClipLoader();    var preloader = new Object();    clipLoader.addListener(preloader);        var fir = 5;    for (i=0; i<myImagesTotal; i++) {        thumbURL = myImages[i].attributes.thumb_url;        thumtxt = myImages[i].attributes.market;        action = myImages[i].attributes.action;        variables = myImages[i].attributes.variables;        myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth());        myThumb_mc._xscale = 99;        myThumb_mc._yscale = 99;        if(fir==5) {            myThumb_mc._x = (_root.thumb_width*i)+fir;        } else {            myThumb_mc._x = (_root.thumb_width*i)+5;        }        fir = 0;        myThumb_mc._y = 5;                trace(thumbURL);        trace(thumtxt);        trace(action);        trace(variables);                clipLoader.loadClip("images/"+thumbURL,myThumb_mc);        preloader.onLoadStart = function(target) {            target.createTextField("load_txt",target.getNextHighestDepth,45,30,100,20);            target.load_txt.selectable = false;        };        preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {            target.load_txt.text = Math.floor((loadedBytes/totalBytes)*100)+"%";            target.load_txt.setTextFormat(_root.my_fmt);        };        preloader.onLoadComplete = function(target) {            target.load_txt.removeTextField();            new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);            target.createTextField("my_txt",getNextHighestDepth(),4,83,100,20);            target.my_txt.selectable = false;            target.my_txt.text = thumtxt;            trace(target.my_txt.text);                        target.onRelease = function() {                trace(action);                trace(variables);                Actions[action](variables);            };            target.onRollOver = function() {                this.origDepth = this.getDepth();                this.origX = this._x;                this.origY = this._y;                this.swapDepths(this._parent.getNextHighestDepth());                // try and center the current movie clip on the Stage.                this._x = (this._x)-5;                this._y = (this._y)-5;                this._xscale = 109;                this._yscale = 109;            };            target.onRollOut = function() {                this._level.getNextHighestDepth();                this._xscale = 99;                this._yscale = 99;                this._x = this.origX;                this._y = this.origY;            };        };            }}function callFullImage(myNumber) {    myTitle = myImages[myNumber].attributes.title;    myThumb_mc.createTextField("my_txt",myThumb_mc.getNextHighestDepth,4,83,100,20);    myThumb_mc.my_txt.selectable = false;    myThumb_mc.my_txt.text = myTitle;    myThumb_mc.my_txt.setTextFormat(_root.my_fmt);}function createMask() {    _root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());    mask_mc._x = _root.gallery_x;    mask_mc._y = _root.gallery_y;        mask_mc.beginFill(0x000000,100);    mask_mc.lineTo(_root.gallery_width,0);    mask_mc.lineTo(_root.gallery_width,_root.gallery_height);    mask_mc.lineTo(0,_root.gallery_height);    mask_mc.lineTo(0,0);    container_mc.setMask(mask_mc);}function scrolling() {    _root.onEnterFrame = function() {        container_mc._x += Math.cos(((mask_mc._xmouse)/mask_mc._width)*Math.PI)*10;        if (container_mc._x>mask_mc._x) {            container_mc._x = mask_mc._x;        }        if (container_mc._x<(mask_mc._x-(container_mc._width-mask_mc._width))) {            container_mc._x = mask_mc._x-(container_mc._width-mask_mc._width);        }    };    }Actions = Object();Actions.gotoURL = function(urlVar){    getURL(urlVar, "_blank");};



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-15-2008, 03:43 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Variable Assigned To Label?
Can I assign a variable to a label? It's not working for me. Is there another way.

I have 10 frames on the root, and a stop on 5. I want the button to assign a variable and the play to frame 10 where frame 10 will tell it to go to that variable. It's not working, here is my code.

Button:

on (release) {
whereNext = "dictate";
play();
}



Frame 10:

gotoAndPlay(dictate);




Also.. when I put "play" in, everytime I hit the button it plays through the movie, not even looking at the variable call.

Dynamically Assigned Variables
Baesd on the the code below, for a popup window on a button click

on (release) {
getURL("javascript: void window.open('http://www.website.com/index.htm', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=500,height=250,left=312,t op=100');");
}

Id like to replace the path for 'http://www.website.com/index.htm' with the variable 'popUp',

and the window property code (the 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=500,height=250,left=312,t op=100')
with the variable 'windowProp'

I have both variables defined in an external XML doc, and successfully importing into the swf.

The variables are defined with the appropriate formatting for thier use, so that the 'popUp' variable returns an formatted absolute URL, and 'windowProp' variable returns a string like ''toolbar=0,scrollbars=0,location=0,statusbar=0,me nubar=0,resizable=0,width=500,height=250,left=312, top=100'


so in pseudo actionscript, the code example from above would logically be something like:

on (release) {
getURL("javascript: void window.open('popUp', '', 'windowProp);");
}

the issue is that the varibles, even thought they are importing the correct data, dont work as intended with the event.

Can anybody have an idea for the correct syntax/form? Im not sure how to strip these items together

thnx for reading - Mike Halak

Dinamically Assigned Depths
This code works fine:

ActionScript Code:
depths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];for (var i = 0; i<depths.length; i++) {    _root.attachMovie("clip", "clip"+i, depths[i]);    _root["clip"+i]._x = 30*i;}


But when I try to change depths in a random way it doesen´t:

ActionScript Code:
depths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];depths2 = [];while (depths.length) {    depths2.push(depths.splice(Math.floor(Math.random()*depths.length), 1));}depths = depths2;for (var i = 0; i<depths.length; i++) {    _root.attachMovie("clip", "clip"+i, depths[i]);    _root["clip"+i]._x = 30*i;}


Instead of appearing the 10 clip appears only one.

Any hint?

Thanks.

Dynamically Assigned Mc Actions
I can't seem to assign the onRelease action to my duplicated mcs. Would someone please take a look at my file. Flash MX.

http://www.thadandrews.com/actionscr...licateTest.fla

Dinamically Assigned Depths
This code works fine:

ActionScript Code:
depths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];for (var i = 0; i<depths.length; i++) {    _root.attachMovie("clip", "clip"+i, depths[i]);    _root["clip"+i]._x = 30*i;}


But when I try to change depths in a random way it doesen´t:

ActionScript Code:
depths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];depths2 = [];while (depths.length) {    depths2.push(depths.splice(Math.floor(Math.random()*depths.length), 1));}depths = depths2;for (var i = 0; i<depths.length; i++) {    _root.attachMovie("clip", "clip"+i, depths[i]);    _root["clip"+i]._x = 30*i;}


Instead of appearing the 10 clip appears only one.

Any hint?

Thanks.

Dynamically Assigned Mc Actions
I can't seem to assign the onRelease action to my duplicated mcs. Would someone please take a look at my file. Flash MX.

http://www.thadandrews.com/actionscr...licateTest.fla

GodsOnly-FFbutton Assigned To Labels
I need to make a button that will forward through a list of frame labels in a movie on another level.

I am thinking that I can do somthing sequential(slide1,slide2,slide3) and do like a
_level1.gotoAnd Play"slide"+1
sort of thing but I am new at scripting and am not sure how to write it.

Changing The Variable Assigned To A TextField?
Hey everybody. I was hoping if someone could help me out with this. I have a textfield named "text1" that is assigned a variable. I need to change this variable at a certain point to something else. I'm using MX and I know that they have the command "TextField._variable", which assigns a textbox a certain variable.

What I did, I created a button instance and assigned it the action:


Code:
on (release) {
text1.TextField._variable = "Display";
}
However, this is not changing the variable to "Display". Anybody know what I'm doing wrong? I'm not all that good with actionscript so I prolly might have some simple error.

Preserving Variables Assigned To XML Node....
sawatdee khrup...

I have an XML node which i assigned some variables to...

XMLnode.firstChild.myObj = {stepX:50, stepY:32, etc.};
XMLnode.firstChild.status = 2;
XMLnode.firstChild.history = [0,0,3,2,1];

once i duplicate the node, the associated variables and objects are not duplicated....

is there a workaround for that?

can i just get all values assigned to an object without knowing them?

for (var i in XMLnode)
doesnt get all the variables....

enlightment
Pippo

Dynamic Actions Assigned To Movie
I'm trying to assign a dynamic action to a Movie but it does not seem that action is waiting to execute.

This is were the problem seems to be:


PHP Code:



function createButns() {
    classAmount = totalClasses;
    trace ("classAmount = " + classAmount);
    y = 0;
    spacing = 25;
            for (i=1; i <= classAmount; i++) {
                    _root.listBox.attachMovie("classButton", "classButton"+i, i);
                    var name = "classButton" + i;
                    trace (name);
                    _root.listBox[name]._y = y;
                    trace (y);
                    _root.listBox[name].classGroupName.text = classgroup[i];
                    trace (classgroup[i]);
                                        _root.listBox[name].onRelease = butnAction ();
                    y = i * spacing;
            }
    }

function butnAction () {
    currentNode = classGroupNode[i]
    trace ("currentNode = " + currentNode);
    loadMovie (classGroupNode[i].firstChild.attributes.jpegurl, _root.Display);
}




The code "_root.listbox[name].onRelease = butnAction ();" does not seem to be assigning to the button and executes as the code loops.

Thanks for any help. I have attached the FLA and all associated files just in case.

Flashtech2K

Problem With Hyperlink Assigned To .swf File
Hi,
I'm taking my first steps and I'm trying to embed a .swf file into a web page using FrontPage like this:

<p><a href="http://www.somepage.com" target="_blank"><embed width="224" height="60" src="my_swf_file.swf"></a></p>

Works fine except for the hyperlink I'm trying to assign to the .swf file.

The movie is playing and the hyperlink URL shows up in the bottom of the browser when I test it, but I can't CLICK the movie file to execute the hyperlink (the mouse pointer remains unchanged when I mouse over the file instead of turning into the "pointy finger"...geez, I'm such a newbie...)

What do I have to do to make this work? This should be an easy one...
Thanks!!
Axel.

LoadClip Mc Assigned Custom Class...
how does one assign a custom class to an _mc that was loaded via myMovieClipLoader.loadClip(...) ?

anything like how Object.registerClass("my_mc", CustomClass); is used for _mc's brought to stage via attachMovie()?

Thanks for any help.

Problem With Class Assigned To MovieClip
Hi,
the situation: I have an Mc "outerMc" and a class assigned to it "OuterClass". And i have another Mc "innerMc" nested inside the "outerMc" and another class "InnerClass" assigned to it.
I attachMovie("outerMc") to the time line, but i couldn't find out how to access anything in the InnerClass.

Any ideas how to solve this?
Thanks in advance.











Attach Code

class OuterClass extends MovieClip
{
private var innerMc:MovieClip; //can be :InnerClass or no type defined, still no result
public function OuterClass()
{
innerMc.sayFoo();// nothing
}
}

class InnerClass extends MovieClip
{
public function InnerClass()
{
trace("InnerClass created"); //OK
}

public function sayFoo()
{
trace("foo");
}
}

Class Not Working With Assigned Fla File
Hi All,

I am following a Moock tutorial; I have created a GreetingApp.as file and a GreetingApp.fla file; I have assigned GreetingApp in the Document class for GreetingApp.fla, but I get no errors but the swf is empty.

Both files are in the same folder. There is no spelling mistakes either. Anyone know why swf would be blank?

I have attached the code used in the GreetingApp.as file

Kind Regards,

Boxing Boom







Attach Code

Code used in GreetingApp.as file

package{
import flash.display.*;
import flash.text.TextField;

public class GreetingApp extends Sprite{
public function GreetingApp(){
// Create the Shape objectt
var rectAndCircle:Shape = new Shape();

// Set line thickness to one pixel
rectAndCircle.graphics.lineStyle(1);

// Draw a blue rectangle
rectAndCircle.graphics.beginFill(0xFF0000, 1);
rectAndCircle.graphics.drawRect(125, 0, 150, 75);

// Draw a red circle
rectAndCircle.graphics.beginFill(0xFF0000, 1);
rectAndCircle.graphics.drawCircle(50, 100, 50);

// Move the shape to the right 125 pixels and down 100 pixels
rectAndCircle.x = 125;
rectAndCircle.y = 100;

// Show rectAndCircle on screen by adding it to the display list
addChild(rectAndCircle);

// Create a TextField object to contain some text
var greeting_txt:TextField = new TextField();

//Specify the text to display
greening_txt.text = "Hello World";

// Position the text
greeting_txt.x = 200;
greeting_txt.y = 300;

// Show the text on screen by adding greeting_txt to the display list
addChild(greeting_txt);
}
}
}

Arrays Assigned Specific Links
I have an array that generates a list of words that have links to site/page. but for some reason the URLs are being assigned randomly and i need to them to be specific to each word. Any suggestions? thanks.


Code:
// que of fill requests
fillRequests = new Array();
var vernacular = "Breakthrough Democracy Afghan Style Dwell DesignSource EndresWare Microsoft Darwin Min Day Nolo Now Rob Craigie Personal Science Squid Lab Instructables";

//links for words
links = ["http://www.breakthroughcollaborative.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com"];

//array of words
wordList = new Array();
wordList = vernacular.split(" ");



// fill the page with words!
fillRegion(0,0,720,480);

this.onEnterFrame = function() {
// pull fill requests from que and execute
if (fillRequests.length>0) {
freq = fillRequests.pop();
fillRegion(freq.x0, freq.y0, freq.x1, freq.y1, freq.d);
}



}

function fillRegion(x0, y0, x1, y1, d) {
// pick one of the words and place
n = random(wordList.length);
word = wordList[n];
ahref = links[n];
trace(n+" "+ ahref + word)
// place the word object
nombre = "word"+String(depth++);
neo = this.attachMovie("mcWord", nombre, depth);
// set word
neo.setWord(word);
neo.fitInto(x0, y0, x1, y1, d);
}
function fillRegionRequest(x0, y0, x1, y1, d) {
// request has been made to recursively fill a region
// only allow if reasonable
rWidth = x1-x0;
rHeight = y1-y0;
if ((rWidth>2) && (rHeight>2)) {
addFillRequest(x0, y0, x1, y1, d+1);
//fillRegion(x0, y0, x1, y1, d+1);
}
}
function addFillRequest(x0, y0, x1, y1, d) {
// que up a request to fill a region
var freq = {x0:x0, y0:y0, x1:x1, y1:y1, d:d};
fillRequests.push(freq);
}

Attach A MC To An Object Assigned To Class By Name
I have created an Actionscript 2.0 class and using the convention:

ActionScript Code:
var someVar=new menuItem(blah blah blah);


I have great success, but when I try:


ActionScript Code:
var someVar:menuItem = new menuItem(blah blah blah);


and then look at my MovieExplorer tab, I have multiple sets of recursive elements. Why?

Also, when I drop a MovieClip from the library that has been assigned to the custom AS2.0 class that I have defined, is there any way for the class to find out the objects name if it was added manually to the timeline?

I have created these custom icons that have linkageID's related to the name of their parent clip. (i.e. biography.lbl) is a LinkageID for the biography icon. It works great when I use AS2.0 in the MovieClip to attach the new menuItem's MovieClip to the stage, but when I add it manually, I can't figure out how to make the class constructor or any method to look at the object's name and then attach a clip to itself based on its name?

Let me know if I have you completley lost. I can try to explain it another way, maybe. Thanks in advance for all of your help.

Rowdy

Xml Thumbnail Gallery - How To Leave Thumbnail Blank?
There was a thread a few days ago on how to leave the caption or description blank. If anyone knows could you explain how to leave the thumbnail and/or url blank for some and to show for others? Where if there is no information that flash can read a field that is undefined as ""?

FLV Video Thumbnail + Thumbnail Gallery With LinkIDs From XML
Let's say for instance, our XML file:
<videos>
<video linkid="AK0001" thumb="http://www.site.com/pathtofile/filename.flv">
<link>http://www.site.com/pathtofile/filename.flv</link>
</video>
</videos>

Is it possible to use the source flv file as the thumbnail? Or, is it better to create a thumbnail of all the content?

With this said, how would I create the event handler to satisfy when each thumbnail is clicked, it stores it's linkid in the $_GET variable?

Thank You,
b0gui

Tracks Assigned 2 Button & Stop And Play?
www.blusyde.com

I am trying to code buttons 1,2,3 and 4 to play music that i have attached to them. but for some reason they play at the same time and switch over to a different scene.

i want to stay on the main page. when listening. help?

or if there is a tutorial, i would also be interested in it.

Thanks

code:

on (release) {
stopAllSounds();
}
on (release) {
gotoAndPlay(5);
}

Variables/arrays Assigned As Instance Names?
Hi,

I am using Flash MX 2004 Professional. I have a question about using arrays and variables as instance names. Please review the code below:


Code:
// Please be sure to add the Button Component onto the stage then
// delete from the stage as we just need the Button Component
// in our library.

// Numerical variables
var myWpos = 146.9, myHpos = 22.0;
var myXpos = 14.4;

// Arrays
var btnName:Array = new Array();
btnName[0] = "btnOne";
btnName[1] = "btnTwo";
btnName[2] = "btnThree";

var btnLabel:Array = new Array();
btnLabel[0] = "One";
btnLabel[1] = "Two";
btnLabel[2] = "Three";

var colorTheme:Array = new Array();
colorTheme[0] = "0x00CCFF";
colorTheme[1] = "0x0000FF";
colorTheme[2] = "0xFFFF00";

import mx.controls.Button;

for (iNum = 0; iNum <=2; iNum++)
{
// This code below appears to work as the buttons appears on the stage.
createClassObject(Button, btnName[iNum], iNum, {label:btnLabel[iNum]});
//The next three lines is where I am having problems with.
btnName[iNum].setStyle("themeColor", colorTheme[iNum]);
btnName[iNum].setSize(myWpos, myHpos);
btnName[iNum]._x = myXpos;
//trace(btnName[iNum]);
}


What I am trying to accomplish here is to use arrays to assign instance names, labels and color themes to my buttons.

The for loop is used to create the buttons and change the properties of my buttons. Instead of doing it the long and drawn way (listed below), I thought one for loop would make life easier.


Code:
/*
// Create Button #1
createClassObject(Button, "btnHorizon", 1, {label:"Horizon"});
btnHorizon.setStyle("themeColor", 0x00CCFF);
btnHorizon.setSize(myWpos, myHpos);
btnHorizon._x = myXpos;
btnHorizon._y = 103.3;

// Create Button #2
createClassObject(Button, "btnValidation", 2, {label:"Concept Validation"});
btnValidation.setStyle("themeColor", 0x0000FF);
btnValidation.setSize(myWpos, myHpos);
btnValidation._x = myXpos;
btnValidation._y = btnHorizon._y + 24;

// Create Button #3
createClassObject(Button, "btnAssessment", 3, {label:"Concept Assessment"});
btnAssessment.setStyle("themeColor", 0xFFFF00);
btnAssessment.setSize(myWpos, myHpos);
btnAssessment._x = myXpos;
btnAssessment._y = btnValidation._y + 24;
*/


Can arrays and variables be used as instance names as well as other methods to modify changes to properties?

Any help you can provide would be greatly appreciated.

Thanks,

- Alex

Can OnRelease = Functions Can Be Dynamically Assigned At Run-time?
Can onRelease = functions can be dynamically assigned at run-time to movie clip instances, instead of having to hard code the instance name?

HARD CODED:
myButt_but1.onRelease = myButt_but2.onRelease = myButt_but3.onRelease = myButt_but4.onRelease = function () {
// do something here
};

I WAS THINKING OF SOMETHING ALONG THE LINES OF:
for (var i:Number = 1; i < 5; i++) {
[myButt_but+"i"].onRelease = function () {
// do something here
};
sum += i;
}

PROBLEMS:
Not allowed to use [myButt_but+"i"].onRelease
Is there an alternative approach which works?

Multiple, Ordered Actions Assigned To Buttons
Hi,

I'm new to actionscripting, so I'm assuming this isn't too challenging. Lets say I have a navagation bar with a Home and a Bio button. When the Bio button is clicked from the Home page I want some closing animation to occur on the home.swf, and then the bio.swf to load. What I'm thinking is that I need to script the button so that it first triggers the home.swf to begin playing where it left off on the timeline--playing the final animation i create in the home.swf. I need to tell the button to wait until completion of the home.swf timeline, perhaps wait a few seconds, and then load the bio.swf.

Of course, I could load the bio.swf at the end of the home.swf timeline, but that wouldn't work if there are multiple pages all behaving similarly.

So how would I script a button to perform these two actions one after the other from the master timeline? Can anyone offer a better solution to performing what I described. An example of what I might want to do is at www.sonofabish.com when you click on a button, an animation concludes the current page, and another animation introduces the new one.


Thanks!

Problem With Dynamically-assigned Clip Names
Hi there

I'm using Flash Pro 8

I'm having a problem with the names of some button clips I'm creating at run-time in a clip called "_level0.buttHolder" - when i click on the buttons they all output the same name!

here's the function I use to make the clips and assign the names
PHP Code:



buttonArr = new Array("","Accueil","Editions","Travaux","Contact");
pageArr = new Array("","main.php","editions.php","travaux.php","contact.php");
numButts = 4;
offColour = "0x666666";
overColour = "0x9B8D3D";
baseX = 0;
baseY = 0;
startX = 0;
rootUrl = "";
offset = 0;

function makeButts(){
    for(i=1;i<=_level0.numButts;i++){
        // make outer button
        var nameVar = _level0.buttonArr[i];
        
        trace(nameVar);
        
        _level0[nameVar + "But"] = _level0.buttHolder.createEmptyMovieClip(nameVar + "Clip",i);
        //_level0[nameVar + "But"]._x = _level0.baseX + (i*110)-110;
        _level0[nameVar + "But"]._y = _level0.baseY;    

        
        // Add text
        _level0[nameVar + "But"].createTextField("butlabel",1,0,0,0,0);
        _level0[nameVar + "But"].butlabel.autoSize = true;
        _level0[nameVar + "But"].butlabel.text = nameVar;
        _level0[nameVar + "But"].butlabel.selectable = false;
        
        
        _level0[nameVar + "But"]._x = _level0.offset;
        _level0.offset = _level0.baseX + _level0.offset + _level0[nameVar + "But"].butlabel._width + 10;

        
        // make active button clip in layer 100
        _level0[nameVar + "ButActive"] = _level0[nameVar + "But"].createEmptyMovieClip(nameVar + "Clip",100);
        var X1 = 0;
        var X2 = (_level0[nameVar + "But"].butlabel._width + 10);
        var Y1 = 0;
        var Y2 = 22;
        _level0[nameVar + "ButActive"].moveTo(X1,Y1);
        _level0[nameVar + "ButActive"].beginFill(_level0.offColour);
        _level0[nameVar + "ButActive"].lineTo(X2,Y1);
        _level0[nameVar + "ButActive"].lineTo(X2,Y2);
        _level0[nameVar + "ButActive"].lineTo(X1,Y2);
        _level0[nameVar + "ButActive"].lineTo(X1,Y1);
        _level0[nameVar + "ButActive"].endFill();
        _level0[nameVar + "ButActive"]._visible = false;
        _level0[nameVar + "But"].hitArea = _level0[nameVar + "ButActive"];
        _level0[nameVar + "But"].onRelease = function(){
            trace(_level0[nameVar + "But"]._name);
        }
    }    
}

// START FUNCTIONS
makeButts();





can anyone see the error in my actionscript ?

thanks for any help you can give

[CS3] Event Handler Actionscript 2.0 Assigned To Yes No Buttons...
How would I add an event handler so the person has to answer ALL questions
correctly before they can proceed to the next set of questions. There are a series of 5 to 6 questions, each has a Yes and No button assigned to the question. The unloadMovie is for a red check mark displayed over the Yes or No button depending on which is selected.

Here is the actionscript I used for the first Yes No question, the rest are coded the same but with a different mc assigned.


on (release) {
loadMovie("y_bedrest.swf", "bedrestansr_bx");

}
on (release) {
loadMovie("redcheck.swf", "yredck_mc");
}
on (release) {
unloadMovie("nredck_mc");
}



on (release) {
loadMovie("n_bedrest.swf", "bedrestansr_bx");
}
on (release) {
unloadMovie("yredck_mc");
}
on (release) {
loadMovie("redcheck.swf", "nredck_mc");
}

Any help would be greatly apreciated as I have never used event handlers before.

Playing A Mp3 File Outside Of Folder Assigned To The Website
Hi, I have an mp3 player made in flash. I wont the mp3 player to play a mp3 file that is not on the folder assigned to the website is in IIS. How could I make this?
The mp3 player is made in ActionScript 2.0 or 3.0 and the sever is Windows Server 2003 R2.
Thank you,
Adrian

[Q] MovieClip Instance Name And The AttachMovie And The Function Assigned To It... :)
Hehe... Long long question...

Okay... This is not so much of how to question rather why question...

Let's say that I have a movieClip called tab_mc on the stage and in that movieClip, I have two frames... In frame 1, I have a movieClip called 'test_mc', and another 'test_mc' in frame 2 with different content or color...

On the main timeline, I have this function...
PHP Code:



this.tab_mc.test_mc.onPress = function ()
{
   trace(this._name);





Now, I have a Key Listener which checks if '1' or '2' is pressed... If '1' is pressed, it will gotoAndStop() to frame 1, and '2' will gotoAndStop() to frame 2...

If I do not change the frame with '1' or '2' key, the onPress handler works fine... I get the trace() working fine...
But, as soon as I change the frame, onPress handler does not respond as a movieClip even if I assigned the same instance name 'test_mc' for both movieClips on each frames...

Does anybody know why it is not working???

The workaround would be using the attachMovie() function to attach the movieClip under the tab_mc and it did the job for me...

Route Problem With Dynamically Assigned Names
I control the size of "clip1" by pressing on it or by pressing "leftClip1".


PHP Code:



clip1.onPress = leftClip1.onPress=function () {
    clip1._xscale = clip1._yscale=200;
};
clip1.onRelease = leftClip1.onRelease=function () {
    clip1._xscale = clip1._yscale=100;






The problem occurs when I add more clips.

I've tried this and some variations but nothing seems to work.


PHP Code:



for (i=1; i<5; i++) {
    this["clip"+i].onPress = this["leftClip"+i].onPress=function () {
        this["clip"+i]._xscale = this["clip"+i]._yscale=200;
    };





Thanks.

Dynamically Assigned Functions Trace The Same Information
I'm creating a menu by dynamically placing movie clips on the stage that are dependent upon the content in an XML file. I have an .as file linked to the movie clip I need the information loaded into. Functions are dynamically assigned correctly to each MC, but I need the function to pass another dynamically assigned variable so that it knows what information to load once pressed. I have each MC tracing the number at which it was assigned during the for loop (the point at which it was created). However, the function assigned to each MC is tracing the same number -- the last iteration in the for loop. This number is remaining static for each dynamically assigned function. Why? My class file is attached. Any feedback or help would be greatly appreciated!

Object Data Member Not Changing When Assigned Value
Hi,

So I've run into a problem with assigning a value to some of my object's data members.
Here's what's going on:

I have a class called Tile. Here is the code for the class (just the part that you need to see):

public class Tile extends MovieClip {

private var testVar:String;

public function Tile() {
testVar = "initialized testVar";
this.addEventListener(MouseEvent.CLICK, mouseClickHandler);
}

private function mouseClickHandler(event:MouseEvent):void {
trace(testVar);
}

public function setTest(s:String):void {
testVar = s;
}
}

Out side of this class I make two simple calls. One to initialize the object and the other to call the function (the object is already present on the stage btw so I CAN click it). The call is:

var myObject:Tile = new Tile();
myObject.setTest("cool");

Now when I run the program and I click on myObject, it spits out:

initialized testVar

click it again... and again... and again lol. Same thing over and over. So I thought maybe my call outside the class was somehow incorrect. I made a trace within the setTest function so that it looked like this:

public function setTest(s:String):void {
testVar = s;
trace (testVar);
}

This time it spits out:

cool

Then when I click it always gives me:

initialized testVar

Why won't my data member change?

icekube12jr

TxtField.width Being Assigned A Large Number
Pretty new to Actionscript 3.0, so hopefully I can gain some experience here from someone else.

I have a text field that I am trying to place its right edge along the left edge of another textfield. unfortunately, the txtField.width value is not consistant with how many characters are actually in the txtField. In fact, its pretty much double of my first textfield. What even confuses the issue even more, is the fact that I'm using mirrored code on both the first and second txtFields. I'm hoping for some advice here, as I'm running out of things to try. I've tried using
Code:
var metrics:textLineMetrics = txtField.getLineMetrics(0);
txtField.width = metrics.width;
but unfortunally, that returns a txt field that is truncating the characters in the txtField.
I've tried:
Code:
txtField.autoSize = TextFieldAutoSize.LEFT//right and center too
but they also returned a txtField that was truncated. I'm adding characters to the text Field with actionscript, so unless I write some code that measure the size of each character that is going into the txtField, and I have five different font sizes, then measure how many of each character are going into the text field, then find the total width and add it to the .width property, I would be in business. But before I go off and write some of that code, I wanted to check to ensure that there wasn't something else that I am missing. Here is the code that I am using.
Code:
var request:URLRequest = new URLRequest("binary.css");
var ld:URLLoader = new URLLoader(request);
var style:StyleSheet = new StyleSheet();
ld.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
ld.addEventListener(Event.COMPLETE, loaderCompleteHandler);

function errorHandler(e:IOErrorEvent):void {
trace( "Couldn't load the style sheet file. " + e);
}

function loaderCompleteHandler(event:Event):void {
style.parseCSS(ld.data);
}
var counter:Number = 1;

//_________________________________________//
//Create the textField that will contain the
//the binary numbers
//_________________________________________//
var binary0:TextField = new TextField();
var binary6:TextField = new TextField();

var binary1:TextField = new TextField();
var binary7:TextField = new TextField();

var binary2:TextField = new TextField();
var binary8:TextField = new TextField();

var binary3:TextField = new TextField();
var binary9:TextField = new TextField();

var binary4:TextField = new TextField();
var binary10:TextField = new TextField();

var binary5:TextField = new TextField();
var binary11:TextField = new TextField();

for (var i = 0; i < 6; i++) {
counter=1;
addChild(this["binary"+i]);
this["binary"+i].width = stage.width*1.2;
this["binary"+i].styleSheet = style;
this["binary"+i].multiline = false;
this["binary"+i].autoSize = TextFieldAutoSize.LEFT
this["binary"+i].htmlText = '<p class='+['"binary'+i]+'">'+['"binary'+i]+randGen()+"</p>";;
/*var metric:TextLineMetrics= this["binary"+i].getLineMetrics(0);
this["binary"+i].width = metric.width;*/
}
for (var j = 6; j < 12; j++) {
counter=1;
addChild(this["binary"+(6+j)]);
this["binary"+j].width = stage.width*1.2;
this["binary"+j].styleSheet = style;
this["binary"+(j)].multiline = false;
this["binary"+(j)].autoSize = TextFieldAutoSize.LEFT;
this["binary"+(j)].htmlText = '<p class='+['"binary'+(j-6]+'">'+['"binary'+j]+randGen()+"</p>";
/*var metrics:TextLineMetrics= this["binary"+(j+6)].getLineMetrics(0);
this["binary"+(j+6)].width = metrics.width + 20;*/
}
trace(binary6.width);
binary0.y=30;
binary6.y=30;
binary6.x=binary0.x-binary6.width;
trace(binary6.x + " " + binary0.x + " " + binary6.width + " " + binary0.width);

binary1.y = 90;
binary7.y = 90;
binary7.x = binary1.x+binary1.width + 5;

binary2.y = 195;
binary8.y = 195;
binary8.x=binary2.x-binary8.width;

binary3.y=260;
binary9.y=260;
binary9.x = binary3.x+binary3.width + 5;

binary4.y=365
binary10.y=365;
binary10.x=binary4.x-binary10.width;

binary5.y=620;
binary11.y=620;
binary9.x = binary5.x+binary5.width + 5;

glide();
addEventListener(Event.ENTER_FRAME, measureAndAdd0);
/*addEventListener(Event.ENTER_FRAME, measureAndAdd1);
addEventListener(Event.ENTER_FRAME, measureAndAdd2);
addEventListener(Event.ENTER_FRAME, measureAndAdd3);
addEventListener(Event.ENTER_FRAME, measureAndAdd4);
addEventListener(Event.ENTER_FRAME, measureAndAdd5);*/
//____________________________________//
// randGen populates the
// textfields with binary numbers
//____________________________________//
function randGen() {
var str:String = "";
for (var j = 0; j < 50; j++) {
if ((j/8) == counter) {
counter++;
str += " ";
}
str += String(Math.round(Math.random()));
}
return str;
}
function glide() {
addEventListener(Event.ENTER_FRAME, right1);
/*addEventListener(Event.ENTER_FRAME, right2);
addEventListener(Event.ENTER_FRAME, right3);
addEventListener(Event.ENTER_FRAME, left3);
addEventListener(Event.ENTER_FRAME, left2);
addEventListener(Event.ENTER_FRAME, left1);*/
}
function removeGlide() {
removeEventListener(Event.ENTER_FRAME, right1);
removeEventListener(Event.ENTER_FRAME, right2);
removeEventListener(Event.ENTER_FRAME, right3);
removeEventListener(Event.ENTER_FRAME, left3);
removeEventListener(Event.ENTER_FRAME, left2);
removeEventListener(Event.ENTER_FRAME, left1);
}
function right1(e:Event) {
binary0.x +=1;
binary6.x +=1;
trace(binary6.x);
}
function right2(e:Event) {
binary2.x +=2;
binary8.x +=2;
}
function right3(e:Event) {
binary4.x +=3;
binary10.x +=3;
}
function left1(e:Event) {
binary1.x -= 3;
binary7.x -= 3;
}
function left2(e:Event) {
binary3.x -= 1;
binary9.x -= 1;
}
function left3(e:Event) {
binary5.x -= 2;
binary11.x -=2;
}
var boo0:Boolean = true;
var boo6:Boolean = true;
var boo1:Boolean = true;
var boo7:Boolean = true;
var boo2:Boolean = true;
var boo8:Boolean = true;
var boo3:Boolean = true;
var boo9:Boolean = true;
var boo4:Boolean = true;
var boo10:Boolean = true;
var boo5:Boolean = true;
var boo11:Boolean = true;

//________________________________//
// the measureAndAdd series
// takes care of the cycling
// of the textfields, creating
// a continuous flow of
// binary numbers
//________________________________//
function measureAndAdd0(e:Event) {
var a:TextField = binary0;
var b:TextField = binary6;
if (a.x > -5 && boo0 && boo6) {
trace("init");
counter = 1;
boo0 = false;
b.htmlText = '<p class="binary0">'+randGen()+"</p>";
b.x = a.x-b.width;
}
if (b.x > -5 && !boo0 &&!boo6) {
trace("init2");
counter = 1;
boo0 = true;
a.htmlText = '<p class="binary0">'+randGen()+"</p>";
a.x = b.x - a.width;
}trace(a.x + " " + boo0 + " " + boo6 + " " + b.x);
if(a.x > 100){
trace('init3');
boo6 = false;
}if(b.x > 100){
trace('init4');
boo6 = true;
}
}
function measureAndAdd1(e:Event) {
var a:TextField = binary2;
var b:TextField = binary8;
if (a.x > -5 && boo2 && boo8) {
counter = 1;
boo2 = false;
b.htmlText = '<p class="binary2">'+randGen()+"</p>";
b.x = a.x-b.width;
}
if (b.x > -5 && !boo2 &&!boo8) {
counter = 1;
boo2 = true;
a.htmlText = '<p class="binary2">'+randGen()+"</p>";
a.x = b.x - a.width;
}if(a.x > 1100)
boo8 = false;
if(b.x > 1100)
boo8 = true;
}
function measureAndAdd2(e:Event) {
var a:TextField = binary4;
var b:TextField = binary10;
if (a.x > -5 && boo4 && boo10) {
counter = 1;
boo4 = false;
b.htmlText = '<p class="binary4">'+randGen()+"</p>";
b.x = a.x-b.width;
}
if (b.x > -5 && !boo4 &&!boo10) {
counter = 1;
boo4 = true;
a.htmlText = '<p class="binary4">'+randGen()+"</p>";
a.x = b.x - a.width;
}if(a.x > 1100)
boo10 = false;
if(b.x > 1100)
boo10 = true;
}
function measureAndAdd3(e:Event) {
var a:TextField = binary1;
var b:TextField = binary7;
if ((a.x+a.width) < (stage.width +10) && boo1 && boo7) {
counter = 1;
boo1 = false;
b.htmlText = '<p class="binary1">'+randGen()+"</p>";
b.x = a.x+a.width;
}
if ((b.x+b.width) < (stage.width +10) && !boo1 &&!boo7) {
counter = 1;
boo1 = true;
a.htmlText = '<p class="binary1">'+randGen()+"</p>";
a.x = b.x + b.width;
}if(a.x <0)
boo7 = false;
if(b.x <0)
boo7 = true;
}
function measureAndAdd4(e:Event) {
var a:TextField = binary3;
var b:TextField = binary9;
if ((a.x+a.width) < (stage.width +10) && boo3 && boo9) {
counter = 1;
boo3 = false;
b.htmlText = '<p class="binary3">'+randGen()+"</p>";
b.x = a.x+a.width;
}
if ((a.x+a.width) < (stage.width +10) && !boo3 &&!boo9) {
counter = 1;
boo3 = true;
a.htmlText = '<p class="binary3">'+randGen()+"</p>";
a.x = b.x + b.width;
}if(a.x <0)
boo9 = false;
if(b.x <0)
boo9 = true;
}
function measureAndAdd5(e:Event) {
var a:TextField = binary5;
var b:TextField = binary11;
if ((a.x+a.width) < (stage.width +10) && boo5 && boo11) {
counter = 1;
boo5 = false;
b.htmlText = '<p class="binary5">'+randGen()+"</p>";
b.x = a.x+a.width;
}
if ((a.x+a.width) < (stage.width +10) && !boo5 &&!boo11) {
counter = 1;
boo5 = true;
a.htmlText = '<p class="binary5">'+randGen()+"</p>";
a.x = b.x + b.width;
}if(a.x <0)
boo11 = false;
if(b.x <0)
boo11 = true;
}
var end:Number = 100;
var storeX:Number = 0;
function zoom() {
end = 100;
storeX = 0;
addEventListener(Event.ENTER_FRAME, scale);
function scale(e:Event):void {
var str:String = String(binary0.htmlText);
end -= 4;
str = str.slice(0, end);
str+="</p>";
binary0.htmlText = str;
binary0.scaleX += 1;
binary0.scaleY += 1;
binary0.x -= (binary0.scaleX - storeX) *100;
storeX = binary0.scaleX;
if (end < 0) {
removeEventListener(Event.ENTER_FRAME, scale);
}
}
}

Unable To Edit Actionscript Assigned To A Button
Hi,
I have a button with a getURL action assigned to it. I needed to change the URL of that button but can't. When I go to the symbol in the library, open it, then open the actions menu, I get a message that says "the current selection can not have actions assigned to it."

I had the same problem last week and ended up creating a new menu and new action script just to get the job done. But now  I have the same problem and I'd like to know why. I can see the button and the actionsript in the movie explorer ... how do I edit it?

I'm relatively new to Flash and actionsript, perhaps I'm just missing something??

I’m using Flash MX (vs6).

Thanks,
S.


Can A Text Field Type Be Assigned To An Array?
I know that text field types are either static, dynamic or input, but is there any way to assign a array to a text field itself?

If this is not clear enough, I can provide more details.

Thanks

Preloader Doesn't Work When Movie Assigned To A Target
Hi

I've used the following code for a preloader for all my individual website sections and it works great.

The problem is that the preloader won't work when the movie is assigned to a target in my main movie.

Here's the code:-

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 2", 30) {
gotoAndPlay ("Scene 2", 1);
}


Once again, this code works fine when tested by itself in a standalone environment, the problem happens when the file is assigned to a target in the parent movie.

I'd really like to fix this without resorting to assigning the file to levels instead of targets.

url for the working standalone preloader:-
http://www.hodes.com.hk/Clients/bhg/test.htm

url for when it's assigned to a target:-
http://www.hodes.com.hk/Clients/bhg/home.htm


Thanks in advance

Sean

Dynamically Assigned .onRelease Method Firing Too Early
I have a script that attaches some movie clips to the stage. then I want to try and assign an onRelease button event handler to each one.

The problem I am having is that the onRelease handler seems to be firing as soon as the movie clip gets attached to the stage, instead of when it is clicked.



Code:
//build main menu
function mainMenu (whichMenu){
//set starting point for first menu item
startX = 26;
startY = 57;

//loop through array for menu button labels
for (i=0; i<whichMenu.length; i++){

trace (whichMenu[i][1]);

attachMovie ("menuButton", "menuButton" + i, i);

//pull button name from menu array
_root["menuButton" + i].buttonText = whichMenu[i][0];

//set the sub menu for each button
_root["menuButton" + i].whichSub = whichMenu [i][1];

//set the onPress event, to set the title for the subMenu
//_root["menuButton" + i].onPress = function () {set (_root.subTitle, this.buttonText)};

//set onRelease event for the main menu items
_root["menuButton" + i].onRelease = showSubMenu (whichSub);

//position menu Items
_root["menuButton" + i]._x = startX;
_root["menuButton" + i]._y = startY;

//update startY for next menu item
startY = startY + _root["menuButton" + i]._height;
}
}

Dynamic Text Fields Not Showing Values Assigned
I'm trying to add text to a dynamic text field on a movie clip that I am using as a button. It's actually a DTMF keypad I'm trying to create by using for loops to populate the text fields. No matter what I try it is not working. I step through the code and it goes through my function in its entirety, but the text labels are not showing any values.

I don't know if it matters, but the parent movie clip object of the buttons is not visible at start up (_visible = "false");

here's the code below for anyone who might be able to help:

function initializePageWindow(){
var alpha:Array= new Array("A", "B", "C", "D");

for(i=0;i<10;i++){
_root.winPage["btn"+i].txtBlack.text = i;
_root.winPage["btn"+i].txtWhite.text = i;
}

for(i=0;i<4;i++){
_root.winPage["btn"+i].txtBlack.text = alpha[i];
_root.winPage["btn"+i].txtWhite.text = alpha[i];
}
_root.winPage.btnStar.txtBlack.text = "*";
_root.winPage.btnStar.txtWhite.text = "*";

_root.winPage.btnHash.txtBlack.text = "#";
_root.winPage.btnHash.txtWhite.text = "#";

}

winPage is the parent, and the buttons are labeled btn0 through btn9, btnHash, and btnStar, and the reason for the two test boxes is for shading effect.

The text fields are named txtBlack and txtWhite respectively.

I would really appreciate any help I can get with this, I'm losing it.

Thanks in advance to anyone who can help.

Text Field Variable Assigned To Array Element
I want a specific text field variable to follow the value of an array (i.e. a[1][2]) but entering a[1][2] in the text field variable field doesn`t do the job. Any ideas?

Assigned Text To Button Wont Appear On My Php Contact Form
I have created some buttons on a contact page that uses GET to feed a contact.php script. The problem is I cant seem to get the message variable to read into the email that it generates.

The website is www.tanyapowell.com.au, its the adelaide site.

the action script I use for the button to assign the text is


on(release){
message= "12 week teen modelling and grooming"
gotoAndStop(1);
}


this should assign the variable message that token and then have it moved to the contact email using GET

the GET script is

$your_message = $_GET['message'];

and the content reader is

$content .= "Course of interest <b>" . $your_message . "</b><br>";

ON DEADLINE: Dynamic Text Box Doesn't Reflect Variable Assigned.
Friends,

I have a variable called lastName.text on an input text field on Frame 3.


A trace shows it inputting correctly.

on Frame 5 I have a movieclip of a newspaper where I would like the lastName variable to show up.

A trace on the ClipEvent load shows it is making it into the movieclip.

However, the actual text is not appearing in the dynamic text box. The text box is rotated and is scaled from 0 to 100% over time if that matters. Here's the coding:

------- FRAME 1 CODE----------

_global.lastName.text;


------- INPUT TEXT VARIABLE -------

lastName



------- FRAME 5 MOVIE CLIP CODE ----------

onClipEvent(load){
var passenger = _root.lastName;

------- DYNAMIC TEXT VARIABLE -------

passenger

The dynamic text box linked to the variable "passenger" doesn't show up.

Thanks in advance.

Dynamically Assigned Movieclip Variable Is Not Taking In Object Reference
I have the code below that's supposed to assign the reference of a programmatically created textfield(_root["logoInfo"+i+"_txt"]) to a movie clip variable(_root["logoInfo"+i+"_mc"].info) created at runtime.

when i trace _root["logoInfo"+i+"_txt"], the reference checks out okay but when _root["logoInfo"+i+"_mc"].info is traced, it returns undefined

code:
for(var i=1;i<=logoNum;i++){
_root.createTextField("logoInfo"+i+"_txt", i, 0, 0, 100, 20);
_root["logoInfo"+i+"_mc"].info = _root["logoInfo"+i+"_txt"];
trace(_root["logoInfo"+i+"_mc"].info);
}

Trying To Click A Button And Make The Number Variables I Assigned Add Up In The Total
Hello all,

I received help with this when I coded it in 2.0 but need to move it to 3.0. Would appreciate any help at all. I am trying to click a button and make the number variables I assigned add up in the total txt field.

The 2.0 file delivers correctly but my 3.0 tells me I am not returning anything. Extremely new to AS3.0 but a complete believer.

Thanks everyone find files attached.

Buttons Inside MC Not Working When Event Handler Function Is Assigned To MC
Please help!

I have a button on the stage that I assigned an event handler method to:

button1_bt.onRollover = function(){
animation1_mc.gotoAndPlay(10);

This is perfect. It plays the animation which is a drop down menu then stops in the dropped down state. However, I want "animation1_mc" to play it's pull up animation, starting on frame 21, when the MC is rolled off of. So I added this event handler method:

animation1_mc.onRollOut = function(){
animation1_mc.gotoAndPlay(21);
}

This also works, EXCEPT, the buttons inside the MC "animation1_mc" do not work! How can I have the pull up animation play on rollout o th e MC without disabling the buttons inside the MC???!!!

Thumbnail Scroller With Titles For Each Thumbnail
I've got a tutorial from kirupa (http://www.kirupa.com/developer/mx2004/thumbnails.htm)

what i'm trying to do is give ech thumbnail a title below its image but i cant manage to do it. I think I know hat i need to do, that is assign/createe a dynamic text field within the image_mc and assign the title from the array at the beginning. But i cant seem to get it to work

i can do it if i just put a text field on the main time line but then this is only the title for one

heres the code for the thumbnails:


Code:
function thumbnails_fn(k) {

thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {

target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {

p = this.pictureValue-1;
nextImage();

};
target_mc.onRollOver = function() {

this._alpha = 50;
thumbNailScroller();

};
target_mc.onRollOut = function() {

this._alpha = 100;

};

};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);

}
can any one help?

Much appreciated

Thumbnail Scroller With Titles For Each Thumbnail
I'm trying to modify the Gallery with a thumbnail scroller thats on here.

What I want to do is add it so that each thumbnail has a title below it as well.

Does anyone know if this has been covered anywhere? i@ve spent the weekend searching google and here and i'm at my wits end now..

Any help or pointers much appreciated.

Cheers in advance

Thumbnail Scroller With Titles For Each Thumbnail
http://www.kirupa.com/forum/showthre...46#post1983146

can anyone help?

"bricks" Falling In An Assigned Order
I have 14 bricks, and want each one to fall down the screen in a particular order.

I'm guessing I'll need to use an array, but I am really new to actionscript and need basic instructions on what to do...

thanks

(this is my fla so far, the user has to match the puzzle on the right as the bricks fall in an assigned order)

Using Flash MX

Two Different Urls - One .swf
I need to use the same .swf in two different urls. The thing is I need the .swf to recognize the url and adjust itself accordingly - hide some buttons, show some other. Does this make any sense what I am trying to do.
Any help would be great or point me in the direction of a tutorial.

Thanks
Carter

Urls
Easy for some but not me.

I have a button in a flash movie and i wanna link this to a web page how do i do it.

Cheers Ryan

Help Urls
Hello i have created a main swf file which is going to be my index page for a website and within this main swf file i want to have show one of the wedsites i have created. I have made a symbol as a movie clip for the URL to go and named it as an instance called example.

I have then placed some action script onto this instance. What i want to happen is when you open the site i want the URL to open within the instance called Example.

I have can get the instance to work as a botton using

on (release) {
getURL("http://theglory.co.uk/front.html","_Blank");
}

This works when you click on it and i have also tried on (rollover) it opens. But full screen. What i want to do is have it fit within this window and also be live!

I am not very experience in actionscript, and i need a point in the right direction!

URLs
I know there is a way to do this because I have seen it done before. I want to, when a button is clicked, get the current URL of the page, then depending on the current URL send the user to a new URL. How would I do this people? PLEASE!!!!

Copyright © 2005-08 www.BigResource.com, All rights reserved