Action script _root.attachMovie
Hi all! I have a big problem at work. Here is the situation. I have an html passing a variable as an array to my flash. In the flash i want to call a couple of symbols depending on the variable from html and display them as a slideshow. I need to add these symbols dynamically but i dont know where to start. I have created all my movie symbols and linked them for actionscript. I have created a simple line of code just to display one symbol using _root.attachMovie and the symbol does not show. here it the code:
_root.attachMovie(usb, usb,1);
usb.x = 276.15;
usb.y = 199.50;
Now the symbol should be visible right? What am i doing wrong?
I will paste my code so you have better understanding. Here is what i have in my flash:
txt1.text = logos;
It seems I have difficulties passing the FlashVars from html. I have created a dynamic text box which I gave the instance name txt1. In my html, I have the following code for the flash:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="60" id="FlashID" title="logoflash">
<param name="movie" value="logo.swf" />
<param name=FlashVars value="logos=usb%2mp3" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="logo.swf" width="300" height="60">
<!--<![endif]-->
<param name=FlashVars value="logos=usb%2mp3" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
</object>
</object>
I have already wrote "fla" in the text box. When I preview the flash only all that shows is "f". When I preview the html within Dreamweaver, there is nothing on the text box.
When i try your code:
trace(usb);
var mc:MovieClip=_root.attachMovie(usb, usb,1);
trace(mc);
Nothing shows...I have worked with that 4 hours yesterday and read everything, I`m lost!!!
Similar Messages
-
I'm making a slideshow about 18 images in all 9 thumbnails and 9 full size images. The problem I keep running into is the "a script in this movie is causing flash player 9 to run slowly" error. The Flash is set to player 9 and action script 2.0. I have followed the uninstall reinstall tips in other threads and even tried it on another machines, ultimately coming up with the same results. I have read that there could possibly be too much script on the single frame so that said here is the script that is all on that first and only frame.
this.createEmptyMovieClip("container",1);
var imagesNumber:Number = 9;
for (i=1; i<=imagenumber; i++) {
container.attachMovie ("Cakethumb0"+i, "Cakethumb0"+i+"_mc",i);
Cakethumb_mc = container ["Cakethumb0"+i+"_mc"];
Cakethumb_mc._x =(i-1) *Cakethumb_mc._width;
Cakethumb_mc._y = (Stage.height-Cakethumb_mc.height)/2
Cakethumb_mc.largerImage = i;
Cakethumb_mc.onRelease = function() {
_root.attachMovie ("Cakeimage0"+this.largerImage,"large_mc",2);
large_mc._x = (Stage.width - large_mc._width)/2;
large_mc._y = (Stage.height - large_mc. _height)/2;
large_mc.onRelease = function() {
this.removeMovieClip();
container.onEnterFrame = function () {
this._x += Math.cos((-root._xmouse/Stage.width)*Math.PI)*15;
if (this._x>0) {
this._x = 0;
if (-this._x>(this._width-Stage.width)) {
this._x = -(this._width-Stage.width);
I appreciate any help you guys can send my way.Is the following a coding error where you declare a variable but misspell it when it gets put to use, or is the variable used somewhere else?
var imagesNumber:Number = 9;
for (i=1; i<=imagenumber; i++) { -
Error message with Action Script 2.0 file
Hi,
I am trying to edit an old flash file that uses Action Script 2.0. I am using CS6 and keep getting the following error message after publishing:
Scene 1, Layer 'AS', Frame 1, Line 5, Column 29
1067: Implicit coercion of a value of type int to an unrelated type String.
Can you suggest any fixes or workarounds? I also have Flash 4.0. Can i downsave the file? If so, how?
Thanks!Thank you. I think that did fix the original two errors. But now upon test of the file, I get some new errors:
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 3
1120: Access of undefined property ratio.
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 20
1180: Call to a possibly undefined method number.
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 27
1120: Access of undefined property _root.
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 9, Column 27
1120: Access of undefined property ratio.
And on the MoneySlide layer in Actions:
this.ratio = 0;
this.loadBar._width = 0;
this.dragger.ratio.text= "$0";
dragger.onPress=function(){
this.startDrag(true,0,0,line._width,0);
this.onEnterFrame=function(){
ratio=Math.round(number(_root.transitBenefitLimit/100)*(this._x/(line._width/10 0)));
loadBar._width = Math.round(this._x);
dragger.ratio.text= "$"+ratio;
dragger.onRelease=dragger.onReleaseOutside=stopDrag; -
Action Script to add MC as sub-pages ??
Alright please help.. I have tried everything, been fooling
around with this in the past 5 hours and its not going anywhere :(
. Here is what i have. :
I have 6 menu buttons... Button 4 is what i am concentrating
on.
at the moment here is the current action script of button 4 :
--CODE---
//-----this first few lines just controls the button
animation --
on (rollOver) {
if (_root.link<>4) {
gotoAndPlay("s1");
on (releaseOutside, rollOut) {
if (_root.link<>4) {
gotoAndPlay("s2");
//-----end of button animation-----
on (release) {
_root.scroller.scroller.gotoAndStop(3); // I understand this
calls for fram 3 in an mc within an mc.
if (_root.anim==true) { // not really sure where this means
if (_root.link<>4) { // if value of _root.link
<> 4 then activate the following code
_parent["but"+_root.link].gotoAndPlay("s2"); // I kind of
understand this part, i know it has to do with playing the button
animation, but i am stuck where it says "but" + _root.link .
_root.link = 4; // value of root.link
_root.all.play();
ok so basically, from what i can figure out what this action
script does is : somehow it calls out a mc called "all action page"
and the contents inside this mc are two layers. one layer is just a
stop frame, and the other layer has multiple frames, each frame in
the layer are each different mc's .. the _root.value is the value
of each frame, for example if i change the value to 2 or 3 it will
load frame 2 or 3 within the "all action page" mc..
now my question, is is there any way i can replicate this
script for the use of button 4 ?? i know i can just keep adding new
frams and mc's to the current "all action page" and just keep
changing the value that corresponds to the frame number, but i
would like to make it more neater and structured incase if i need
to change anything. any suggestions ??
-Steph'This package contains two scripts the use EXIF meta data. The one you want is StampExif the other GoogleMapGPS....
Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
Contains
Action Actions Palette Tips.txt
Action Creation Guidelines.txt
Action Dealing with Image Size.txt
Action Enhanced via Scripted Photoshop Functions.txt
CraftedActions.atn Sample Action set includes an example Watermarking action
Sample Actions.txt Photoshop CraftedActions set saved as a text file.
More then a dozen Scripts for use in actions
Download -
Flash photo gallery - loading first movie - action script
Hi,
I have a movie gallery (they are basically images with a fading effect), and I got it setup, and working, but I cannot get right the action script to make the first movie load when the page opens. The only thing I get to see is the scroll bar with the thumbnails, and after I click on the images I can see the full size. I would like the full size image of the first thumbnail to show up as default when the page opens. And then, if you click on the thumbnails the other images will appear. This is my link:
http://www.mauriciolopez.info/paintings/
This is the action script for a typical Thumbnail (setup as a button):
on (release) {
loadMovie("clip0.swf", "_root.screen");
I appreciate your help!!!!
Thanks!!!!Rob, thanks for your answer. I do have a movieClip, at the root level. All my other movies load when I click the thumbnails. For some reason I'm not able to make a video appear before clicking on the thumbnails. I'd like to open the gallery and see the first video full size (automatically), before even clicking the thumbnails. Then, when you scroll and enlarge the other ones, they will replace the default one. I haven't been able to make it do this, and it's driving me crazy....
Thanks again for your help. -
Action script 3 and adding code to buttons
When I open a new doc and selct action script 3 it won't
allow me to insert code by selcting the button on the stage. It
does if I select action script 2. All my old pages update ok but if
I make new buttons it wont take the code. CAn someone tell me what
is going on???
Thanks a lotIf your in a bind at the moment, I would suggest not
attempting to learn AS3. The system is very different, good, but
different, the syntax structure is much more strict and most things
have been revised to use a listener/broadcaster (or event
dispatcher) model, as well as most coding being class oriented,
additionally the graphic display structure is quite different.
Now did you change your publish settings back to AS2? If so,
you should still be able to apply the above code to a button
instance. However, as Dave stated, even in AS2 the code is best
used from the timeline, to do so with the code above (which the on
handler above is meant for Object attachment) you need to write it
like this:
my_btn.onPress = function() {
_root.loadMovie("graphic_arts/graphic_arts.swf");
I would also consider using a MovieClipLoader and the
loadClip method forloading swf files, as it gives you more control
over the load targeting, progress reporting, and event
notifications.
All this said, to use a button and load a file in AS3, you
need to add an event listener to the button instance and construct
a responding function to the event, in this case the loading of a
swf file. Additionally, in AS3 the MovieClipLoader class, as well
as the loadMovie methods have been replaced by the Loader classes
and must be used to load swf files. So construct a button in AS3
you must write something like the following: -
Using Flach CS4 and action script 2.0 how do I advance to a specific frame of the main timeline when a movie clip instance come to the end of its timeline?
code on the last frame of your movieclip instance:
_root.gotoAndStop('whatever_frame'); // will work unless this swf is loaded into another swf. in that situation, you should use a relative path to the main timeline (eg, _parent or _parent._parent etc). -
Help with action script please
hay guys, im having trouble with changing my action script to
allow multiple layers of the same thing in order to show a greater
sense of depth than the normal application. im using a flash
toutorial on making a sort of matrix like falling text (
link)
and im not completely understanding what to change in order to
accomplish my goal. i tryed to send them a message using their
contact page, but its broken, forcing me to find a forum. im sure
it has something to do with the third group of code where it
identifies what its using. but whenever i change anything there to
either match the identifiers or movie clip names the action script
crashes when i test the movie. any help is appreciated.
im using flash cs3 and made sure to create it all in action
script 2.0
please excuse my spelling, im sure i made a mistake
somewhere."FlashTastic" <[email protected]> wrote in
message news:e4ir4t$ru4$[email protected]..
>I don't think an enterframe will be your best bet.
>
> You might want to use something like
>
> if(_root._currentframe >= _root.totalframes){
> loadMovie("myMovie.swf",_root)
Why in the world would you do that when you can just put a
keyframe on the last frame and ..
loadMovie("myMovie.swf");
tralfaz -
How to embed html codes for videos games etc... in action script 3.0
i am trying to embed a chatbox on my action script 3.0 website. but i am having no succes. any help on how to get my chatbox on a page using html code
Hey thnx Ned.
this sites are really helpful.but,i have used sound through button.so how it is possible to attavh the link with slider.i have created slider also.
Below is my slider code for sound.
onClipEvent (load) {
mySound1 = new Sound();
mySound1.loadSound((myScale)+"/"+(myTanpura)+"/"+(myTanpuraSwar)+"/"+(myTanpuraTempo)+".w av", true);
mySound1.onSoundComplete = function() {
mySound1.start();
mySound1.start(0.058,999);
onClipEvent (enterFrame) {
downloaded = mySound1.getBytesLoaded();
total = mySound1.getBytesTotal();
if (downloaded != total) {
_root.dl = "You have to buy this software...";
} else {
complete = 1;
_root.dl = "";
mySound1.setVolume(ratio * 2);
This code is working for slider.I mean it scrolls the slider.but it dosent make any effect to sound.
Below is my button code.
stop();
mySoundBtn4.onRelease = function () {
mySoundC = new Sound(this);
mySoundC.attachSound("mySoundClip4");
mySoundC.start(0, 300); //10 represents the number of loops
gotoAndPlay("play1");
this is on button's frame.not exactly on button.
Button and Slider both are on diffrent scene.
Can you plese help me out? -
Help... link URL from XML to Flash Action Script 2
I am trying to link a different URL to each of my files in XML and use this XML in Flash were I created a carousel. In the carousel, when you click on a picture I would like to insert a specific URL. Each picture will have a different URL (http://------------).
Here are my codes:
XML:
<icons>
<icon image="icon1.png" tooltip="Planning" />
<icon image="icon2.png" tooltip="Investments" />
<icon image="icon3.png" tooltip="Education" />
<icon image="icon4.png" tooltip="Insurances" />
<icon image="icon5.png" tooltip="Mortgages" />
<icon image="icon6.png" tooltip="Retirement" />
<icon image="icon7.png" tooltip="Business Owner" />
<icon image="icon8.png" tooltip="Banking" />
</icons>
Flash Action Script 2:
import mx.utils.Delegate;
var numOfItems:Number;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.01;
var perspective:Number = 60;
var home:MovieClip = this;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.ref.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
function over()
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
function out()
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
function released()
function moveTip()
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
xml.load("icons.xml");
function mover ()
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) / (centerY+radiusY-perspective);
this._xscale = this._yscale = s * 100
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.onMouseMove = function()
speed = (this._xmouse-centerX)/10000;
Thanks so much for the help.You should be able to add that data into your xml tags and then extract it in the AS2 onLoad function...
XML:
<icons>
<icon image="icon1.png" tooltip="Planning" linkURL="http://www.someURL.com/somePage.html" />
AS2:
xml.onLoad = function()
etc....
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.urlLink = nodes[i].attributes.linkURL;
etc... -
Im taking over a job and I was given the original flash file
that doesnt seem to be working properly.
It a thumbnail menu that loads through xml...the images work
fine but the Links & Titles do not load.
Nor does the rollover effect. Here what I have.
Action Script:
Stage.align = "TL";
Stage.scaleMode = "noscale";
preloader._visible = true;
thumbs_line._visible = false;
import mx.transitions.Tween;
import mx.transitions.easing.*;
my_xml = new XML();
my_xml.ignoreWhite = true;
if (_parent.xml_file == undefined) {
my_xml.load((String(_url.slice(0, (_url.length-3))))+"xml");
} else {
my_xml.load(_parent.xml_file);
my_xml.onLoad = function(ok) {
if (ok) {
process_xml();
} else {
trace("XML not loaded");
function process_xml() {
total_images = my_xml.childNodes[1].childNodes.length-1;
gallery_width =
Number(my_xml.childNodes[0].childNodes[0].attributes.gallery_width);
gallery_height =
Number(my_xml.childNodes[0].childNodes[0].attributes.gallery_height);
max_thumb_height =
Number(my_xml.childNodes[0].childNodes[0].attributes.max_thumb_height);
thumbs_space =
Number(my_xml.childNodes[0].childNodes[1].attributes.thumbs_space);
thumb_border =
Number(my_xml.childNodes[0].childNodes[1].attributes.thumb_border);
image_border =
Number(my_xml.childNodes[0].childNodes[1].attributes.image_border);
fade_in_seconds =
Number(my_xml.childNodes[0].childNodes[2].attributes.fade_in_seconds);
fade_out_seconds =
Number(my_xml.childNodes[0].childNodes[2].attributes.fade_out_seconds);
thumb_fade_seconds =
Number(my_xml.childNodes[0].childNodes[2].attributes.thumb_fade_seconds);
fade_in_seconds += 0.01;
fade_out_seconds += 0.01;
thumb_fade_seconds += 0.01;
thumbs_line._y =
gallery_height-max_thumb_height-(4*thumbs_space);
thumbs_line.thumbs_bg._width = gallery_width;
thumbs_line.thumbs_mask._width = gallery_width;
thumbs_line.thumbs_bg._height =
max_thumb_height+thumbs_space*2+thumb_border*2;
thumbs_line.thumbs_mask._height =
max_thumb_height+thumbs_space*2+thumb_border*2;
thumbs_line._visible = true;
load_thumb(0);
preloader._x = int((gallery_width-preloader._width)/2);
preloader._y = int(thumbs_line._y/2-preloader._height/2);
max_image_height =
gallery_height-max_thumb_height-thumbs_space*6;
load_image(0);
this["link"+t] =
my_xml.childNodes[1].childNodes[t].attributes.link;
function load_thumb(t) {
thumbs_line.thumbs.createEmptyMovieClip('thumb'+t,
thumbs_line.thumbs.getNextHighestDepth());
thumbs_line.thumbs['thumb'+t]._y =
thumbs_space+thumb_border;
thumbs_line.thumbs['thumb'+t]._x =
thumbs_space+thumb_border;
if (t>0) {
thumbs_line.thumbs['thumb'+t]._x =
thumbs_line.thumbs['thumb'+(t-1)]._x+thumbs_line.thumbs['thumb'+(t-1)]._width+thumbs_spac e;
thumbs_line.thumbs['thumb'+t].image_number = t;
thumbs_line.thumbs['thumb'+t].onRollOver =
thumbs_line.thumbs['thumb'+t].attachMovie("thumbov_mc",
"thumbov_mc", 10);
thumbs_line.thumbs['thumb'+t].onRelease = function() {
tellTarget (thumbs_line.thumbs['thumb'+t]) {
var loadListener:Object = new Object();
loadListener.onLoadInit = function(target_mc:MovieClip) {
preloader.visible = false;
thumbs_line.thumbs['thumb'+t].attachMovie("border_grey",
"border_grey", 10);
thumbs_line.thumbs['thumb'+t].border_grey._x -=
thumb_border;
thumbs_line.thumbs['thumb'+t].border_grey._y -=
thumb_border;
thumbs_line.thumbs['thumb'+t].attachMovie("border_white",
"border_white", 20);
thumbs_line.thumbs['thumb'+t].border_white._x -=
thumb_border-1;
thumbs_line.thumbs['thumb'+t].border_white._y -=
thumb_border-1;
if (target_mc._height>max_thumb_height) {
ratio = target_mc._width/target_mc._height;
target_mc._height = max_thumb_height;
target_mc._width = int(target_mc._height*ratio);
thumbs_line.thumbs['thumb'+t].border_grey._width =
target_mc._width+thumb_border*2;
thumbs_line.thumbs['thumb'+t].border_grey._height =
target_mc._height+thumb_border*2;
thumbs_line.thumbs['thumb'+t].border_white._width =
target_mc._width+thumb_border*2-2;
thumbs_line.thumbs['thumb'+t].border_white._height =
target_mc._height+thumb_border*2-2;
if (t<total_images) {
t++;
load_thumb(t);
thumbs_width = thumbs_line.thumbs._width;
thumbs_right_limit = 0;
thumbs_left_limit =
0-thumbs_width+int(gallery_width-thumbs_space-thumbs_space);
var thumb_fade_in:Tween = new Tween(target_mc, "_alpha",
none.easeIn, 0, 100, thumb_fade_seconds, true);
var thumb_loader:MovieClipLoader = new MovieClipLoader();
thumb_loader.addListener(loadListener);
createEmptyMovieClip("img", 30);
thumb_loader.loadClip(this.my_xml.childNodes[1].childNodes[t].attributes.small,
img);
thumbs_line.onMouseMove = function() {
if (_xmouse>=thumbs_line.thumbs_bg._x and
_xmouse<=thumbs_line.thumbs_bg._width and
_ymouse>=thumbs_line._y and
_ymouse<=thumbs_line._y+thumbs_line._height) {
onRollOver =
thumbs_line.thumbs['thumb'+t].attachMovie("thumbov_mc",
"thumbov_mc", 10);
onEnterFrame = function () {
if (_xmouse<(gallery_width/2)-10 and
thumbs_line.thumbs._x<thumbs_right_limit) {
thumbs_line.thumbs._x -=
int((_xmouse-thumbs_line.thumbs_bg._width/2)/(100-scroll_speed));
if (thumbs_line.thumbs._x>thumbs_right_limit) {
thumbs_line.thumbs._x = thumbs_right_limit;
if (_xmouse>gallery_width/2+10 and
thumbs_line.thumbs._x>thumbs_left_limit) {
thumbs_line.thumbs._x -=
int((_xmouse-thumbs_line.thumbs_bg._width/2)/(100-scroll_speed));
if (thumbs_line.thumbs._x<thumbs_left_limit) {
thumbs_line.thumbs._x = thumbs_left_limit;
} else {
onEnterFrame = undefined;
this["link"+t] =
my_xml.childNodes[1].childNodes[t].attributes.link;
this["the_target"+t] =
my_xml.childNodes[1].childNodes[t].attributes.target;
XML File
<?xml version="1.0" encoding= "UTF-8" ?>
<options>
<option gallery_width="730" gallery_height="450"
max_thumb_height="96"/>
<option scroll_speed="75" thumbs_space="0"
thumb_border="1" image_border="2"/>
<option fade_in_seconds="1.5"
thumb_fade_seconds="1.5"/>
</options>
<gallery>
<img small="../flash/hosts/images/pic7.jpg" title="Name
1" link="hosts.asp"/>
<img small="../flash/hosts/images/pic1.jpg" title="Name
2" link="bio1.asp"/>
<img small="../flash/hosts/images/pic2.jpg" title="Name
3" link="bio2.asp"/>
<img small="../flash/hosts/images/pic3.jpg" title="Name
4" link="bio3.asp"/>
<img small="../flash/hosts/images/pic5.jpg" title="Name
5" link="bio4.asp"/>
<img small="../flash/hosts/images/pic6.jpg" title="Name
6" link="bio5.asp"/>
<img small="../flash/hosts/images/pic8.jpg" title="Name
7" link="bio6.asp"/>
<img small="../flash/hosts/images/pic9.jpg" title="Name
8" link="bio7.asp"/>
</gallery>
Thier is a dynamic Text field in the roll over effect that
should contain the "title"
the rollover MC name is: thumbov_mc
the dynamic text field is labeled: title
And the links are not working either?
Does anyone see the problem?
Thank You So Much for you help in AdvanceIf you think you can help just let me now and ill email you
the link to where this menu is...i dont want to post it for
everyone to see..thanks -
Can someone please help with this action script below.
I have a flash banner similar to the one on this website
www.grisoft.com except my script is setup to rollover the button
and automatically go to the url. I would like to roll over the
buttton, change the photo and then click to get url. I have attched
the action script below, also where do I put the url information?
If anyone can help, it would be greatly appreciated!
THE ACTION SCRIPT IS BELOW
function setSub(state)
for (i = 0; i <= _global.menuCnt; i++)
_root["sub" + state]["btn" + i].ii = i;
_root["sub" + state]["btn" + i].onRelease = function ()
getURL(_root["subURL" + state][this.ii - 1], "_self");
} // end of for
} // End of the function
function control(num)
if (num != 1)
_root.subBar.gotoAndPlay(2);
else
_root.subBar.gotoAndStop(1);
} // end if
_root.createEmptyMovieClip("enter", 1);
_root.enter.onEnterFrame = function ()
_root.select._x = _root.select._x + speed * (_root["mainBtn"
+ num]._x - _root.select._x);
_root.photo._x = _root.photo._x + speed * ((num - 1) * -800
- _root.photo._x);
_root.copyphoto._x = _root.copyphoto._x + speed * ((num - 1)
* 800 - _root.copyphoto._x);
TX = (num - 1) * -800;
if (Math.round(_root.photo._x) <= TX &&
Math.round(_root.photo._x) >= TX)
subView(num);
delete _root.enter["onEnterFrame"];
} // end if
} // End of the function
function ini()
var i = 1;
while (i <= _global.menuCnt)
_root["sub" + i]._visible = false;
i++;
} // end while
} // End of the function
function subView(num)
_root["sub" + (num - 1)]._visible = true;
} // End of the function
function imgSort()
num = 0;
var i = 1;
while (i <= _global.menuCnt)
_root.photo["photo" + i]._x = num * _root.photo["photo" +
i]._width;
_root.copyphoto["photo" + i]._x = num * -1 *
_root.copyphoto["photo" + i]._width;
num++;
i++;
} // end while
} // End of the function
mainURL = new Array("", "", "", "", "");
subURL1 = new Array("88.html", "88.html", "88.html",
"88.html");
subURL2 = new Array("88.html", "88.html", "88.html",
"88.html");
subURL3 = new Array("88.html", "88.html", "88.html",
"88.html");
subURL4 = new Array("88.html", "88.html", "88.html",
"88.html");
_global.menuCnt = 5;
for (i = 1; i <= _global.menuCnt; i++)
_root["mainBtn" + i].ii = i;
_root["mainBtn" + i].onRelease = function ()
control(this.ii);
ini();
setSub(this.ii);
getURL(mainURL[this.ii - 1], "_self");
} // end of for
_root.onLoad = function ()
ini();
imgSort();
speed = 0.300000;
setSub(1);
setSub(2);
setSub(3);
setSub(4);You could use Flash vars to pass in a URL, so you can specify what the URL should be for any particular page.
//SET A FLASH VAR ON THE HTML PAGE
<PARAM NAME=url VALUE="http://lakelawnmetairie.com/plan_ahead/preplanning.html">
<EMBED src="your.swf" FlashVars="url=http://lakelawnmetairie.com/plan_ahead/preplanning.html"></EMBED>
//SET A VARIABLE FOR THE FLASH VAR INSIDE OF FLASH
linkURL = root.loaderInfo.parameters['url'];
//TARGET THE SET 'LINKURL' VARIABLE AND SEND USER TO THE LINK
whyPlanAhead_btn.addEventListener(MouseEvent.CLICK, whyPlanAhead);
function whyPlanAhead(e:MouseEvent):void{
navigateToURL(new URLRequest(linkURL),"_self"); -
How to create volume slider for flash cs 5 using action script 2.0?
how to create volume slider for flash cs 5 using action script 2.0?the output should like if user want to hear sound in slow pitch,medium pitch or high pitch(slow to high pitch anything).i have attach this sound to button with using this code:
stop();
mySoundBtn.onRelease = function () {
mySoundC = new Sound(this);
mySoundC.attachSound("mySoundClip");
mySoundC.start(0, 10); //10 represents the number of loops
gotoAndPlay(2);
This sound plays till 3-4 scene ahead.
Can anyone help me?Hey thnx Ned.
this sites are really helpful.but,i have used sound through button.so how it is possible to attavh the link with slider.i have created slider also.
Below is my slider code for sound.
onClipEvent (load) {
mySound1 = new Sound();
mySound1.loadSound((myScale)+"/"+(myTanpura)+"/"+(myTanpuraSwar)+"/"+(myTanpuraTempo)+".w av", true);
mySound1.onSoundComplete = function() {
mySound1.start();
mySound1.start(0.058,999);
onClipEvent (enterFrame) {
downloaded = mySound1.getBytesLoaded();
total = mySound1.getBytesTotal();
if (downloaded != total) {
_root.dl = "You have to buy this software...";
} else {
complete = 1;
_root.dl = "";
mySound1.setVolume(ratio * 2);
This code is working for slider.I mean it scrolls the slider.but it dosent make any effect to sound.
Below is my button code.
stop();
mySoundBtn4.onRelease = function () {
mySoundC = new Sound(this);
mySoundC.attachSound("mySoundClip4");
mySoundC.start(0, 300); //10 represents the number of loops
gotoAndPlay("play1");
this is on button's frame.not exactly on button.
Button and Slider both are on diffrent scene.
Can you plese help me out? -
I have been developing a site and I am having issues with
something that is probably very simple. I have created several
movieclips that expand and contract as you roll over them. I wanted
to make a function/method so that when the user clicks, it takes
them to another scene in this movie. Here is the action script I am
using:
on(release) {
gotoAndPlay("Scene 9");
Unfortunately, this is not working. I thought that perhaps
the on(release) method wouldn't work on these movie clips based on
the action script I was already using to expand/contract the boxes,
but the following code works just fine:
on(release) {
getURL("home.html");
I'm stumped. Can anyone offer a suggestion as to what I
should do? Here is the web address of the page I'm working on, it
has the movie I'm having an issue with.
AndrewJW.com. The
first image on the left next to the word photography links to
another page of the site. The image of the pearl ring next to that
is the one that will not advance to another scene in the movie.
Thanks for any and all input.
AndrewJeckyl>
erm... ok i've to admit my mistake in 2nd script.
_root.gotoAndPlay() takes only ONE argument,
_root.gotoAndPlay("Scene 9", 1); won't works.
Thank for reminding me
actually this make me confuse sometime,
from the code hint in flash,
for
gotoAndPlay,
gotoAndPlay(
frame);
gotoAndPlay(
scene,
frame);
for
MovieClip.gotoAndPlay,
MovieClip.gotoAndPlay(
frame);
so, gotoAndPlay can accept 2 arguments only when use without
"something dot" in front.
if Andrew's script is attached to an instance of button
symbol, we can use
on(release) {
gotoAndPlay("Scene 9", 1);
Since Andrew will attach the script to an instance of
movieclip, he can only use:
on(release) {
gotoAndPlay("Scene 9");
where he have to give the label to the 1st frame of "Scene 9"
same name with the scene.
Am i right Jeckyl?
I heard many people said "scene"+"script"="buggy", but some
time I get it "works". What is your opinion? -
Help with Action script 2.0 please
Hi,
I am new to actionscript and i could really do with some help
please. I am trying to load external movie clips into two different
containers depending on which button is clicked. Sometimes there
may be two conatiners attached to a buuton click, whilst other
buttons may only need to load one movie clip. Here is the action
script i have been using:
button1.onPress = function () {
_root.createEmptyMovieClip("container", 1);
_root.createEmptyMovieClip("container1", 2);
unloadMovie("container1");
loadMovie("scene2.swf", "container");
loadMovie("scene5.swf", "container1");
container._x = 50 ;
container._y = 110 ;
container1._x = 170 ;
container1._y = 5 ;
button2.onPress = function () {
loadMovie("scene6.swf", "container");
unloadMovie("container1");
container._x = 50 ;
container._y = 110 ;
This does load the movies, however i have to press button one
first before button two will work. Ideally i need to be able to
call any movieclip at any time. Can anyone tell me where i am going
wrong?quote:
Originally posted by:
NedWebs
Try moving these lines outside of the button function:
_root.createEmptyMovieClip("container", 1);
_root.createEmptyMovieClip("container1", 2);
You can use "this" instead of "_root"... that'll save any
problem if you ever move this within some other movie. Also, move
the x/y assignments just under those lines since they relate to
them directly.
Hey thankyou for your help, that works now. although if i
move the x and y assignments i would have to create another
container right? Thanks again for your help.
Maybe you are looking for
-
Error message: E:Z1:019 while creating Group Chart of Account( FSP0)
Hi All I am having issue while crating new GL Account at FSP0 for Group Chart of Accounts. The Group COA has been copied from CONS COA for your kind information. SYSTEM: ECC6.0 Please any one has idea about how to handle this problem. Error Message:
-
File Adpater: Variable Substitution
Hi experts, I have a few questions regarding the variable substitution in the File-Adapter. I want to have it for my filename. For the variable substitution I can only take elements from the target structure, is that right? I know that I can take att
-
What can OS X 10.3.9 users do?...
What can OS X 10.3.9 users do?... An error appears at http://maps.bpl.org > You are trying to install Adobe Flash Player on an > unsupported operating system. For system requirements, > please visit: > Flash Player System Requirements http://www.adob
-
Differences between 4.6 version to Ecc5.0
Hi, Please give me what are the differences between 4.6 to ecc 5.o. with some examples. Regards: Raju.R
-
IPhoto don't read library after iPhone import
Since I update from Snow Leopard to Lion, all my pictures and photos are gone after iPhone picture import. My iPhoto Library can't be read after import pictures from the iPhone 4. So, I try to recover the library but the process (I wait 8 hours in 10