| HELP! Having trouble with Clip Events |
|
 |
Index ‹ flash-actionscript
|
- Previous
- 1
- dynamic text loading into movie clipI'm pretty new at action scripting so please bare with me.
any help is appreciated.
thank you.
I have a flash movie called "products" that has a movie clip inside it. I did
not give the movie clip an instance name-does it need one?
Inside that movie clip I have a dynamic text box that is given the variable
name "dates"
I have a txt file in the same folder named dates.txt and on the first frame of
the products movie timeline I have a script that reads:
loadVariablesNum("dates.txt", 0);
the content of the dates file reads:
dates=January
1 New Year's Day
etc..........
the products movie is not the main movie.
I have the main movie called "Index.fla"
the index movie has several movie clips in it.
there is one movie in it called mc_products -with no instance name-does it
need one?
at the end of mc_products there is a loadMovie script
that loads the external published products.swf file
into a target "clipholder" in the main movie "Index"
loadMovie("products.swf", "clipholder");
The problem is that the text is getting lost somehere and is not loading into
the textbox
The products.swf file is loading into the main movie, but without the text.
can anyone decipher this and help out??
i think the problem is that the path is incorrect. once in the the dynamic
textbox is put into a movieclip the dynamic text no longer finds it's way into
the textbox. If the textbox is not is a movieclip it works fine.
again, any help is appreciated. thank you.
- 2
- passing variable will not executeBig help[ needed!
Having a big problem getting a vaiable to execute once passed the the main
timeline.
I hope there is a simplke oversite on my part.
I'm passing variable from a code clip to the main time line of th root movie.
1-
//codeclip
onClipEvent(load){
loadVariables("extfile.txt", page);
}
onClipEvent(data){
_level0.page = page;//passed but not acted on in ml
//_level0.page = 40;// IF HARD CODED it passed and fnction executes ok
}
2-
//A button calls fbkmktest() function below
3-
//function located on main timeline
function fbkmktest(){
step =page; //assigns value passed from codeclip from --THIs WORKS IF HARD
CODED at code clip
trace("page at fbkmktest======="+page); // Checks out OK values is passed
fro mcode clip external text file.
//the rest of the code simply loads a external swf file // THis has been
tested and works
vtofile = "contents/screen";
ext = ".swf";
for(i=0; i<=varray.length; i++){
if(step ==varray){
vpath = (vtofile+step+ext);//concat
loadMovie(vpath, "_level101");//higher level needed on get function
}
}
}
Problem - Question - Goal
The perplexity occurs in item 1-
if _level0.page is hard coded i.e if i enter a 12, the function executes???!
However if using a variable from loadVariable etc, even though loaded value is
being successfully(tested using trace-it's value does appear in the
function)... now the function will not execute?
Again, if hard coded then passed from codeclip function bkmktest() execution
occurs
If passed form using variable only function execution will not occur?
My goal here is to execute the function(as usual) based on a value it recieves.
Any help greatly appreciated.
iaustin
- 3
- removing blinking cursor from a text fieldIs there a method to remove the blinking cursor from a text field?
It seems that if the curor stays in the text field, and then if the user tries to click on some of my buttons, they don't work...
- 4
- onSoundComplete() with STREAM soundHi there
I'm having truble to call function when sound complete with sound object using
streaming MP3
What Event handler should be use in that case ?
to make it clear: when using stream mathod in sound object -
duration - gives the duration of current track
possition - gives total time of streaming (including brakes and waiting
periods)
getBytesLoaded/total - gives the masser of loading and got nothing to do with
track time.
onSoundCompleat - do nothing!
so - what method to use if i want to load the next track when the current is
got to its end.;)
- 4
- Extending a class that extends from MovieClipCan anyone give me a quick tour on how to extend a class that extends from
Movieclip?
For Example :
class A extends Movieclip
{
...
}
and I need a class that extends from Class A.
Thanks in advance.
- 4
- How to load an html fileHi, I'm a beginner and I need to do a program that display a tree at the left
of the screen and a textfield at the right. I load the tree's elements from a
txt file whit loadVars but how can I introduce the code from
textEnhancements.fla to load an html file at the begining of the flash movie.
This is my code.
var dateVars = new LoadVars();
dateVars.onLoad = function(ok) {
if (ok) {
//** Cargamos la lista de las paginas correspondientes al concepto
paginas_web = dateVars.pags_web;
lista_conceptos = paginas_web.split("@");
//** Cargamos los titulos correspondientes para cada pagina
paginas_tit = dateVars.pags_titulos;
lista_titulos = paginas_tit.split("@");
//** Convertimos la lista de titulos en los elementos del arbol a la
izquierda
for (i=0; i<=(lista_titulos.length-1); i++) {
arbol_conceptos.addTreeNode(lista_titulos[i], lista_conceptos[i]);
}
}
};
// carga arbol y variables
dateVars.load("concepto.txt");
html_contenido.multiline= true;
html_contenido.wordWrap = true;
html_contenido.html = true;
story = new XML();
story.ignoreWhite = true;
story.onLoad = function () {
html_contenido.htmlText = story;
}
story.load("01pagweb.htm");
Thanks a lot. I'm mexican. =)
- 4
- Use LoadVars to load a random txt fileHi all,
I am wondering if there is any way to load a txt file by random.
I am trying to give the client the ability to load many text files
or many parts within a text file and each time the site is
loaded. Can the LoadVars load a different text file or
does it have to load the same one every time?
Thanks!!
-bennett
- 6
- change the tint of a movie clip by ASHello all,
I would like to change the tint of a movie clip object in Flash 7. Can
someone tell me how can i?
I have seen the script in help:
fl.getDocumentDOM().setInstanceTint(0xff0000, 50);
which i can't use in the document. The instence name of the object is "aa".
Thanks in advance.
Regards
Anup
- 6
- maskingif that is not working, pls mail me the file.
- 7
- Create a x and y grid.So what I have is xml with latitude and longitude data. I am trying to think
of actionscript that will load the xml and then take the lat(43) and long (23)
etc.. and create a scaled relationship to the stage, then use the attach movie
to place icons on the various points. Any ideas?
- 7
- Changing rotation dynamically...I would like to have two MCs - when the user drags the first MC with their
mouse to the right, then the second MC will rotate around its registration
point clockwise. If the user drags the first MC to the left, the second MC
will rotate around its registration point COUNTERclockwise...
Is this possible? Thanks!...
--Matt
- 7
- Getting html text sizehow do all
Heres what I want to do. I have a text field on my timeline, it is 10
lines in height, say 200 in width. What I would need to do is set it
up so that I can set the number of lines flash should allow to be
filled in before the text box starts getting wider. So if I set it to
two lines and the piece of text coming in is greater in length than
400, the text box will start getting wider.
Using simple dynamic text boxes I have been able to do this, but when
I try to do it with Html text boxes (which I need because my text has
formatting) the metrics that flash passes back are either a little bit
off or simply laughable. Does anybody out there have a hint/trick to
get the proper metrics out of flash?
The one thing I did try was to put the html text (with formatting)
through a dynamic textBox using .htmlText and then take it back out
with .text (thus stripping the formatting) and feeding that into
TextFormat.getTextExtent(), but this still feeds bogus info.
Any ideas? ... please
Troot
- 8
- droptarget mc problemHi THERE,
I have a problem that is driving me crazy! I will explain it the best I can.
Situation:
6 Draggable mc's
4 fixed mc's (these act as dropping zones for the draggable clips)
When the user takes the 1st drag mc and drops it on a drop mc, a copy of the
drag mc (as a new movieclip instance)
is created and placed on the drop area (to give the impression that they
dropped the clip there).
The original mc that they dragged is then put back in its original place ready
to be dragged again elsewhere.
To achieve this, I am using _droptarget to obtain the instance name of the
dropzone that is used for various
variables.
I am able to drop and cover the mc fine, the problem occurs when I attempt to
drop another drag mc on a drop mc that
has already had something dropped on it previously. I cannot attain
_droptarget at this point because the drop mc
is covered by the instance that was created previously.
Here is what I have thought of to try and fix this:
I thought of creating an array for each drop mc. It records the name if the
instance covering the drop mc, then when
the user goes to drop another drag mc on it, I reference the name of the
instance currently in place from the array
associated with the drop mc and then remove it via removeMovieClip. The
problem is, the only way I know where the
user will drop the next drop mc is when onRelease is activated, and by that
time it is too late to register the
_droptarget var which I need, so really I need to remove the mc before the
user does onRelease, but this is a catch 22 situation.
Anyone know anthing that could help? Did I explain this ok?
Thanks for any advise offered.
Cheers
Mike
- 9
- Reusing symbols that contain shape tweenWell, what you can do is to open the two files and also open the two libraries
and then drag the symbol from the original library where the symbol is to the
other library. and if you paid attention, when you create a tween animation
there is an object that you create automatically, usually is named Tween1 or
Tween2 ... . You have to drag that symbol too.
- 9
- duplicateMovieClip {help please}hello all,
here is what i am tring to do. i want take the value of an array(value1) and apply that value to a movieClip(square) then duplicate the mc that many times going up on the y axis, like a graph. i can do this but it looks staic,
i was wondering if someone can help with the code to animate the movieclip(square), based on the array value.
thanks, so much,
chuck
http://webforums.macromedia.com/attachments/graph.zip
|
| Author |
Message |
webtexr.com.au

|
Posted: 2004-5-18 7:21:58 |
Top |
flash-actionscript, HELP! Having trouble with Clip Events
Have you tried doing it this way?
my_mc.onMouseUp = function() {
trace("Clip Name: " + this._name);
}
Replace my_mc with whatever the instance name of your clip is. Also you have a
comma instead of a period in the trace statement (this._name) so that may have
something to do with it. Slow down. Take deep breaths.
|
| |
|
| |
 |
mandingo

|
Posted: 2004-5-18 10:07:00 |
Top |
flash-actionscript >> HELP! Having trouble with Clip Events
be careful when you try to use events like mouseUp etc... these are a 'global'
mouse listener event and are not relative to any specific movieClip. All
movieClips will respond to these because quite simply, the mouse button is up
and they have actions to perform for this.
if what you want is to make a specific action when you release the mouse after
clicking on a certain movieClip... then try:
myMovieClip.onRelease = function(){
trace("You just clicked and released on " + this._name);
// whatever you need to happen
}
hope that helps... oh and if this is a button:
on(release){
trace("You just clicked a button on " + this._name);
// and again whatever you want
}
cheers,
|
| |
|
| |
 |
| |
 |
Index ‹ flash-actionscript |
- Next
- 1
- Can it be done? Control Playback of External SWFI have had no problem controlling playback of external SWFs in the past by
modifying the last frame of the external SWF to return playback control to the
parent.
UNIQUE SITUATION: I will not have the ability to modify the external SWF file
and want to be able to have the parent timeline be able to let the external SWF
play until it is finished and then return playback to the parent. Is there a
way to do this without modifying the external SWF?
Using the following code does not work as it requires modification of the
external SWF:
_root.createEmptyMovieClip("holder", 1);
holder.loadMovie("Deployment.swf");
Thanks!
:confused;
- 2
- Help with FLVPlayback BehaviorsI followed the tutorial on this page,
http://www.adobe.com/devnet/flash/articles/flvplayback_behaviors.html.
(This tutorial uses "Set Videos" from the FlVPlayback control" Behaviors.)
However, the videos load one after another until the last one is reached. I
am using a button to start each video but I just want it play the selected
video until the end ... not play the next video in the index.
Here is a snippet of code I used to try to stop the next video from loading(
but it's not working :( .....
Please Help!
on (release) {
// Set Video Index Behavior
this._parent.lizvideo.stop();
this._parent.lizvideo.activeVideoPlayerIndex = 0;
this._parent.lizvideo.visibleVideoPlayerIndex = 0;
this._parent.lizvideo.play();
//this is the part I was hoping would work but does not!! Any help Would be
appreciated.
if(Math.round(this._parent.lizvideo.playheadTime) ==
this._parent.lizvideo.totalTime)
{
this._parent.lizvideo.stop();
}
// End Set Video Index Behavior
}:sad;
- 3
- intro in the index pagehi,
i am a new user. I've created a flash intro for my geocities site
where the default homepage is index.html. I would not change all
internal links of the site, so I would avoid redirect, but i would
prefer only a preload of intro and then (i.e. after 10 seconds), the
page should show the real homepage. Is it possible?
Thank you very much for your assistance.
Francesco
- 4
- embedded html font removes spaces!I have a dynamic html textField which has embedded fonts. When I provide it
with html, it is displaying formatted text (italic, bold, underline, etc)
incorrectly. it removes a space directly in front of the formatted word.
e.g. unformatted:
hello world
formatted:
helloworld
I have tried placing the space inside and outside the format tag and it makes
no difference. Switching off the embed makes the field display correctly,
however my client wants embedded, anti-aliased text.
This seems to occur quite randomly so that some formatted text in the same
textfield does not display incorrectly, while some does!
There are font symbols for all my formatted fonts in the library.
Can anyone shed some light?
- 5
- Actionscript Trouble can you look and commentI think you should remove the "theMenu." from your switch statement...and if
you are using frame labels for your gotoAndStop statements, they should be
enclosed in quotes...:
switch(theMenuItem){
case Welcome:
gotoAndStop("welcome");
break;
//etc...
}
HTH
- 6
- Change frame rate dynamically?Hello,
In actionscript is it possible to change the global fps of a flash movie
and/or specifically a movieclip fps?
Thanks in advance for any help,
Dan
- 7
- 8
- Simple LocalConnection help neededI see a lot of post concerning this lately so I made a example pack you can view and download athttp://lowcost-web-services.com/page_with_two_swf_communicating.htm
- 9
- Wierd jpg problemHi,
I'm trying to load a jpg image into a movie (the image name will get dragged
out of a db) using a basic loadMovie() action.
All goes swimmingly if I load an swf file, however, I have several jpg files
that just refuse to load, yet some others load up fine. All the jpgs I have
tried are in the same directory and seem to have similar propoerties. they have
all been smaller than the swf files I've successfully loaded, so I don't think
it's a download time issue.
Even stranger - I get no error message saying that there were issues in
loading the jpg files - from what I can tell they DO load in, they just don't
show up! I've tried the obvious messing with the alpha and visibility
properties with no success.
Same thing happens when I start a blank project that just loads a jpg, so it's
not hidding behind anyhting else on the stage.
I'm stumped - has anyone got any information as to why one jpg should load up
OK and another shouldn't display?
I'm sure I'm doing something really boneheaded here, but I can't figure it out.
Ta
Buggerlugs
- 10
- Launching PDF from Projector file using fscommandHi,
I plan to distribute projector files (PC and Mac) on a hybrid CD burned from
the MacOSX Finder.
I'd like for a button in my Projector to launch a PDF file in whatever app. I
found a free solution called "Proxy" developed by Northcode. Northcode
developed an exe file that looks at its own name, then looks for a Windows bat
file of the same name ... it then runs the bat file, and the bat file launches
the PDF. And the exe's and bat's must be in a folder called "fscommand" within
the root of the CD, and the projector file must exist in the root, as well.
My fla is 1 frame long. I have a stop(); on an actions layer, as well as some
other fscommands to set fullscreen to false. The ActionScript is attached to a
button instance. It is:
on (release) {
fscommand("exec", "FG-BTH-98");
fscommand("exec", "FG-BTH-98.exe");
}
The first fscommand calls an AppleScript application that opens a PDF called
"FG-BTH-98" on a Mac. The second fscommand calls Northcode's exe-bat files to
open the same PDF on a PC.
But when I burn the CD, it's not working! I click on my button in the
projector, but nothing happens. I've set it all up by the book, I'm just
wondering if my fla is incorrect.
Thanks for any hints,
Ted
- 11
- Selection Inside a dynamic TextBox(Text Box, textbox, text field, textfield, dynamic)
OK, here is the thing.
Is there anyway for me to retrieve the begin index, the end index and the
length of a selection inside a dynamic text box at run time?
I need to change the text format of only that selection and I know I can do
this with TextField.setTextFormat(begin, end, myFormat) the only thing that
remains is to get begin and end.
Any ideas?
- 12
- moving arrays....Hi,
If i have a load of movie clips on the stage can i reference these from an
array and then have them move on the stage, so something like... (the code
below is just a guess), or could i give them a rollOver stage? Anyone have any
ideas on this?
Cheers..
var myArray = new Array();
myArray [0] = "one_mc"
myArray[1] = "two_mc"
myArray[2] = "three_mc"
myArray.onEnterFrame = function () {
this._x += 10;
}
- 13
- Loading SoundsI have created many a preloader, but not with sounds. The distinction is that
this is for a sound and it is triggered by a button being pressed. I managed
to figure out the basics of it, and it should work, but does not. The code on
the first key frame of the movie clip holding the control buttons is: function
triggerLoad(){ _root.createEmptyMovieClip('empty_mc',1234); bytes(); }
bytes = function(){ if(100000 >= song.getBytesLoaded()){ loaded(); }else
if(song.getBytesLoaded() == song.getBytesTotal()){ delete this.onEnterFrame;
removeMovieClip(this); }else{ song.loadSound('music/song' + count +
'.mp3', true); } }; That should work, shouldn't it? The 'loaded()'
function's commands still begin playing before the music is loaded. Why? The
play button now has this code on it: on(press){ if(count <= lastTrack){
song.stop(); song = new Sound (); count ++; song.loadSound('music/song'
+ count + '.mp3', true); song.start(0,1); triggerLoad(); }else{ count =
0; _root.title_txt.text = trackName[count]; } } The URL is
http://www.dragonfly-design.net/shilac/ If you want to see the issue in action
(the first song that comes up has offensive language). The levels should not
start until the music is loaded up. That is the action that exists inside of
loader_mc.
- 14
- Problems attaching mc.onPress function to clipHello,
I am working on a photo gallery where I am trying to get the thumbnails to
dynamically generated from a file.
I have got that working properly (thanks kglad), but I can not get the
mc.onPress function to render onto each clip.
I have attached the code that generates the clip, attached a zip file with the
proper files and structure, and posted the page online at
http://www.miphi.com/testdynamic
I really feel that is has got to be something simple, but I can not figure it
out. Any suggestions?
Thanks,
MP
emptythumb._x=0;
for(i=1; i<=5; i++){
emptythumb._y=0;
rclip=emptythumb.duplicateMovieClip("pic"+i, i);
rclip.ivar=i;
rclip.onPress = function(){
trace("onPress Called");
loadMovie("webImages/gal1/"+rclip.ivar+".jpg", _root.clEnlargedImage);
trace("webImages/gal1/"+rclip.ivar+".jpg");
}
trace("webImages/gal1/"+rclip.ivar+".jpg");
rclip._x=(i-1)*90;
myLoader.loadClip("webImages/gal1/thmbs/thmb"+ i +".jpg","pic"+i);
}
- 15
- MovieClipLoader() and preloadingIf one executes a MovieClipLoader.loadClip(), is the entire clip loaded, or
just the first frame? I'm trying to figure out the best strategy for
preloading where the user selects a button in the relatively small parent
movie and it then loads and plays a large movie clip. Could someone give me
best practices using ActionScript 2.0 in this situation, or point me to info or
sample?
Thanks,
-- Freddie
|
|
|