Add A Target To This AS3 URL Script?

Jun 14, 2010

Seems like AS3 is more about writing code than AS2.I would normally write the code on the button:

Code:

on(release){
getURL("http://sample.com". "_blank");
}

Instead in AS3 I have to do this for a button action:

Code:

myButton.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http://www.sample.com");
navigateToURL(request);
}

How do I add the _blank target function to this AS3 code. I am still trying to get use to this AS3 concept.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Stop Further Items Being Dragged Onto A Target When The Target Box Is Full?

Sep 29, 2003

On the attached exercise, is it possible to stop further items being dragged onto a target when the target box is full?

View 1 Replies

Flex4 :: Difference Between Target And Current Target

Nov 28, 2011

What is the difference between target and currenttarget in flex?What is the difference between Target and Current Target in Flex especially in mouse events.

View 2 Replies

ActionScript 3.0 :: Target Movieclip With E.target?

Aug 30, 2010

qi have a movieclip which is added to the stage:

var profileholder:profileHolder=new profileHolder ;

inside of profileholder is another movieclip(infoBtn) that acts as a button.when the mouse is over profileholder i want to do something with infoBtn like:

//profOver is the over state of profileholder
function profOver(e:Event) {
e.target.infoBtn.alpha=1;
}

this doesn't work and brings up this error:ReferenceError: Error #1069: Property infoBtn not found on flash.display.Loader and there is no default value.
at main_fla::MainTimeline/profOver()

i also tried:
function profOver(e:Event) {
var item:profileHolder=e.target as profileHolder;
item.infoBtn.alpha=1;
}

and get this error:TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 1 Replies

ActionScript 2.0 :: Error - Target Not Found: Target="whoweare" Base="_level0.instance20.instance48.instance49"

Mar 14, 2005

i don't know why this isn't working.i got a button. and when it's pressed, i need it to go and play a frame in a movie clip. i'll test it and then when i click on it, i get this:

Target not found: Target="whoweare" Base="_level0.instance20.instance48.instance49"

this is the code that i am using:

on (press) {
tellTarget ("whoweare") {
gotoAndPlay (51);
}
}

View 14 Replies

ActionScript 2.0 :: Target Not Found: Target="_root.icon01" Base="_level0"

Feb 16, 2005

so, i'm making an animated rollover, and i get an output error that says this:

Target not found: Target="_root.icon01" Base="_level0"

i have no idea what the base="_level0" means.

View 1 Replies

AS2 - Target An AttachMovie Mc?

May 14, 2009

Through attachMovie I have loaded an mc from the library onto the stage into "holder_mc".

myButton.onRelease = function () {
if (currentWork != "holder_mc.myWork1_mc") {
holder_mc.attachMovie("myWork_mc","myWork1_mc", getNextHighestDepth());
currentWork = "holder_mc.myWork1_mc";
}
}

This works.

However, there are a couple of buttons (mc) inside "myWork1_mc" which skips through a few slides in the myWork1_mc clip that I cannot target. I thought using:

holder_mc.myWork1_mc.buttonName_mc.onRelease = function () {
trace("MC_pressed");
}

... would work. My curser doesn't even change to the hand symbol. How do I target an dymanically loaded MC from the library which is inside an empty holder MC on the stage via attachMovie? What am i missing? Believe me, I have spent hours trying to google it.

Note: at this stage there is no other script on "holder_mc", but there will be at a later date, but I'll cross that bridge when I get to it. Also, the buttons work when I place the MC onto the stage and not use attachMovie.

View 6 Replies

CS3 Get URL Window Target

Jun 17, 2009

I have a simple button that goes to a URL when clicked, but it's opening a new window. I want it to target "_self"-- but I'm getting errors. How do I properly target the same window?

[Code]..

View 1 Replies

ActionScript 3.0 :: How To Target Mc

Jan 10, 2010

I used to use an old school method in AS2 to talk to a movieclip to go to different states like on rollover but how do I do this in AS3 now?

Code:
on (rollOver) {
with (myclip) {
gotoAndStop("on");
}
}

I know that with went out a long time ago but it worked!I know in AS3 to handle a click you have to do this:

Code:
mybtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1);
}

what I want to do with targeting a rollover with a button.

View 3 Replies

ActionScript 2.0 :: Target A MC In Another SWF?

Oct 10, 2005

I need to have a button to target a movie clip in a separate swf placed in a separate window.

//
on(release){
getURL(theotherswf.html+nameof_mc);
}

View 1 Replies

LightBox - How To Target SWF

Jul 30, 2007

I have a flash template that I added a flash and xml driven component to. The component is a carousel menu with a lightbox that displays images. The lightbox part of it keeps loading behind my flash page, no matter what I set the z-index to on the lightbox.css. Is there a way to control the z-index of the flash file in the website's style.css? I tried adding it to the Body of the css but that doesn't work. How do I target the swf? I've never used css before. How to get it to load the lightbox above the flash.

View 2 Replies

ActionScript 3.0 :: Get Value From Target Value?

Feb 3, 2012

does anyone know how i can matching random value. what kind algorithm that i need to use? the value is no always close to the first value. ex : array 6 x 6. location first value is in 1.1 and the second value is in 3.4. the question is what algorithm i have to use to get value from target value?

View 4 Replies

ActionScript 3.0 :: Shooting A Target?

Apr 24, 2009

I have a monster_mc that shoots a bullet_mc at a target_mc.When I click the Keyboard.RIGHT the bullet jumps once then hesitates or pauses then continues -=25 pixels, instead of shooting smoothly.Am I missing something here?, can I make it perform better?

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
target_mc.stop();
function keyPressed(event:KeyboardEvent):void[code].....

View 1 Replies

ActionScript 3.0 :: Can't Use The As XML Instead Of XML(e.target.data)?

Jun 28, 2009

I want to know why I can't use this code PHP Code:

[Code]...

I know the problem is Code: xml=e.target.data as XML; but I want to know why I can't use the as XML instead of XML(e.target.data)?

View 2 Replies

ActionScript 3.0 :: Target Flash From PHP?

Jun 17, 2010

I am using AS3 and PHP. I have created a flash animation and and it put in a index.php file. Its a web site, some pages are in flash and some pages are (like shopping cart) not in flash. My problem is when i am in pure php page (cart page) when i click the link about us, it should go a particular frame or particular content in the flash, instead of running from the beginning.

View 1 Replies

ActionScript 3.0 :: Evt.target.name Only Works Once?

Jul 8, 2010

I have a simple event listener which calls a functions which first uses a switch case statement to determine what evt.target was pressed by name so I can assign info there--presently I just have trace statements--the problem is that it only works once and then I just get instance29 and the switch case evaluates to the default.

Code:
lifering1.addEventListener(MouseEvent.MOUSE_OVER, playSplash,false,0,true);
function playSplash(evt:MouseEvent):void
{

[Code].....

View 21 Replies

Using Variables To Target An Array?

Jun 1, 2011

Its easier explained if I just write down the code:

function loadMc(frame:Number){
aNum = "array"+frame;
array1 = ["mcname", "identifier", "200"];

[code].....

View 1 Replies

ActionScript 3.0 :: Change Target When Swf Not Available?

Dec 8, 2008

I want to redirect the following code when the target isn't
available.

function buttonClick(event:MouseEvent):void
{
gotoAndStop(event.target.name);

[Code]....

The code works great but I'm building a large site and would like to have a default swf that loads when the target isn't available. I tried various if statements when event.target.name == null but haven't been able to get any of them to work.

View 7 Replies

ActionScript 3.0 :: Get Parent Of E.target.name?

Jul 16, 2009

How would you get the name of the parent of a movieclip? below is only some of the options I tried to trace.
  
function getParentName(e:MouseEvent):void{
trace(e.target.parent.name);
trace(parent(e.target));

[Code]....

View 2 Replies

ActionScript 3.0 :: Target Two Different Levels?

Aug 15, 2009

On frame 30 of my root timeline, I have dragged five different instances from my library onto the stage. I gave each one a distinct name, oneBtn, twoBtn, threeBtn, fourBtn, fiveBtn. I added a MouseEvent for each of these five objects, and ran a Trace to make sure I am able to identify the objects. At first, I used e.target.name but it returned instanceXX (instance23, instance84, instance83...). I think this happened because within each of those buttons, I had a movie clip within it so I can apply filters to them. I decided to trace e.target.parent.name. On two of the five objects, I was able to trace oneBtn, and twoBtn. On the other three, I still got instanceXX. I tried tracing e.target.parent.parent.name and I was able to trace the other three buttons, threeBtn, fourBtn, fiveBtn.
 
how come I need to target two different levels (e.target.parent.name & e.target.parent.parent.name) on my objects when I dragged them from the library and placed them onto the stage within the same timeline?

View 4 Replies

ActionScript 3.0 :: Btn Not Being Recognized Through E.target.name?

Nov 21, 2009

I had this posted in another post I had which was answered and it also had a lame post name so I have reposted it here I can not figure out why my code here is not working.... (i guess that's pretty obvious or I would not be posting it!).
 
Would you mind taking a look at this and possible you can spot what it is that I have wrong?
  
I am getting the error:TypeError: Error #2007: Perameter url must be non-null. at flash.display::Loader/_load() at flash.display::Loader/load() at asFiles.reality::RealityScenarios/loadImage()[C:(networkpath).as:226]

[Code]...

View 16 Replies

ActionScript 3.0 :: Target Mc Name With String?

Nov 23, 2009

I don't know how to exactly name my problem but I will try.

I have a variable that is sting for example:

var variable:String = "test";

I have the mc with instance name test_page for example.

How I can create tween for this test_page mc merging the content of the "variable" string and word "_page".

View 3 Replies

ActionScript 3.0 :: XML - How To Target Child

Feb 19, 2010

<?xml version="1.0" encoding="UTF-8"?>
<tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1"  xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">
<head>
<styling>

[code].....
 
I think this is a simple question, but can't quite figure it out. How would i read the <div> that is english "en"?
 
something like this - tho this does not work:

trace(_xml.div.(@lang=="en"));

View 3 Replies

Professional :: Target A MC From Within A Function In CS3?

Apr 23, 2010

When trying to target a MC from within a function in CS3, I often run into problems though I still can't put my finger on it. When targeting the movie clip outside of a function (in this case I'm populating some dynamic text fields) everything is fine.  In those cases, I use "this." in front of the MC name. I've tried that syntax and the the MC instance name without "this." within the function and nothing.  So I seem to be missing something fundamental about AS3.

View 10 Replies

Professional :: Target Mc On A Certain Frame Within Another Mc?

Jun 14, 2010

I have a movie clip on my stage that has its own timeline with 7 frames, each a keyframe with different content. How would I target a movie clip that appears only on one of these frames within the parent clip?

I'm used to using dot syntax to target clips within clips (eg. parentClip.myClip.onRelease = function(){...), but when I try this with a clip that only appears on one of the frames in the parent clip it doesn't work. Do I need to address that frame specifically? How would I do this? I'm using AS2 in CS3 on a Mac.

View 2 Replies

ActionScript 1/2 :: Target Movieclip Within This?

Jul 14, 2010

I have some buttons working great on my main timeline using this code on the actual timeline[code]...

So I know I need to make Revlon_mc into another movieclip (so I can do the actual animation inside this movie clip and move it easily around the main timeline) but I'm not what the code would be (something to do with parent perhaps??) and would I still keep the code on the main timeline or would it sit within the new moviclip just created?

View 3 Replies

ActionScript 3.0 :: Pass The Name Of The Last Target?

Jul 20, 2010

var lastItem:string;
if (lastItem != e.currentTarget.name) {
menu1.lastItem.gotoAndPlay("s2");

lastItem == e.currentTarget.name;
 
It doesn't like me using the string lastItem for the value of the previous currentTarget.name. How do I pass the name of the last target?

View 13 Replies

ActionScript 3.0 :: Target Or CurrentTarget?

Feb 18, 2011

I have 3 movieclips. Each sends the game to one level. Inside each movieclip theres more movieclips.

[Code]...

View 2 Replies

ActionScript 3.0 :: Target FP 10.3 From Flash CS5 Mac

Jul 4, 2011

So how can I compile for 10.3 or 10.2 from the Flash CS5 IDE on mac? Where do I get the needed files?

View 11 Replies

Opening Link In Target

May 21, 2010

I have a flash menu which i'm trying to get to open in a target "_ibody".The default code for a button is:[code]

View 2 Replies







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