ActionScript 2.0 :: MovieClip Loaders - Variable / Function Descriptions
Feb 20, 2007
I'm trying to do build some kind of photogallery, with movieclip loaders, but instead of having only one movieclip to load each image, I want to have a lot of movieclips to each load one image (so it increases se loading speed), and I want it to slide, so I have one movieClip, named Main, which holds numerous movieClips (it's not a movieclip loader, but each movieclip inside Main movieclip will be a movieclip loader), I have two buttons, one to go further, and one to go back.
What I want to do is, basically, that once we click on one button, for example the next button, the code tells "go inside Main movieclip and display the next movie clip" (for instance if we're on the number 1, go to number 2) etc ... So I thought I could give the movieclips inside the main movieclip a generic name, like n and n+1 (or n-1) and create variables but I don't know the syntax and to be honest how I really have to do it (I know how to declare variables, functions, but it's useless because I don't know how to describe it so it's understandable by flash).
View 7 Replies
Similar Posts:
Dec 8, 2010
I am trying to access the variable myParentVariable within the function myParentFunction() from the MovieClip's myMovieClip_mc function myMovieClipFunction().
I know that It works if I declare the variable myParentVariable outside of the myParentFunction() but I don't really want to do that
main timeline
//-------------------------------------------------------------------- ---
myParentFunction();
function myParentFunction():void
[Code]....
View 1 Replies
Feb 22, 2012
How can I combine the following functions and still pass a different string to the buildUI(); function?
I have two functions that do the same thing only at the end they both call a function and pass a String value to the function. This string value is the only thing different.
Below is are my eventlisteners and functions as they are now:
female_start.addEventListener(MouseEvent.MOUSE_DOWN, startFemale);
male_start.addEventListener(MouseEvent.MOUSE_DOWN, startMale);
//FUNCTIONS THAT DO THE SAME THING AND BOTH CALL buildUI BUT PASS A DIFFERENT STRING.
[Code].....
View 1 Replies
Nov 20, 2008
I have a movieClip named MC, and it's enabled with action script, with the class name MC_Rectangle and a Stage.I override the MC_Rectangle class file in a mc_rectangle.as external file.here is the code:
package{
import flash.display.*;
import flash.events.*;[ code].....
I have new a object in the main stage var
mc_rect:MC_Rectangle = new MC_Rectangle()
in main stage:
1. how can i access the variable "sequence" in "mc_rect"
2. how can i pass parametre from main stage to mc_rect via function setSequence(data:int)?
3. how can i call the function in addSequence() in mc_rect.
in asp.net, i usually use mc_rect.sequenct,mc_rect.setSequence(data), mc_rect.addSequence() to achieve my goals......btw, can function in mc_rect return out result to main stage?
View 1 Replies
Jan 29, 2012
I have a public variable and I am trying to set it, then read it from a different function:
public var str:String;
public function DailyVerse()
{
function create() {
[Code]....
My trace results says null. Why does it not give me "hello"?
View 1 Replies
Aug 29, 2011
I would like to display an items description when you "roll over" the item with the mouse (you know how a little box pops up under the mouse icon). Is there a way to do this?
View 1 Replies
Jun 8, 2009
on my stage are 5 buttons, each with the name of a product. i want to be able to hover over each product and see a Description of the product with a "learn more" link at the bottom of the description. the problem is that i want the Descriptions for each product to appear in the exact same place.
if the hit area of each button covers only the button itself, you can't click the "learn more" link because it disappears when you move off the buttonif the hit area of each button covers the Description area, the hit areas overlap each other. this causes the Description to always show the same thing (i think it is the Description of the last button i added) if you are hovering over anything besides an actual button.
View 6 Replies
Oct 18, 2010
URL]
What I would like to do is add a paragraph of text describing each photo in a different text field. Im not really sure how I would do this. I assume I would add another txt field in flash and set it to dynamic. I would then give it an instance name. Im not sure how I would implement it into the xml or AS though. I know its quite simple but ive been trying for awhile now.
ActionScript Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
[Code].....
View 2 Replies
Aug 29, 2007
I used this code, from "Creating Websites for Dummies" to create a video playlist. The only problem is that it (the book) doesnt show how to load descriptions for the video thumbnails (saying the title etc...of the video). I cant work out how to attach a dynamic text field to each thumbnail that reads its description from an xml file, can anyone give me some pointers or explain how this is done? I've been stuck on this for a few days now and i cant work it out..
in the code below 'main' refers to an attribute in teh xml file.
Code:
ar nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
[Code].....
View 1 Replies
Mar 30, 2010
IM trying to load an XML file with images and their descriptions and titles however when i attempt to trace the length of the XMLList, it displays as empty. heres the code.
[Code]...
View 5 Replies
Oct 21, 2010
I have a gallery page that has a UILoader Two buttons (back/next) and a Dynamic Text box.
When UILoader pulls in the new image i want to populate the text box with the description of that image. I have got the code working to pull the external text in the first time you go to the page but cannot figure out what to do to make it call the function and pass the right argument every time you click the next or back button.
Attached is my code.
var imageNumber = 1;
var textNumber = 1;
var loader:URLLoader = new URLLoader(new URLRequest("images/description"+textNumber+".txt"));
[Code].....
View 1 Replies
Nov 12, 2009
I have completed the Carousel part 3 tutorial and everything is working perfectly. However, I want to add a link to an external url in each of the detailed descriptions. How would I add this to the xml file?
View 2 Replies
Apr 7, 2011
I am busy converting my online digital portfolio from AS2 to AS3. I have made a new .fla and placed within it only the elements that relate to my question, to greatly simplify things so it is easy to see what I want to do.Lets say I have 3 movieclip buttons, which do three things when hovered over :
1. play a shine animation
2. move slightly
3. cause a tooltip description to appear / fade in, somewhere else on screen.
When mouse moves off, the above 3 things revert to normal and the description fades out.These buttons serve to show a description of the relevant project in my projects folder (project1.html, peoject2.html and project3.html, for demonstration purposes), and to link to them when clicked. The point is that I am trying to do this dynamically, so I have one movieclip(called descriptions) that contains all the descriptions each on its own frame, and use something like
//pseudocode
when button 1 is hovered over, descriptions.goToAndStop(1);
It is difficult for me to explain - but if you just run my swf and also take a quick look at my code (its not a lot) you will know exactly what I am trying to do.
In summary: Basically if you run my swf, you will see 3 buttons. When you hover over each, they are all saying Description 1, but I want button 1 to show description 1 and button 2 to show description 2 etc.Key items / code to look at inside the .fla are :
1. the first frame on the main timeline, actionscript layer - the code
2. the descriptionsHolder movieclip on the descriptions layer
3. the projectDescriptions movieclip inside the descriptionsHolder movieclip
4. the dynamic button (double click any of the buttons) - this is the idea I want for the descriptions too, its a reusable button that has the label 'button1' on all 3 buttons but with some code - the labels change at runtime to button1, button2 and button3.
5. the code inside the dynamic button movieclip on frame 1, actionscript layer.
6. note the buttonLabel movieclip inside the button movieclip, same thing I want done for the descriptions.
6. Also to please note, my code for linking each button to a project (not working)- that I also want to be a reusable function, for assigning a variable to contain the link for the dynamic button, depending on which instance of it is clicked -> go to either project1.html, project2,html or project3.html. I am trying to 'think like a programmer' and use modular, dynamic stuff, but it seems I am having trouble assigning variables or individual frames at runtime to multiple instances of the same dynamic movieclip.
View 3 Replies
Mar 7, 2012
how you would target a function's local variable through a concatenated variable string.For example:
var txt = "Hello World";
function testing(msg) {
var test1 = msg;[code].........
I'd expect the trace to be "Hello World" but rather is given "undefined". So if variables created outside functions are created on the main timeline, where are local function variables created and how would you access them?
View 2 Replies
Jul 28, 2007
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.
View 2 Replies
Nov 24, 2010
I want to monitor a variable. Whenever the variable value changes I want to call a function. In actionscript 2 I can use "watch" but in as3 what can do ?
View 1 Replies
Nov 27, 2009
I have a set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.
[Code]...
View 4 Replies
Jul 27, 2009
is it possible to declare function this way
ActionScript Code:
function startShake(e:MouseEvent, num1, num2):void
what i mean is it possible to send to the function not only en event but also a variable and a second question how can i access
ActionScript Code:
function stopShake(e:MouseEvent):Array
this array that function return.
View 1 Replies
Sep 16, 2009
I need to pass a variable to a function inside a function. However this parameter (i) seems not to be passed (to function ...onRollOver). This is required to attach a textfield to a movieclip (reading the adress and showing it as a tooltip).
ActionScript Code:
for (i=0; i<array_BE_ElecCities.length; i++) {
var attachElecCity = mc_map.mc_places.attachMovie("Plant",
[code].....
View 1 Replies
May 5, 2011
I want to create a vector, then call a function that populates that vector with arrays. Fine. The only catch is the function itself will declare new array variables to put into the vector, but are these new array variables private to the function only?e.g. something like this
ActionScript Code:
public var vec:Vector.<Array> = new Vector.<Array>();
private function populateVec():void {
[code]....
Is this "kosher"? a was declared in the private function but added to something outside the function..?
View 4 Replies
Aug 21, 2009
I want to declare a variable on the main timeline that can be called from anywhere in my movie. So, _global var should be the right approach. I want to declare a movie clip 'MC1' "open", or "closed" so that when it is revisited, my flash file knows the user has been there before and performs a different task from the one it does when 'MC1' was first encountered. So, i need a 'if' statement to run from the variable, when the playhead encounters the movieClip.
[Code]..
View 2 Replies
Oct 10, 2008
I have been banging my head against a brick wall regarding the following problem which must be very simple to fix, just can't see the answer.I have a class assigned to a movieclip called canvas. The class is called drawClass. I have called the instance of canvas on the stage 'drawingCanvas'.When I trace "drawingCanvas" I get object drawClass] which is fine. Tracing drawingCanvas.name gets me the instance name 'drawingCanvas'.This is a String variable.Basically what I am trying to do is pass the MovieClip name to another class. In my example the class 'toolBar', which can then interact with the MovieClip.
The problem is passing 'drawingCanvas.name' results in a String, so I get an error saying :TypeError: Error #1034: Type Coercion failed: cannot convert "canvasArea" to flash.display.MovieClip.I can't for love or money find a way to convert a String variable to a MovieClip variable! I have the name of the MovieClip, I just need to tell the toolbar class. But I can't find a way of doing this as the instance on stage is an object of drawingClass, not a MovieClip (unless MovieClips with attached classes are not treated as standard MovieClips?).
View 9 Replies
Feb 18, 2010
I have taken variable in one function and want to use that value in another function.
View 2 Replies
Jan 23, 2012
how to get variable value from a function to a text box here is the code :
import fl.controls.ComboBox;
import flash.events.Event;
import flash.events.MouseEvent;
TxtAnswer = Array();
[code]....
.. i want that variable "sk1" to next scene text box ..i putted the code like this :
q1.text = sk1;
but it is not working..
View 4 Replies
Jun 24, 2011
me how I can use the variable from one function in another function?
For example:
function init():void {
var test:Number = 1;
}
[Code].....
View 1 Replies
Aug 26, 2010
My main project loads an external .swf ("room") depending on which button the user clicks. Once that external .swf ("room") is loaded, the viewer chooses a ("demo") .swf to view. For each button click, a loader is to appear showing the viewer that the desired room or demo is loading. All of this works fine for the web...please click the link below to view.
The problem exists when I try to publish as an .EXE. We'd like to send these out to prospects on CD and thus I need an .EXE to autorun when insterted in a PC. I've published the main .SWF (overhead map) as an .EXE and burned a cd containing all necessary files. Now when the user clicks a room and then a demo, the loader that shows up fine on the web does not appear...the button stays in the down state until the demo .swfs loads and then the demo appears and plays.
View 18 Replies
May 17, 2011
I am brand new to AS3 and just about muddled through with AS2. I have a problem which should have a simple solution but everything I try gives errors.I had a load of buttons on the main timline which worked fine. I have moved a load of them into another movieclip called flyoutMenu. Now none work and I get the error:Error #1065: Variable about is not defined.This is the code stripped down to one button:[code]
View 2 Replies
Mar 30, 2009
This is something I'm experimenting with, but haven't seemed to figure out... I have several MovieClips, basically the same, only different colors. As each one plays, I'd like it to "overlap" whichever one is already there. Right now I have each button linked to a gotoAndPlay function, but I don't think that will ever get me what I want. You can see how I have it now here: [URL]
Instead of having the content MovieClip go back to all white when a button is clicked, I'd like the preivious one to remain, and get "covered up" by the new one. You continue to see the old color, and the new color overlaps it. I have a feeling I need to use a variable and then addChild, with a removeChild for the old MovieClip after the new MovieClip has loaded, but I'm not getting any good results yet.
View 1 Replies
Aug 1, 2005
I have a loop that creates movie clips where the movie clips are named mc_+ x for say x = 1 to 10 so the movieclips are called mc_1, mc_2.....mc_10.
What I need to do is the know which one of the movieclips is clicked on but more importantly the number i.e if movieclip mc_2 is clicked on then I need to use the value 2.
At the moment I am sending the value of x to be displayed in a text box within each movieclip:
_root.search.textfield.text = x;
Then I have a piece of actionscript that uses the value of x but I don't seem to be able to "re-read" the value of x back with:
var t = _root.search.textfield.text;
what I want is t = x is it to do with strings and number variables?is it possible to send the variable x to each movieclip so that it can be called from within each movieclip instead?
View 1 Replies
Feb 18, 2011
I'm making an image gallery and am loading about a dozen thumbs that load a larger image when each one is clicked. Works just great so far. But, as expected, there's a little pause before each corresponding large image is displayed.I'd like to eliminate the wait, if possible, so here's my question: As a matter of preference or programing style, whatever you want to call it, do you guys usually load ALL the images first, thumbnails as well as large images, before displaying anything on the stage? Or do you just load each large image when necessary, after its corresonding thumbnail is clicked?Sometimes I see very cool Flash sites that have the percentLoaded line or twirler displayed for what seems like a long time, but then each screen (MovieClip) after that displays fairly quickly and I'm wondering if that's what's happening - all, or at least a LOT of the images are being preloaded
View 3 Replies